Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 addLocationStrategy
 allowNativeXpath
 altKeyDown
 altKeyUp
 answerOnNextPrompt
 assignId
 attachFile
C
 captureScreenshot
 captureScreenshotToString
 check
 chooseCancelOnNextConfirmation
 chooseOkOnNextConfirmation
 clickAt
 close
 contextMenuAt
 controlKeyDown
 controlKeyUp
 createCookie
D
 deleteAllVisibleCookies
 deselectPopUp
 doCommand
 doubleClickAt
 dragAndDrop
 dragAndDropToObject
F
 fireEvent
 Functions
G
 getAlert
 getAllButtons
 getAllFields
 getAllLinks
 getAllWindowIds
 getAllWindowNames
 getAllWindowTitles
 getAttribute
 getBodyText
 getBoolean
 getConfirmation
 getCookie
 getCookieByName
 getCursorPosition
 getElementHeight
 getElementIndex
 getElementPositionLeft
 getElementPositionTop
 getElementWidth
 getEval
 getHtmlSource
 getMouseSpeed
 getNumber
 getSelectedId
 getSelectedIds
 getSelectedIndex
 getSelectedIndexes
 getSelectedLabel
 getSelectedLabels
 getSelectedValue
 getSelectOptions
 getSession
 getSpeed
 getString
 getTable
 getText
 getWhetherThisFrameMatchFrameExpression
 getWhetherThisWindowMatchWindowExpression
 getXpathCount
 goBack
H
 highlight
function self:addLocationStrategy(strategyName,
functionDefinition)
Defines a new function for Selenium to locate elements on the page.
function self:allowNativeXpath(allow)
Specifies whether Selenium should use the native in-browser implementation of XPath (if any native version is available)-- if you pass “false” to this function, we will always use our pure-JavaScript xpath library.
function self:altKeyDown()
Press the alt key and hold it down until doAltUp() is called or a new page is loaded.
function self:altKeyUp()
Release the alt key.
function self:answerOnNextPrompt(answer)
Instructs Selenium to return the specified answer string in response to the next JavaScript prompt [window.prompt()].
function self:assignId(locator,
identifier)
Temporarily sets the “id” attribute of the specified element, so you can locate it in the future using its ID rather than a slow/complicated XPath.
function self:attachFile(fieldLocator,
fileLocator)
Sets a file input (upload) field to the file listed in fileLocator
function self:captureScreenshot(filename)
Captures a PNG screenshot to the specified file.
function self:captureScreenshotToString()
Capture a PNG screenshot.
function self:check(locator)
Check a toggle-button (checkbox/radio)
function self:chooseCancelOnNextConfirmation()
By default, Selenium’s overridden window.confirm() function will return true, as if the user had manually clicked OK-- after running this command, the next call to confirm() will return false, as if the user had clicked Cancel.
function self:chooseOkOnNextConfirmation()
Undo the effect of calling chooseCancelOnNextConfirmation.
function self:clickAt(locator,
coordString)
Clicks on a link, button, checkbox or radio button.
function self:close()
Simulates the user clicking the “close” button in the titlebar of a popup window or tab.
function self:contextMenuAt(locator,
coordString)
Simulates opening the context menu for the specified element (as might happen if the user “right-clicked” on the element).
function self:controlKeyDown()
Press the control key and hold it down until doControlUp() is called or a new page is loaded.
function self:controlKeyUp()
Release the control key.
function self:createCookie(nameValuePair,
optionsString)
Create a new cookie whose path and domain are same with those of current page under test, unless you specified a path for this cookie explicitly.
function self:deleteAllVisibleCookies()
Calls deleteCookie with recurse=true on all cookies visible to the current page.
function self:deselectPopUp()
Selects the main window.
function self:doCommand(action,
args)
Build the HTTP request will be sent to the server
function self:doubleClickAt(locator,
coordString)
Doubleclicks on a link, button, checkbox or radio button.
function self:dragAndDrop(locator,
movementsString)
Drags an element a certain distance and then drops it
function self:dragAndDropToObject(locatorOfObjectToBeDragged,
locatorOfDragDestinationObject)
Drags an element and drops it on another element
function self:fireEvent(locator,
eventName)
Explicitly simulate an event, to trigger the corresponding “onevent” handler.
function self:getAlert()
Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
function self:getAllButtons()
returns the IDs of all buttons on the page.
function self:getAllFields()
returns the IDs of all input fields on the page.
function self:getAllLinks()
returns the IDs of all links on the page.
function self:getAllWindowIds()
returns the IDs of all windows that the browser knows about in an array.
function self:getAllWindowNames()
returns the names of all windows that the browser knows about in an array.
function self:getAllWindowTitles()
returns the titles of all windows that the browser knows about in an array.
function self:getAttribute(attributeLocator)
Gets the value of an element attribute.
function self:getBodyText()
Gets the entire text of the page.
function getBoolean(action,
args)
function self:getConfirmation()
Retrieves the message of a JavaScript confirmation dialog generated during the previous action.
function self:getCookie()
function self:getCookieByName(name)
function self:getCursorPosition(locator)
Retrieves the text cursor position in the given input element or textarea-- beware, this may not work perfectly on all browsers.
function self:getElementHeight(locator)
Retrieves the height of an element
function self:getElementIndex(locator)
Get the relative index of an element to its parent (starting from 0).
function self:getElementPositionLeft(locator)
Retrieves the horizontal position of an element
function self:getElementPositionTop(locator)
Retrieves the vertical position of an element
function self:getElementWidth(locator)
Retrieves the width of an element
function self:getEval(script)
Gets the result of evaluating the specified JavaScript snippet.
function self:getHtmlSource()
returns the entire HTML source between the opening and closing “html” tags.
function self:getMouseSpeed()
returns the number of pixels between “mousemove” events during dragAndDrop commands (default=10).
function self:getNumber(action,
args)
function self:getSelectedId(selectLocator)
Gets option element ID for selected option in the specified select element.
function self:getSelectedIds(selectLocator)
Gets all option element IDs for selected options in the specified select or multi-select element.
function self:getSelectedIndex(selectLocator)
Gets option index (option number, starting at 0) for selected option in the specified select element.
function self:getSelectedIndexes(selectLocator)
Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.
function self:getSelectedLabel(selectLocator)
Gets option label (visible text) for selected option in the specified select element.
function self:getSelectedLabels(selectLocator)
Gets all option labels (visible text) for selected options in the specified select or multi-select element.
function self:getSelectedValue(selectLocator)
Gets all option values (value attributes) for selected options in the specified select or multi-select element.
function self:getSelectOptions(selectLocator)
Gets all option labels in the specified select drop-down.
function self:getSession(action)
Get a Selenium Session
function self:getSpeed()
Get execution speed (i.e., get the millisecond length of the delay following each selenium operation).
function self:getString(action,
args)
function self:getTable(tableCellAddress)
Gets the text from a cell of a table.
function self:getText(locator)
Gets the text of an element.
function self:getWhetherThisFrameMatchFrameExpression(currentFrameString,
target)
Determine whether current/locator identify the frame containing this running code.
function self:getWhetherThisWindowMatchWindowExpression(currentWindowString,
target)
Determine whether currentWindowString plus target identify the window containing this running code.
function self:getXpathCount(xpath)
returns the number of nodes that match the specified xpath, eg.
function self:goBack()
Simulates the user clicking the “back” button on their browser.
function self:highlight(locator)
riefly changes the backgroundColor of the specified element yellow.