The following is a list of all selenium commands supported by the Blue Triangle synthetic agent.
assertElementNotPresent
assertElementNotPresent(locator)
Generated from isElementPresent(locator)
Arguments: *locator - an element locator.
Returns: true if the element is present, false otherwise
assertElementPresent
assertElementPresent(locator)
Generated from isElementPresent(locator)
Arguments: *locator - an element locator.
Returns: true if the element is present, false otherwise
assertNotVisible
assertNotVisible(locator)
Generated from isVisible(locator)
Arguments: *locator - an element locator.
Returns: true if the specified element is visible, false otherwise
assertTextNotPresent
assertTextNotPresent(pattern)
This command is deprecated. Use the assertNotText commandwith an element locator instead.
Generated from isTextPresent(pattern)
Arguments: *pattern - a pattern to match with the text of the page.Returns: true if the pattern matches the text, false otherwise
assertTextPresent
assertTextPresent(pattern)
This command is deprecated. Use the assertText command with an element locator instead.
Generated from isTextPresent(pattern)
Arguments: *pattern - a pattern to match with the text of the page.Returns: true if the pattern matches the text, false otherwise
assertTitle
assertTitle(pattern)
Generated from getTitle().
Returns: the title of the current page
assertVisible
assertVisible(locator)
Generated from isVisible(locator)
Arguments: *locator - an element locator.
Returns: true if the specified element is visible, false otherwise
verifyElementNotPresent
verifyElementNotPresent(locator)
Generated from isElementPresent(locator)
Arguments: *locator - an element locator.
Returns: true if the element is present, false otherwise
verifyElementPresent
verifyElementPresent(locator)
Generated from isElementPresent(locator)
Arguments: *locator - an elementlocator.
Returns: true if the element is present, false otherwise
verifyEval
verifyEval(script, pattern)
Generated from getEval(script)
Arguments:*script - the JavaScript snippet to run.
*pattern - a pattern to match with the text of the page.
Returns: the results of evaluating the snippet
verifyNotVisible
verifyNotVisible(locator)
Generated from isVisible(locator)
Arguments:*locator - an element locator.
Returns: true if the specified element is visible, false otherwise
verifyTextNotPresent
verifyTextNotPresent(pattern)
This command is deprecated. Use the verifyNotText command with an element locator instead.
Generated from isTextPresent(pattern)
Arguments:*pattern - a pattern to match with the text of the page.
Returns: true if the pattern matches the text, false otherwise
verifyTextPresent
verifyTextPresent(pattern)
This command is deprecated. Use the verifyText command with an element locator instead.
Generated from isTextPresent(pattern)
Arguments:*pattern - a pattern to match with the text of the page.
Returns: true if the pattern matches the text, false otherwise
waitForElementNotPresent
waitForElementNotPresent(locator)
Generated from isElementPresent(locator)
Arguments: *locator - an element locator.
Returns: true if the element is present, false otherwise
waitForElementPresent
waitForElementPresent(locator)
Generated from isElementPresent(locator)
Arguments: *locator - an elementlocator.
Returns: true if the element is present, false otherwise
waitForNotVisible
waitForNotVisible(locator)
Generated from isVisible(locator)
Arguments: *locator - an element locator.
Returns: true if the specified element is visible, false otherwise
waitForPopUp
waitForPopUp(windowID, timeout)
Waits for a popup window to appear and load up.
Arguments:*windowID - the JavaScript window name of the window that will appear (not the text of the title bar) If unspecified, or specified as null, this command will wait for the first non-top window to appear (don't rely on this if you are working with multiple popups simultaneously).
*timeout - a timeout in milliseconds, after which the action will return with an error. If this value is not specified, the default Selenium timeout will be used. See the setTimeout() command.
waitForTextNotPresent
waitForTextNotPresent(pattern)
This command is deprecated. Use the waitForNotText command with an element locator instead.
Generated from isTextPresent(pattern)
Arguments:*pattern - a pattern to match with the text of the page.
Returns: true if the pattern matches the text, false otherwise
waitForTextPresent
waitForTextPresent(pattern)
This command is deprecated. Use the waitForText command with an element locator instead.
Generated from isTextPresent(pattern)
Arguments:*pattern - a pattern to match with the text of the page.
Returns: true if the pattern matches the text, false otherwise
waitForVisible
waitForVisible(locator)
Generated from isVisible(locator)
Arguments:*locator - an element locator.
Returns: true if the specified element is visible, false otherwise
check
check(locator)
Check a toggle-button (checkbox/radio)
Arguments:*locator - an element locator
click
click(locator)
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad.
Arguments: *locator - an element locator
clickAndWait
clickAndWait(locator)
Generated from click(locator)
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad.
Arguments:*locator - an element locator
clickAt
clickAt(locator, coordString)
Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad.
Arguments: *locator - an element locator
*coordString - specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.
createCookie
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.
Arguments:*nameValuePair - name and value of the cookie in a format “name=value”
*optionsString - options for the cookie. Currently supported options include 'path', 'max_age' and 'domain'. The optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second.
Note that specifying a domain that isn't a subset of the current domain will usually fail.
deleteAllVisibleCookies
deleteAllVisibleCookies()
Calls deleteCookie with recurse=true on all cookies visible to the current page. As noted on the documentation for deleteCookie, recurse=true can be much slower than simply deleting the cookies using a known domain/path.
deleteCookie
deleteCookie(name, optionsString)
Delete a named cookie withspecified path and domain. Be careful; to delete a cookie, you need to deleteit using the exact same path and domain that were used to create the cookie.If the path is wrong, or the domain is wrong, the cookie simply won't bedeleted. Also note that specifying a domain that isn't a subset of thecurrent domain will usually fail. Since there's no way to discover at runtimethe original path and domain of a given cookie, we've added an option called'recurse' to try all sub-domains of the current domain with all paths thatare a subset of the current path. Beware; this option can be slow. In big-Onotation, it operates in O(n*m) time, where n is the number of dots in thedomain name and m is the number of slashes in the path.
Arguments:*name - the name of the cookie to be deleted *optionsString - options for thecookie. Currently supported options include 'path', 'domain' and 'recurse.' The optionsString's format is "path=/path/, max_age=60,domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail.
fireEvent
fireEvent(locator, eventName)
Explicitly simulate an event, to trigger the corresponding "onevent" handler.
Arguments:*locator - an element locator
*eventName - the event name, e.g. focus or blur
open
open(url)
Opens an URL in the test frame.This accepts both relative and absolute URLs. The "open" commandwaits for the page to load before proceeding, ie. the "AndWait"suffix is implicit.
Note: The URL must be on the same domain asthe runner HTML due to security restrictions in the browser (Same OriginPolicy). If you need to open an URL on another domain, use the SeleniumServer to start a new browser session on that domain.
Arguments:*url - the URL to open; may be relative or absolute
pause
pause(waitTime)
Wait for the specified amount of time (in milliseconds)
Arguments: *waitTime - the amount of time to sleep (in milliseconds)
refresh
refresh()
Simulates the user clicking the "Refresh" button on their browser.
runScript
runScript(script)
A Creates a new "script" tag in the body of the current test window, and adds the specified text into the body of the command. Scripts run in this way can often be debugged more easily than scripts executed using Selenium's "getEval" command. Beware that JS exceptions thrown in these script tags aren't managed by Selenium, so you should probably wrap your script in try/catch blocks if there is any chance that the script will throw an exception.
Arguments:*script - the JavaScript snippet to run
select
select(selectLocator, optionLocator)
Select an option from a drop-down using an option locator.
Option locators provide different ways of specifying options of an HTML Select element (e.g. for selecting a specific option, or for asserting that the selected option satisfies a specification). There are several forms of Select Option Locator.
- label = labelPattern:matches options based on their labels, i.e. the visible text. (This is the default.) label=regexp:^[Oo]ther
- value=valuePattern:matches options based on their values. value=other
- id=id:matches options based on their ids. id=option1
- index=index:matches an option based on its index (offset from zero). index=2
If no option locator prefix is provided, the default behavior is to match on label.
Arguments:*selectLocator - an element locator identifying a drop-down menu
*optionLocator - an option locator (a label by default)
selectFrame
selectFrame(locator)
- locator - an element locator identifying a frame or iframe
Selects a frame within the current window. (You may invoke this command multiple times to select nested frames.) To select the parent frame, use "relative=parent" as a locator; to select the top frame, use "relative=top". You can also select a frame by its 0-based index number; select the first frame with "index=0", or the third frame with "index=2".
You may also use a DOM expression to identify the frame you want directly, like this: dom=frames["main"].frames["subframe"]
selectWindow
selectWindow(windowID)
Selects a popup window using a window locator; once a popup window has been selected, all commands go to that window. To select the main window again, use null as the target.
Window locators provide different ways of specifying the window object: by title, by internal JavaScript "name," or by JavaScript variable.
- title=MySpecial Window: Finds the window using the text that appears in thetitle bar. Be careful; two windows can share the same title. If thathappens, this locator will just pick one.
- name=myWindow:Finds the window using its internal JavaScript "name" property.This is the second parameter "windowName" passed to theJavaScript method window.open(url, windowName, windowFeatures,replaceFlag) (which Selenium intercepts).
- var=variableName:Some pop-up windows are unnamed (anonymous), but are associated with aJavaScript variable name in the current application window, e.g."window.foo = window.open(url);". In those cases, you can openthe window using "var=foo".
If no window locator prefix is provided, we'll try to guess what you mean like this:
1. if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser).
2. if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed that this variable contains the return value from a call to the JavaScript window.open() method.
3. Otherwise, selenium looks in a hash it maintains that maps string names to window "names".
4. If that fails, we'll try looping over all of the known windows to try to find the appropriate "title". Since "title" is not necessarily unique, this may have unexpected behavior.
If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages like the following for each window as it is opened:
debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"
In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow").
Arguments:*windowID - the JavaScript window ID of the window to select
sendKeys
sendKeys(locator, value)
Simulates keystroke events on the specified element, as though you typed the value key-by-key.
This simulates a real user typing every character in the specified string; it is also bound by the limitations of a real user, like not being able to type into a invisible or read only elements. This is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events.
Unlike the simple "type" command, which forces the specified value into the page directly, this command will not replace the existing content. If you want to replace the existing contents, you need to use the simple "type" command to set the value of the field to empty string to clear the field and then the "sendKeys" command to send the keystroke for what you want to type.
For those who are interested in the details, unlike the typeKeys command, which tries to fire the keyDown, the keyUp and the keyPress events, this command is backed by the atoms from Selenium 2 and provides a much more robust implementation that will be maintained in the future.
Arguments:*locator - an element locator
*value - the value to type
setTimeout
setTimeout(timeout)
Specifies the amount of time that Selenium will wait for actions to complete.
Actions that require waiting include the "waitFor*" actions.
The default timeout is 60 seconds.
Arguments:*timeout - a timeout in milliseconds, after which the action will return with an error
store
store(expression, variableName)
This command is a synonym forstoreExpression.
Arguments:*expression - thevalue to store
*variableName - the name of a variable in which the result is to be stored.
submit
submit(formLocator)
Submit the specified form. This is particularly useful for forms without submit buttons, e.g. single-input "Search" forms.
Arguments:*formLocator - an element locator for the form you want to submit
type
type(locator, value)
Sets the value of an input field, as though you typed it in.
Can also be used to set the value of combo boxes, check boxes, etc. In these cases, value should be the value of the option selected, not the visible text.
Arguments:*locator - an element locator
*value - the value to type
typeKeys
typeKeys(locator, value)
This command is deprecated. Use the sendKeys command instead.
Simulates keystroke events on the specified element, as though you typed the value key-by-key.
This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string; this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events.
Unlike the simple "type" command, which forces the specified value into the page directly, this command may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in the field.
In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to send the keystroke events corresponding to what you just typed.
Arguments:*locator - an element locator
*value - the value to type
uncheck
uncheck(locator)
Uncheck a toggle-button (checkbox/radio)
Arguments:*locator - an element locator
skipFilmStrip
skipFilmStrip()
Indicates to the script that the film strip will be disabled for this step. Can be placed in any location within the list of commands for the step.
skipScreenCapture
skipScreenCapture()
Indicates to the script that the screen capture will be disabled for this step. Can be placed in any location within the list of commands for the step.
storeAttribute
storeAttribute(attributeLocator, variableName)
Gets the value of an element attribute. The value of the attribute may differ across browsers (this is the case for the "style" attribute, for example).
Generated from getAttribute(attributeLocator)
Arguments:*attributeLocator - an element locator followed by an @ sign and then the name of the attribute, e.g. foo@bar.
*variableName - the name of a variable in which the result is to be stored.
Returns: the value of the specified attribute
storeBodyText
storeBodyText(variableName)
Gets the entire text of the page.
Generated from getBodyText().
Returns: the entire text of the page
storeCookie
storeCookie(variableName)
Return all cookies of the current page under test.
Generated from getCookie().
Returns: all cookies of the current page under test
storeCookieByName
storeCookieByName(name,variableName)
Returns the value of the cookie with the specified name, or throws an error if the cookie is not present.
Generated from getCookieByName(name)
Arguments:*name - the name of the cookie.*variableName - the name of a variable in which the result is to be stored.Returns: the value of the cookie
storeCookiePresent
storeCookiePresent(name,variableName)
Generated fromisCookiePresent(name)
Arguments: *name - the name of the cookie.
Returns: true if a cookie with the specified name is present, or false otherwise.
storeElementPresent
storeElementPresent(locator,variableName)
Verifies that the specified element is somewhere on the page.
Generated from isElementPresent(locator)
Arguments:*locator - an element locator.*variableName - the name of a variable in which the result is to be stored.
Returns: true if the element is present, false otherwise
storeExpression
storeExpression(expression, variableName)
Returns the specified expression.
This is useful because of JavaScript preprocessing. It is used to generate commands like assertExpression and waitForExpression.
Generated from getExpression(expression)
Arguments:*expression - the value to return.
*variableName - the name of a variable in which the result is to be stored.
Returns: the value passed in
storeHtmlSource
storeHtmlSource(variableName)
Returns the entire HTML source between the opening and closing "html" tags.
Generated from getHtmlSource().
Returns: the entire HTML source
storeLocation
storeLocation(variableName)
Generated from getLocation().
Returns: the absolute URL of the current page
storeText
storeText(locator, variableName)
Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.
Generated from getText(locator)
Arguments:*locator - an element locator.
*variableName - the name of a variable in which the result is to be stored.
Returns: the text of the element
storeTextPresent
storeTextPresent(pattern,variableName)
This command is deprecated. Use the storeText command with anelement locator instead.
Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.
Generated from isTextPresent(pattern)
Arguments:*pattern - a pattern to match with the text of the page.*variableName - the name of a variable in which the result is to be stored.
Returns: true if the pattern matches the text, false otherwise
storeTitle
storeTitle(variableName)
Gets the title of the current page.
Generated from getTitle().
Returns: the title of the current page
storeValue
storeValue(locator, variableName)
Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not.
Generated from getValue(locator)
Arguments:*locator - an element locator.
*variableName - the name of a variable in which the result is to be stored.
Returns: the element value, or on/off for checkbox/radio elements
Comments
0 comments
Please sign in to leave a comment.