Browser

From UBot Playground
Jump to: navigation, search

This fixture allows for interaction with the main browser.


Contents

Properties[edit]

IsDomReady[edit]

Returns a boolean determining whether the dom is ready to be modified.

url[edit]

userAgent[edit]

visible[edit]

allowCss[edit]

allowImages[edit]

allowJavascript[edit]

allowPlugins[edit]

width[edit]

This will tell you the current browser width.

height[edit]

This will tell you the current browser height.

downloadedFile[edit]

The temporary file path of a file after being downloaded via a file download dialog.

proxy[edit]

referrer[edit]

Events[edit]

cursorChanged[edit]

domBecameReady[edit]

finishedLoading[edit]

viewScrolled[edit]

urlUpdated[edit]

beganLoading[edit]

Functions[edit]

Basic Browser Controls:[edit]

navigate[edit]

(url as String)

cut[edit]

stopNavigation[edit]

undo[edit]

paste[edit]

delete[edit]

forward[edit]

refresh[edit]

zoom[edit]

not currently functional

copy[edit]

selectAll[edit]

back[edit]

unfocus[edit]

tells the browser it’s been unfocused

focus[edit]

tells the browser it’s been focused


Low Level Access Functions For Existing UBot Commands:[edit]

getChosenImage[edit]

gets the chosen element image as a BitMap

clearCookies[edit]

typeText (text As String, keyEvent As String)[edit]

keyEvent can be:

  • Standard
  • Key Down
  • Key Up
  • Key Press
  • Flash Plugin

allowPopups[edit]

  • Yes
  • In New Window
  • No

closePage[edit]

resetHeaders[edit]

setProxyCredentials[edit]

(username As String, password As String)

setReferrer[edit]

(value As String)

setVisible[edit]

(value As Boolean)

setWebsiteCredentials[edit]

(username As String, password As String)

loadHtml[edit]

(html As String)

runJavascript[edit]

(javascript As String)

setAllowCss[edit]

(value As Boolean)

setAllowImages[edit]

(value As Boolean)

eval[edit]

(javascript As String) returns a string if the eval return an object, this will return a JSON string representing the object

setAllowJavascript[edit]

(value As Boolean)

setAllowPopups[edit]

(value As Boolean)

setHeader[edit]

(name As String, value As String)

getDownloadedFile[edit]

getFullBrowserImage[edit]

gets the current browser image as a BitMap

changeUserAgent[edit]

(userAgent As String)


Low level Helper Functions:[edit]

setLogLevel (level As String)[edit]

off on

choose (elementSelector As Object)[edit]

this function should be used when making a new command the element parameter editor will provide the elementSelector needed for this function this function returns an integer representing how many elements were found

downloadData[edit]

using the current browser session, this downloads a file as a byte array

getContentSize[edit]

returns a Drawing.Point with the current browser size.


Process Control:[edit]

kill[edit]

kills the connected browser process

resetBrowser[edit]

restarts the connected browser process


Input Controls:[edit]

keyDown[edit]

virtualKey As Integer, Optional shiftPressed As Boolean = False, Optional controlPressed As Boolean = False, Optional altPressed As Boolean = False, Optional metaPressed As Boolean = False)

keyUp[edit]

(virtualKey As Integer, Optional shiftPressed As Boolean = False, Optional controlPressed As Boolean = False, Optional altPressed As Boolean = False, Optional metaPressed As Boolean = False)

keypress[edit]

(character as Char)

keypress[edit]

(virtualKey As Integer, Optional shiftPressed As Boolean = False, Optional controlPressed As Boolean = False, Optional altPressed As Boolean = False, Optional metaPressed As Boolean = False)

mouseUp[edit]

(button As Integer)

mouseDown[edit]

(button As Integer)

mouseMove[edit]

(x As Double, y As Double)

mouseOver[edit]

(x As Double, y As Double)

mouseWheel[edit]

(delta As Integer)

click[edit]

(useLocation As Boolean, timeout As TimeSpan)


Wait Functions:[edit]

waitForBeganLoading[edit]

waitForBrowserReady[edit]

waitForContentsFinishedLoading[edit]

waitForDomReady[edit]

waitForDownloadAvailable[edit]

waitForDownloadComplete[edit]

waitForFinishedLoading[edit]