Defines a new function for Selenium to locate elements on the page.
function self:addLocationStrategy( strategyName, functionDefinition )
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:allowNativeXpath( allow )
Press the alt key and hold it down until doAltUp() is called or a new page is loaded.
function self:altKeyDown()
Release the alt key.
function self:altKeyUp()
Instructs Selenium to return the specified answer string in response to the next JavaScript prompt [window.prompt()].
function self:answerOnNextPrompt( answer )
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:assignId( locator, identifier )
Sets a file input (upload) field to the file listed in fileLocator
function self:attachFile( fieldLocator, fileLocator )
Captures a PNG screenshot to the specified file.
function self:captureScreenshot( filename )
Capture a PNG screenshot.
function self:captureScreenshotToString()
Check a toggle-button (checkbox/radio)
function self:check( locator )
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:chooseCancelOnNextConfirmation()
Undo the effect of calling chooseCancelOnNextConfirmation.
function self:chooseOkOnNextConfirmation()
Clicks on a link, button, checkbox or radio button.
function self:clickAt( locator, coordString )
Simulates the user clicking the “close” button in the titlebar of a popup window or tab.
function self:close()
Simulates opening the context menu for the specified element (as might happen if the user “right-clicked” on the element).
function self:contextMenuAt( locator, coordString )
Press the control key and hold it down until doControlUp() is called or a new page is loaded.
function self:controlKeyDown()
Release the control key.
function self:controlKeyUp()
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:createCookie( nameValuePair, optionsString )
Calls deleteCookie with recurse=true on all cookies visible to the current page.
function self:deleteAllVisibleCookies()
Selects the main window.
function self:deselectPopUp()
Build the HTTP request will be sent to the server
function self:doCommand( action, args )
Doubleclicks on a link, button, checkbox or radio button.
function self:doubleClickAt( locator, coordString )
Drags an element a certain distance and then drops it
function self:dragAndDrop( locator, movementsString )
Drags an element and drops it on another element
function self:dragAndDropToObject( locatorOfObjectToBeDragged, locatorOfDragDestinationObject )
Explicitly simulate an event, to trigger the corresponding “onevent” handler.
function self:fireEvent( locator, eventName )
Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
function self:getAlert()
returns the IDs of all buttons on the page.
function self:getAllButtons()
returns the IDs of all input fields on the page.
function self:getAllFields()
returns the IDs of all links on the page.
function self:getAllLinks()
returns the IDs of all windows that the browser knows about in an array.
function self:getAllWindowIds()
returns the names of all windows that the browser knows about in an array.
function self:getAllWindowNames()
returns the titles of all windows that the browser knows about in an array.
function self:getAllWindowTitles()
Gets the value of an element attribute.
function self:getAttribute( attributeLocator )
Gets the entire text of the page.
function self:getBodyText()
function getBoolean( action, args )
Retrieves the message of a JavaScript confirmation dialog generated during the previous action.
function self:getConfirmation()
function self:getCookie()
function self:getCookieByName( name )
Retrieves the text cursor position in the given input element or textarea-- beware, this may not work perfectly on all browsers.
function self:getCursorPosition( locator )
Retrieves the height of an element
function self:getElementHeight( locator )
Get the relative index of an element to its parent (starting from 0).
function self:getElementIndex( locator )
Retrieves the horizontal position of an element
function self:getElementPositionLeft( locator )
Retrieves the vertical position of an element
function self:getElementPositionTop( locator )
Retrieves the width of an element
function self:getElementWidth( locator )
Gets the result of evaluating the specified JavaScript snippet.
function self:getEval( script )
returns the entire HTML source between the opening and closing “html” tags.
function self:getHtmlSource()
returns the number of pixels between “mousemove” events during dragAndDrop commands (default=10).
function self:getMouseSpeed()
function self:getNumber( action, args )
Gets option element ID for selected option in the specified select element.
function self:getSelectedId( selectLocator )
Gets all option element IDs for selected options in the specified select or multi-select element.
function self:getSelectedIds( selectLocator )
Gets option index (option number, starting at 0) for selected option in the specified select element.
function self:getSelectedIndex( selectLocator )
Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.
function self:getSelectedIndexes( selectLocator )
Gets option label (visible text) for selected option in the specified select element.
function self:getSelectedLabel( selectLocator )
Gets all option labels (visible text) for selected options in the specified select or multi-select element.
function self:getSelectedLabels( selectLocator )
Gets all option values (value attributes) for selected options in the specified select or multi-select element.
function self:getSelectedValue( selectLocator )
Gets all option labels in the specified select drop-down.
function self:getSelectOptions( selectLocator )
Get a Selenium Session
function self:getSession( action )
Get execution speed (i.e., get the millisecond length of the delay following each selenium operation).
function self:getSpeed()
function self:getString( action, args )
Gets the text from a cell of a table.
function self:getTable( tableCellAddress )
Gets the text of an element.
function self:getText( locator )
Determine whether current/locator identify the frame containing this running code.
function self:getWhetherThisFrameMatchFrameExpression( currentFrameString, target )
Determine whether currentWindowString plus target identify the window containing this running code.
function self:getWhetherThisWindowMatchWindowExpression( currentWindowString, target )
returns the number of nodes that match the specified xpath, eg.
function self:getXpathCount( xpath )
Simulates the user clicking the “back” button on their browser.
function self:goBack()
riefly changes the backgroundColor of the specified element yellow.
function self:highlight( locator )