Library version: | 0.9.2 |
---|---|
Library scope: | global |
Named arguments: | supported |
ExtendedSelenium2Library is a Selenium2 (WebDriver) web testing library with AngularJS support and custom improvement for Robot Framework.
ExtendedSelenium2Library strives to make the transition from Selenium2Library as seamless as possible. It uses Selenium2 (WebDriver) libraries and AngularJS synchronization internally to control a web browser and ensure all the keywords stay in sync with AngularJS process.
See Wait Until Angular Ready keyword for a list of all other keywords that is already calling Wait Until Angular Ready from within. See Selenium2 and WebDriver for more information.
ExtendedSelenium2Library runs tests in a real browser instance. It should work in most modern browsers and can be used with both Python and Jython interpreters.
Non-inherited Keywords:
AngularJS Locators Support:
AngularJS Strategy | Example | Description |
model | Click Element | model=model_name | Matches by AngularJS model name |
binding | Click Element | binding=binding_name | Matches by AngularJS binding name |
partial binding | Click Element | partial binding=binding_name | Matches by partial AngularJS binding name |
button | Click Element | button=My Button | Matches button elements by their button text |
partial button | Click Element | partial button=y But | Matches button elements by their partial button text |
options | Get WebElements | options=options_descriptor | Matches by AngularJS options descriptor |
Prior to running test cases using ExtendedSelenium2Library, ExtendedSelenium2Library must be imported into your Robot test suite (see importing section), and the Open Browser keyword must be used to open a browser to the desired location.
--- Note important change starting with version 0.4.9 release ---
All keywords in ExtendedSelenium2Library that need to find an element on the page take an argument, either a locator or now a webelement. locator is a string that describes how to locate an element using a syntax specifying different location strategies. webelement is a variable that holds a WebElement instance, which is a representation of the element.
Using locators
By default, when a locator value is provided, it is matched against the key attributes of the particular element type. For example, id and name are key attributes to all elements, and locating elements is easy using just the id as a locator. For example:
Click Element my_element
It is also possible to specify the approach ExtendedSelenium2Library should take to find an element by specifying a lookup strategy with a locator prefix. Supported strategies are:
Strategy | Example | Description |
identifier | Click Element | identifier=my_element | Matches by @id or @name attribute |
id | Click Element | id=my_element | Matches by @id attribute |
name | Click Element | name=my_element | Matches by @name attribute |
xpath | Click Element | xpath=//div[@id='my_element'] | Matches with arbitrary XPath expression |
dom | Click Element | dom=document.images[56] | Matches with arbitrary DOM express |
link | Click Element | link=My Link | Matches anchor elements by their link text |
partial link | Click Element | partial link=y Lin | Matches anchor elements by their partial link text |
css | Click Element | css=div.my_class | Matches by CSS selector |
jquery | Click Element | jquery=div.my_class | Matches by jQuery/sizzle selector |
sizzle | Click Element | sizzle=div.my_class | Matches by jQuery/sizzle selector |
tag | Click Element | tag=div | Matches by HTML tag name |
default* | Click Link | default=page?a=b | Matches key attributes with value after first '=' |
* Explicitly specifying the default strategy is only necessary if locating elements by matching key attributes is desired and an attribute value contains a '='. The following would fail because it appears as if page?a is the specified lookup strategy:
Click Link page?a=b
This can be fixed by changing the locator to:
Click Link default=page?a=b
Using webelements
Starting with version 0.4.9 of the ExtendedSelenium2Library, one can pass an argument that contains a WebElement instead of a string locator. To get a WebElement, use the new Get WebElements keyword. For example:
${elem} = | Get WebElement | id=my_element |
Click Element | ${elem} |
Locating Tables, Table Rows, Columns, etc.
Table related keywords, such as Table Should Contain, work differently. By default, when a table locator value is provided, it will search for a table with the specified id attribute. For example:
Table Should Contain my_table text
More complex table lookup strategies are also supported:
Strategy | Example | Description |
css | Table Should Contain | css=table.my_class | text | Matches by @id or @name attribute |
xpath | Table Should Contain | xpath=//table/[@name="my_table"] | text | Matches by @id or @name attribute |
If more complex lookups are required than what is provided through the default locators, custom lookup strategies can be created. Using custom locators is a two part process. First, create a keyword that returns the WebElement that should be acted on.
Custom Locator Strategy | [Arguments] | ${browser} | ${criteria} | ${tag} | ${constraints} |
${retVal}= | Execute Javascript | return window.document.getElementById('${criteria}'); | |||
[Return] | ${retVal} |
This keyword is a reimplementation of the basic functionality of the id locator where ${browser} is a reference to the WebDriver instance and ${criteria} is the text of the locator (i.e. everything that comes after the = sign). To use this locator it must first be registered with Add Location Strategy.
Add Location Strategy custom Custom Locator Strategy
The first argument of Add Location Strategy specifies the name of the lookup strategy (which must be unique). After registration of the lookup strategy, the usage is the same as other locators. See Add Location Strategy for more details.
There are several Wait ... keywords that take timeout as an argument. All of these timeout arguments are optional. The timeout used by all of them can be set globally using the Set Selenium Timeout keyword. The same timeout also applies to Execute Async Javascript.
All timeouts can be given as numbers considered seconds (e.g. 0.5 or 42) or in Robot Framework's time syntax (e.g. '1.5 seconds' or '1 min 30 s'). For more information about the time syntax see: http://robotframework.googlecode.com/svn/trunk/doc/userguide/RobotFrameworkUserGuide.html#time-format.
Arguments | Documentation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
implicit_wait=15.0, **kwargs | ExtendedSelenium2Library can be imported with optional arguments. Arguments:
Examples:
|
Keyword | Arguments | Documentation | |||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Add Cookie | name, value, path=None, domain=None, secure=None, expiry=None | Adds a cookie to your current session. "name" and "value" are required, "path", "domain" and "secure" are optional | |||||||||||||||||||||||||||||||||||||||||||||||||
Add Location Strategy | strategy_name, strategy_keyword, persist=False | Adds a custom location strategy based on a user keyword. Location strategies are automatically removed after leaving the current scope by default. Setting persist to any non-empty string will cause the location strategy to stay registered throughout the life of the test. Trying to add a custom location strategy with the same name as one that already exists will cause the keyword to fail. Custom locator keyword example:
Usage example:
See Remove Location Strategy for details about removing a custom location strategy. | |||||||||||||||||||||||||||||||||||||||||||||||||
Alert Should Be Present | text= | Verifies an alert is present and dismisses it. If text is a non-empty string, then it is also verified that the message of the alert equals to text. Will fail if no alert is present. Note that following keywords will fail unless the alert is dismissed by this keyword or another like Get Alert Message. | |||||||||||||||||||||||||||||||||||||||||||||||||
Assign Id To Element | locator, id | Assigns a temporary identifier to element specified by locator. This is mainly useful if the locator is complicated/slow XPath expression. Identifier expires when the page is reloaded. Example:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Capture Page Screenshot | filename=selenium-screenshot-{index}.png | Takes a screenshot of the current page and embeds it into the log.
Starting from Selenium2Library 1.8 if The {index} is replaced with the actual index by using Python's str.format method, and it can be formatted using the standard format string syntax. The example 3 shows this by setting the width and the fill character. If there is a need to write literal {index} or if Example 1:
Example 2:
Example 3:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Checkbox Should Be Selected | locator | Verifies checkbox identified by locator is selected/checked. Key attributes for checkboxes are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Checkbox Should Not Be Selected | locator | Verifies checkbox identified by locator is not selected/checked. Key attributes for checkboxes are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Choose Cancel On Next Confirmation | Cancel will be selected the next time Confirm Action is used. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Choose File | locator, file_path | Inputs the file_path into file input field found by locator. This keyword is most often used to input files into upload forms. The file specified with file_path must be available on the same host where the Selenium Server is running. Example:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Choose Ok On Next Confirmation | Undo the effect of using keywords Choose Cancel On Next Confirmation. Note that Selenium's overridden window.confirm() function will normally automatically return true, as if the user had manually clicked OK, so you shouldn't need to use this command unless for some reason you need to change your mind prior to the next confirmation. After any confirmation, Selenium will resume using the default behavior for future confirmations, automatically returning true (OK) unless/until you explicitly use Choose Cancel On Next Confirmation for each confirmation. Note that every time a confirmation comes up, you must consume it by using a keywords such as Get Alert Message, or else the following selenium operations will fail. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Clear Element Text | locator | Clears the text value of text entry element identified by locator. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Click Button | locator, skip_ready=False | Clicks a button identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Click Element | locator, skip_ready=False | Clicks an element identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Click Element At Coordinates | locator, xoffset, yoffset, skip_ready=False | Clicks an element identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Click Image | locator, skip_ready=False | Clicks an image identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Click Link | locator, skip_ready=False | Clicks a link identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Close All Browsers | Closes all open browsers and resets the browser cache. After this keyword new indexes returned from Open Browser keyword are reset to 1. This keyword should be used in test or suite teardown to make sure all browsers are closed. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Close Browser | Closes the current browser. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Close Window | Closes currently opened pop-up window. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Confirm Action | Dismisses currently shown confirmation dialog and returns it's message. By default, this keyword chooses 'OK' option from the dialog. If 'Cancel' needs to be chosen, keyword Choose Cancel On Next Confirmation must be called before the action that causes the confirmation dialog to be shown. Examples:
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Create Webdriver | driver_name, alias=None, kwargs={}, **init_kwargs | Creates an instance of a WebDriver. Like Open Browser, but allows passing arguments to a WebDriver's __init__. Open Browser is preferred over Create Webdriver when feasible. Returns the index of this browser instance which can be used later to switch back to it. Index starts from 1 and is reset back to it when Close All Browsers keyword is used. See Switch Browser for example. driver_name must be the exact name of a WebDriver in selenium.webdriver to use. WebDriver names include: Firefox, Chrome, Ie, Opera, Safari, PhantomJS, and Remote. Use keyword arguments to specify the arguments you want to pass to the WebDriver's __init__. The values of the arguments are not processed in any way before being passed on. For Robot Framework < 2.8, which does not support keyword arguments, create a keyword dictionary and pass it in as argument kwargs. See the Selenium API Documentation for information about argument names and appropriate argument values. Examples:
Example for Robot Framework < 2.8:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Current Frame Contains | text, loglevel=INFO | Verifies that current frame contains text. See Page Should Contain for explanation about loglevel argument. | |||||||||||||||||||||||||||||||||||||||||||||||||
Current Frame Should Not Contain | text, loglevel=INFO | Verifies that current frame contains text. See Page Should Contain for explanation about loglevel argument. | |||||||||||||||||||||||||||||||||||||||||||||||||
Delete All Cookies | Deletes all cookies. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Delete Cookie | name | Deletes cookie matching name. If the cookie is not found, nothing happens. | |||||||||||||||||||||||||||||||||||||||||||||||||
Dismiss Alert | accept=True | Returns true if alert was confirmed, false if it was dismissed This keyword will fail if no alert is present. Note that following keywords will fail unless the alert is dismissed by this keyword or another like Get Alert Message. | |||||||||||||||||||||||||||||||||||||||||||||||||
Double Click Element | locator, skip_ready=False | Double clicks an element identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Drag And Drop | source, target | Drags element identified with source which is a locator. Element can be moved on top of another element with target argument. target is a locator of the element where the dragged object is dropped. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Drag And Drop By Offset | source, xoffset, yoffset | Drags element identified with source which is a locator. Element will be moved by xoffset and yoffset, each of which is a negative or positive number specify the offset. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Element Attribute Should Contain | attribute_locator, expected, message= | Verifies element attribute identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Element Attribute Should Not Contain | attribute_locator, unexpected, message= | Verifies element attribute identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Element Should Be Disabled | locator | Verifies that element identified with locator is disabled. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Element Should Be Enabled | locator | Verifies that element identified with locator is enabled. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Element Should Be Visible | locator, message= | Verifies that the element identified by locator is visible. Herein, visible means that the element is logically visible, not optically visible in the current browser viewport. For example, an element that carries display:none is not logically visible, so using this keyword on that element would fail. message can be used to override the default error message. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Element Should Contain | locator, expected, message= | Verifies element identified by locator contains text expected. If you wish to assert an exact (not a substring) match on the text of the element, use Element Text Should Be. message can be used to override the default error message. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Element Should Not Be Visible | locator, message= | Verifies that the element identified by locator is NOT visible. This is the opposite of Element Should Be Visible. message can be used to override the default error message. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Element Should Not Contain | locator, expected, message= | Verifies element identified by locator does not contain text expected. message can be used to override the default error message. Key attributes for arbitrary elements are id and name. See Element Should Contain for more details. | |||||||||||||||||||||||||||||||||||||||||||||||||
Element Text Should Be | locator, expected, message= | Verifies element identified by locator exactly contains text expected. In contrast to Element Should Contain, this keyword does not try a substring match but an exact match on the element identified by locator. message can be used to override the default error message. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Execute Async Javascript | *code | Executes asynchronous JavaScript code. Similar to Execute Javascript except that scripts executed with this keyword must explicitly signal they are finished by invoking the provided callback. This callback is always injected into the executed function as the last argument. Scripts must complete within the script timeout or this keyword will fail. See the Timeouts section for more information. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Execute Async Javascript With Replaced Variables | *code | Replace variables and executes asynchronous the given JavaScript Similar to Execute Javascript keyword except that the scripts executed with this keyword must explicitly signal when they are finished by invoking the provided callback. This callback is always injected into the executed function as the last argument. Scripts must complete within the script timeout or this keyword will fail. See the Timeouts section for more information. Arguments:
If The JavaScript executes in the context of the currently selected frame or window as the body of an anonymous function. Use window to refer to the window of your application and document to refer to the document object of the current frame or window, e.g. document.getElementById('foo'). Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Execute Javascript | *code | Executes the given JavaScript code. code may contain multiple lines of code and may be divided into multiple cells in the test data. In that case, the parts are catenated together without adding spaces. If code is an absolute path to an existing file, the JavaScript to execute will be read from that file. Forward slashes work as a path separator on all operating systems. The JavaScript executes in the context of the currently selected frame or window as the body of an anonymous function. Use window to refer to the window of your application and document to refer to the document object of the current frame or window, e.g. document.getElementById('foo'). This keyword returns None unless there is a return statement in the JavaScript. Return values are converted to the appropriate type in Python, including WebElements. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Execute Javascript With Replaced Variables | *code | Replace variables and executes the given JavaScript This keyword returns None unless there is a return statement in the JavaScript. Return values are converted to the appropriate type in Python, including WebElements. Arguments:
If The JavaScript executes in the context of the currently selected frame or window as the body of an anonymous function. Use window to refer to the window of your application and document to refer to the document object of the current frame or window, e.g. document.getElementById('foo'). Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Fast Wait Until Page Contains | text, excludes=None, timeout=None, error=None | Waits until Fails if any item in the Fails if Arguments:
See also Wait Until Page Contains Element, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Focus | locator | Sets focus to element identified by locator. | |||||||||||||||||||||||||||||||||||||||||||||||||
Frame Should Contain | locator, text, loglevel=INFO | Verifies frame identified by locator contains text. See Page Should Contain for explanation about loglevel argument. Key attributes for frames are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Alert Message | dismiss=True | Returns the text of current JavaScript alert. By default the current JavaScript alert will be dismissed. This keyword will fail if no alert is present. Note that following keywords will fail unless the alert is dismissed by this keyword or another like Get Alert Message. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get All Links | Returns a list containing ids of all links found in current page. If a link has no id, an empty string will be in the list instead. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Browser Logs | Returns the Javascript console logs from the browser. (Non Internet Explorer only). Please see Logging Preferences JSON object to set how verbose the logging should be. (Default 'SEVERE') Examples:
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Cookie Value | name | Returns value of cookie found with name. If no cookie is found with name, this keyword fails. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Cookies | Returns all cookies of the current page. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Element Attribute | attribute_locator | Return value of element attribute. attribute_locator consists of element locator followed by an @ sign and attribute name, for example "element_id@class". | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Element Size | locator | Returns width and height of element identified by locator. The element width and height is returned. Fails if a matching element is not found. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Horizontal Position | locator | Returns horizontal position of element identified by locator. The position is returned in pixels off the left side of the page, as an integer. Fails if a matching element is not found. See also Get Vertical Position. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get List Items | locator | Returns the values in the select list identified by locator. Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Location | Returns the current location. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Matching Xpath Count | xpath | Returns number of elements matching xpath One should not use the xpath= prefix for 'xpath'. XPath is assumed. Correct: count = | Get Matching Xpath Count | //div[@id='sales-pop'] Incorrect: count = | Get Matching Xpath Count | xpath=//div[@id='sales-pop'] If you wish to assert the number of matching elements, use Xpath Should Match X Times. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Screen Size | Returns current screen size as width and height. Examples:
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Selected List Label | locator | Returns the visible label of the selected element from the select list identified by locator. Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Selected List Labels | locator | Returns the visible labels of selected elements (as a list) from the select list identified by locator. Fails if there is no selection. Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Selected List Value | locator | Returns the value of the selected element from the select list identified by locator. Return value is read from value attribute of the selected element. Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Selected List Values | locator | Returns the values of selected elements (as a list) from the select list identified by locator. Fails if there is no selection. Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Selenium Implicit Wait | Gets the wait in seconds that is waited by Selenium. See Set Selenium Implicit Wait for an explanation. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Selenium Speed | Gets the delay in seconds that is waited after each Selenium command. See Set Selenium Speed for an explanation. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Selenium Timeout | Gets the timeout in seconds that is used by various keywords. See Set Selenium Timeout for an explanation. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Source | Returns the entire html source of the current page or frame. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Table Cell | table_locator, row, column, loglevel=INFO | Returns the content from a table cell. Row and column number start from 1. Header and footer rows are included in the count. A negative row or column number can be used to get rows counting from the end (end: -1). Cell content from header or footer rows can be obtained with this keyword. To understand how tables are identified, please take a look at the introduction. See Page Should Contain for explanation about loglevel argument. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Text | locator | Returns the text value of element identified by locator. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Title | Returns title of current page. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Value | locator | Returns the value attribute of element identified by locator. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Vertical Position | locator | Returns vertical position of element identified by locator. The position is returned in pixels off the top of the page, as an integer. Fails if a matching element is not found. See also Get Horizontal Position. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Webelement | locator | Returns the first WebElement matching the given locator. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Webelements | locator | Returns list of WebElement objects matching locator. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Get Window Identifiers | Returns and logs id attributes of all windows known to the browser. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Window Names | Returns and logs names of all windows known to the browser. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Window Position | Returns current window position as x then y. Example:
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Window Size | Returns current window size as width then height. Example:
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Get Window Titles | Returns and logs titles of all windows known to the browser. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Go Back | Simulates the user clicking the "back" button on their browser. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Go To | url | Navigates the active browser instance to the provided URL. | |||||||||||||||||||||||||||||||||||||||||||||||||
Input Password | locator, text | Types the given password into text field identified by locator. Difference between this keyword and Input Text is that this keyword does not log the given password. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Input Text | locator, text | Types the given text into text field identified by locator. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Input Text Into Prompt | text | Types the given text into alert box. | |||||||||||||||||||||||||||||||||||||||||||||||||
Is Element Visible | locator | Returns element visibility identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
List Selection Should Be | locator, *items | Verifies the selection of select list identified by locator is exactly *items. If you want to test that no option is selected, simply give no items. Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
List Should Have No Selections | locator | Verifies select list identified by locator has no selections. Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
List Windows | Return all current window handles as a list | ||||||||||||||||||||||||||||||||||||||||||||||||||
Location Should Be | url | Verifies that current URL is exactly url. | |||||||||||||||||||||||||||||||||||||||||||||||||
Location Should Contain | expected | Verifies that current URL contains expected. | |||||||||||||||||||||||||||||||||||||||||||||||||
Locator Should Match X Times | locator, expected_locator_count, message=, loglevel=INFO | Verifies that the page contains the given number of elements located by the given locator. See introduction for details about locating elements. See Page Should Contain Element for explanation about message and loglevel arguments. | |||||||||||||||||||||||||||||||||||||||||||||||||
Log Location | Logs and returns the current location. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Log Source | loglevel=INFO | Logs and returns the entire html source of the current page or frame. The loglevel argument defines the used log level. Valid log levels are WARN, INFO (default), DEBUG, and NONE (no logging). | |||||||||||||||||||||||||||||||||||||||||||||||||
Log Title | Logs and returns the title of current page. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Maximize Browser Window | Maximizes current browser window. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Mouse Down | locator | Simulates pressing the left mouse button on the element specified by locator. The element is pressed without releasing the mouse button. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. See also the more specific keywords Mouse Down On Image and Mouse Down On Link. | |||||||||||||||||||||||||||||||||||||||||||||||||
Mouse Down On Image | locator | Simulates a mouse down event on an image. Key attributes for images are id, src and alt. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Mouse Down On Link | locator | Simulates a mouse down event on a link. Key attributes for links are id, name, href and link text. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Mouse Out | locator | Simulates moving mouse away from the element specified by locator. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Mouse Over | locator | Simulates hovering mouse over the element specified by locator. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Mouse Up | locator | Simulates releasing the left mouse button on the element specified by locator. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Open Browser | url, browser=firefox, alias=None, remote_url=False, desired_capabilities=None, ff_profile_dir=None, skip_ready=False | Opens a new browser instance to given URL. Returns the index of this browser instance which can be used later to switch back to it. Index starts from 1 and is reset back to it when Close All Browsers keyword is used. See Switch Browser for example. Optional alias is an alias for the browser instance and it can be used for switching between browsers (just as index can be used). See Switch Browser for more details. Possible values for browser are as follows:
Note, that you will encounter strange behavior, if you open multiple Internet Explorer browser instances. That is also why Switch Browser only works with one IE browser at most. For more information see: http://selenium-grid.seleniumhq.org/faq.html#i_get_some_strange_errors_when_i_run_multiple_internet_explorer_instances_on_the_same_machine Optional 'remote_url' is the url for a remote selenium server for example http://127.0.0.1:4444/wd/hub. If you specify a value for remote you can also specify 'desired_capabilities' which is a string in the form key1:val1,key2:val2 that will be used to specify desired_capabilities to the remote server. This is useful for doing things like specify a proxy server for internet explorer or for specify browser and os if your using saucelabs.com. 'desired_capabilities' can also be a dictonary (created with 'Create Dictionary') to allow for more complex configurations. Optional 'ff_profile_dir' is the path to the firefox profile dir if you wish to overwrite the default. | |||||||||||||||||||||||||||||||||||||||||||||||||
Open Context Menu | locator | Opens context menu on element identified by locator. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Contain | text, loglevel=INFO | Verifies that current page contains text. If this keyword fails, it automatically logs the page source using the log level specified with the optional loglevel argument. Valid log levels are DEBUG, INFO (default), WARN, and NONE. If the log level is NONE or below the current active log level the source will not be logged. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Contain Button | locator, message=, loglevel=INFO | Verifies button identified by locator is found from current page. This keyword searches for buttons created with either input or button tag. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for buttons are id, name and value. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Contain Checkbox | locator, message=, loglevel=INFO | Verifies checkbox identified by locator is found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for checkboxes are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Contain Element | locator, message=, loglevel=INFO | Verifies element identified by locator is found on the current page. message can be used to override default error message. See Page Should Contain for explanation about loglevel argument. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Contain Image | locator, message=, loglevel=INFO | Verifies image identified by locator is found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for images are id, src and alt. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Contain Link | locator, message=, loglevel=INFO | Verifies link identified by locator is found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for links are id, name, href and link text. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Contain List | locator, message=, loglevel=INFO | Verifies select list identified by locator is found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Contain Radio Button | locator, message=, loglevel=INFO | Verifies radio button identified by locator is found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for radio buttons are id, name and value. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Contain Textfield | locator, message=, loglevel=INFO | Verifies text field identified by locator is found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for text fields are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Not Contain | text, loglevel=INFO | Verifies the current page does not contain text. See Page Should Contain for explanation about loglevel argument. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Not Contain Button | locator, message=, loglevel=INFO | Verifies button identified by locator is not found from current page. This keyword searches for buttons created with either input or button tag. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for buttons are id, name and value. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Not Contain Checkbox | locator, message=, loglevel=INFO | Verifies checkbox identified by locator is not found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for checkboxes are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Not Contain Element | locator, message=, loglevel=INFO | Verifies element identified by locator is not found on the current page. message can be used to override the default error message. See Page Should Contain for explanation about loglevel argument. Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Not Contain Image | locator, message=, loglevel=INFO | Verifies image identified by locator is found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for images are id, src and alt. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Not Contain Link | locator, message=, loglevel=INFO | Verifies image identified by locator is not found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for images are id, src and alt. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Not Contain List | locator, message=, loglevel=INFO | Verifies select list identified by locator is not found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Not Contain Radio Button | locator, message=, loglevel=INFO | Verifies radio button identified by locator is not found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for radio buttons are id, name and value. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Page Should Not Contain Textfield | locator, message=, loglevel=INFO | Verifies text field identified by locator is not found from current page. See Page Should Contain Element for explanation about message and loglevel arguments. Key attributes for text fields are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Press Key | locator, key | Simulates user pressing key on element identified by locator. key is either a single character, a string, or a numerical ASCII code of the key lead by '\\'. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Radio Button Should Be Set To | group_name, value | Verifies radio button group identified by group_name has its selection set to value. See Select Radio Button for information about how radio buttons are located. | |||||||||||||||||||||||||||||||||||||||||||||||||
Radio Button Should Not Be Selected | group_name | Verifies radio button group identified by group_name has no selection. See Select Radio Button for information about how radio buttons are located. | |||||||||||||||||||||||||||||||||||||||||||||||||
Register Keyword To Run On Failure | keyword | Sets the keyword to execute when a Selenium2Library keyword fails. keyword_name is the name of a keyword (from any available libraries) that will be executed if a Selenium2Library keyword fails. It is not possible to use a keyword that requires arguments. Using the value "Nothing" will disable this feature altogether. The initial keyword to use is set in importing, and the keyword that is used by default is Capture Page Screenshot. Taking a screenshot when something failed is a very useful feature, but notice that it can slow down the execution. This keyword returns the name of the previously registered failure keyword. It can be used to restore the original value later. Example:
This run-on-failure functionality only works when running tests on Python/Jython 2.4 or newer and it does not work on IronPython at all. | |||||||||||||||||||||||||||||||||||||||||||||||||
Register Page Ready Keyword | keyword_name | Adds a keyword to be run at the end of the wait until page ready keyword. Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Reload Page | Simulates user reloading page. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Remove Location Strategy | strategy_name | Removes a previously added custom location strategy. Will fail if a default strategy is specified. See Add Location Strategy for details about adding a custom location strategy. | |||||||||||||||||||||||||||||||||||||||||||||||||
Remove Page Ready Keyword | keyword_name | Removes a keyword to be run at the end of the wait until page ready keyword. Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Scroll Element Into View | locator | Scrolls an element from given Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Select All From List | locator | Selects all values from multi-select list identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Select Checkbox | locator | Selects checkbox identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Select Frame | locator | Sets frame identified by locator as current frame. Key attributes for frames are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Select From List | locator, *items | Selects If more than one value is given for a single-selection list, the last value will be selected. If the target list is a multi-selection list, and It's faster to use 'by index/value/label' keywords. An exception is raised for a single-selection list if the last value does not exist in the list and a warning for all other non- existing items. For a multi-selection list, an exception is raised for any and all non-existing values. Select list keywords work on both lists and combo boxes. Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Select From List By Index | locator, *indexes | Selects Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Select From List By Label | locator, *labels | Selects Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Select From List By Value | locator, *values | Selects Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Select Radio Button | group_name, value | Sets selection of radio button group identified by Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Select Window | locator=None | Selects the window matching locator and return previous window handle. locator: any of name, title, url, window handle, excluded handle's list, or special words. return: either current window handle before selecting, or None if no current window. If the window is found, all subsequent commands use that window, until this keyword is used again. If the window is not found, this keyword fails. By default, when a locator value is provided, it is matched against the title of the window and the javascript name of the window. If multiple windows with same identifier are found, the first one is selected. There are some special locators for searching target window: string 'main' (default): select the main window; string 'self': only return current window handle; string 'new': select the last-indexed window assuming it is the newest opened window window list: select the first window not in given list (See 'List Windows' to get the list) It is also possible to specify the approach Selenium2Library should take to find a window by specifying a locator strategy:
Example:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Set Browser Implicit Wait | seconds | Sets current browser's implicit wait in seconds. From selenium 2 function 'Sets a sticky timeout to implicitly wait for an element to be found, or a command to complete. This method only needs to be called one time per session.' Example:
See also Set Selenium Implicit Wait. | |||||||||||||||||||||||||||||||||||||||||||||||||
Set Screenshot Directory | path, persist=False | Sets the root output directory for captured screenshots.
| |||||||||||||||||||||||||||||||||||||||||||||||||
Set Selenium Implicit Wait | seconds | Sets Selenium 2's default implicit wait in seconds and sets the implicit wait for all open browsers. From selenium 2 function 'Sets a sticky timeout to implicitly wait for an element to be found, or a command to complete. This method only needs to be called one time per session.' Example:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Set Selenium Speed | seconds | Sets the delay in seconds that is waited after each Selenium command. This is useful mainly in slowing down the test execution to be able to view the execution. seconds may be given in Robot Framework time format. Returns the previous speed value. Example:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Set Selenium Timeout | seconds | Sets the timeout in seconds used by various keywords. There are several Wait ... keywords that take timeout as an argument. All of these timeout arguments are optional. The timeout used by all of them can be set globally using this keyword. See Timeouts for more information about timeouts. The previous timeout value is returned by this keyword and can be used to set the old value back later. The default timeout is 5 seconds, but it can be altered in importing. Example:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Set Window Position | x, y | Sets the position x and y of the current window to the specified values. Example:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Set Window Size | width, height | Sets the width and height of the current window to the specified values. Example:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Simulate | locator, event | Simulates event on element identified by locator. This keyword is useful if element has OnEvent handler that needs to be explicitly invoked. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Submit Form | locator=None, skip_ready=False | Submits a form identified by locator. Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Switch Browser | index_or_alias | Switches between active browsers using index or alias. Index is returned from Open Browser and alias can be given to it. Example:
Above example expects that there was no other open browsers when opening the first one because it used index '1' when switching to it later. If you aren't sure about that you can store the index into a variable as below.
| |||||||||||||||||||||||||||||||||||||||||||||||||
Table Cell Should Contain | table_locator, row, column, expected, loglevel=INFO | Verifies that a certain cell in a table contains expected. Row and column number start from 1. This keyword passes if the specified cell contains the given content. If you want to test that the cell content matches exactly, or that it e.g. starts with some text, use Get Table Cell keyword in combination with built-in keywords such as Should Be Equal or Should Start With. To understand how tables are identified, please take a look at the introduction. See Page Should Contain for explanation about loglevel argument. | |||||||||||||||||||||||||||||||||||||||||||||||||
Table Column Should Contain | table_locator, col, expected, loglevel=INFO | Verifies that a specific column contains expected. The first leftmost column is column number 1. A negative column number can be used to get column counting from the end of the row (end: -1). If the table contains cells that span multiple columns, those merged cells count as a single column. For example both tests below work, if in one row columns A and B are merged with colspan="2", and the logical third column contains "C". Example:
To understand how tables are identified, please take a look at the introduction. See Page Should Contain Element for explanation about loglevel argument. | |||||||||||||||||||||||||||||||||||||||||||||||||
Table Footer Should Contain | table_locator, expected, loglevel=INFO | Verifies that the table footer contains expected. With table footer can be described as any <td>-element that is child of a <tfoot>-element. To understand how tables are identified, please take a look at the introduction. See Page Should Contain Element for explanation about loglevel argument. | |||||||||||||||||||||||||||||||||||||||||||||||||
Table Header Should Contain | table_locator, expected, loglevel=INFO | Verifies that the table header, i.e. any <th>...</th> element, contains expected. To understand how tables are identified, please take a look at the introduction. See Page Should Contain Element for explanation about loglevel argument. | |||||||||||||||||||||||||||||||||||||||||||||||||
Table Row Should Contain | table_locator, row, expected, loglevel=INFO | Verifies that a specific table row contains expected. The uppermost row is row number 1. A negative column number can be used to get column counting from the end of the row (end: -1). For tables that are structured with thead, tbody and tfoot, only the tbody section is searched. Please use Table Header Should Contain or Table Footer Should Contain for tests against the header or footer content. If the table contains cells that span multiple rows, a match only occurs for the uppermost row of those merged cells. To understand how tables are identified, please take a look at the introduction. See Page Should Contain Element for explanation about loglevel argument. | |||||||||||||||||||||||||||||||||||||||||||||||||
Table Should Contain | table_locator, expected, loglevel=INFO | Verifies that expected can be found somewhere in the table. To understand how tables are identified, please take a look at the introduction. See Page Should Contain Element for explanation about loglevel argument. | |||||||||||||||||||||||||||||||||||||||||||||||||
Textarea Should Contain | locator, expected, message= | Verifies text area identified by locator contains text expected. message can be used to override default error message. Key attributes for text areas are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Textarea Value Should Be | locator, expected, message= | Verifies the value in text area identified by locator is exactly expected. message can be used to override default error message. Key attributes for text areas are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Textfield Should Contain | locator, expected, message= | Verifies text field identified by locator contains text expected. message can be used to override default error message. Key attributes for text fields are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Textfield Value Should Be | locator, expected, message= | Verifies the value in text field identified by locator is exactly expected. message can be used to override default error message. Key attributes for text fields are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Title Should Be | title | Verifies that current page title equals title. | |||||||||||||||||||||||||||||||||||||||||||||||||
Unselect Checkbox | locator | Removes selection of checkbox identified by locator. Does nothing if the checkbox is not checked. Key attributes for checkboxes are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Unselect Frame | Sets the top frame as the current frame. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Unselect From List | locator, *items | Unselects given values from select list identified by locator. As a special case, giving empty list as *items will remove all selections. *items try to unselect by value AND by label. It's faster to use 'by index/value/label' functions. Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Unselect From List By Index | locator, *indexes | Unselects *indexes from list identified by locator Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Unselect From List By Label | locator, *labels | Unselects *labels from list identified by locator Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Unselect From List By Value | locator, *values | Unselects *values from list identified by locator Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements. | |||||||||||||||||||||||||||||||||||||||||||||||||
Wait For Async Condition | condition, timeout=None, error=None | Waits until the given asynchronous Arguments:
See also Wait For Condition, Wait Until Page Contains, Wait Until Page Contains Element, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Wait For Condition | condition, timeout=None, error=None | Waits until the given condition is true or timeout expires. The condition can be arbitrary JavaScript expression but must contain a return statement (with the value to be returned) at the end. See Execute JavaScript for information about accessing the actual contents of the window through JavaScript. error can be used to override the default error message. See introduction for more information about timeout and its default value. See also Wait Until Page Contains, Wait Until Page Contains Element, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. | |||||||||||||||||||||||||||||||||||||||||||||||||
Wait For Condition With Replaced Variables | condition, timeout=None, error=None | Replace variables and waits until the given Arguments:
See also Wait For Condition, Wait Until Page Contains, Wait Until Page Contains Element, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Angular Ready | timeout=None, error=None | Waits until AngularJS is ready to process the next request or You generally do not need to call this keyword directly, below is the list of keywords which already call this keyword internally: Arguments:
See also Wait For Condition, Wait Until Page Contains, Wait Until Page Contains Element, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Element Contains | locator, text, timeout=None, error=None | Waits until given element contains text. Fails if timeout expires before the text appears on given element. See introduction for more information about timeout and its default value. error can be used to override the default error message. See also Wait Until Page Contains, Wait Until Page Contains Element, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. | |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Element Contains Attribute | attribute_locator, expected, timeout=None, error=None | Waits until element attribute identified by Arguments:
See also Wait Until Element Does Not Contain Attribute, Wait Until Page Contains, Wait Until Page Contains Element, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Element Does Not Contain | locator, text, timeout=None, error=None | Waits until given element does not contain text. Fails if timeout expires before the text disappears from given element. See introduction for more information about timeout and its default value. error can be used to override the default error message. See also Wait Until Page Contains, Wait Until Page Contains Element, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. | |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Element Does Not Contain Attribute | attribute_locator, unexpected, timeout=None, error=None | Waits until element attribute identified by Arguments:
See also Wait Until Element Contains Attribute, Wait Until Page Contains, Wait Until Page Contains Element, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Element Is Enabled | locator, timeout=None, error=None | Waits until element specified with locator is enabled. Fails if timeout expires before the element is enabled. See introduction for more information about timeout and its default value. error can be used to override the default error message. See also Wait Until Page Contains, Wait Until Page Contains Element, Wait For Condition and BuiltIn keyword Wait Until Keyword Succeeds. | |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Element Is Not Visible | locator, timeout=None, error=None | Waits until element specified with locator is not visible. Fails if timeout expires before the element is not visible. See introduction for more information about timeout and its default value. error can be used to override the default error message. See also Wait Until Page Contains, Wait Until Page Contains Element, Wait For Condition and BuiltIn keyword Wait Until Keyword Succeeds. | |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Element Is Visible | locator, timeout=None, error=None | Waits until element specified with locator is visible. Fails if timeout expires before the element is visible. See introduction for more information about timeout and its default value. error can be used to override the default error message. See also Wait Until Page Contains, Wait Until Page Contains Element, Wait For Condition and BuiltIn keyword Wait Until Keyword Succeeds. | |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Location Contains | expected, timeout=None, error=None | Waits until current URL contains Arguments:
See also Wait Until Location Does Not Contain, Wait Until Page Contains, Wait Until Page Contains Element, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Location Does Not Contain | unexpected, timeout=None, error=None | Waits until current URL does not contain Arguments:
See also Wait Until Location Contains, Wait Until Page Contains, Wait Until Page Contains Element, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Page Contains | text, timeout=None, error=None | Waits until text appears on current page. Fails if timeout expires before the text appears. See introduction for more information about timeout and its default value. error can be used to override the default error message. See also Wait Until Page Contains Element, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. | |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Page Contains Element | locator, timeout=None, error=None | Waits until element specified with locator appears on current page. Fails if timeout expires before the element appears. See introduction for more information about timeout and its default value. error can be used to override the default error message. See also Wait Until Page Contains, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. | |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Page Does Not Contain | text, timeout=None, error=None | Waits until text disappears from current page. Fails if timeout expires before the text disappears. See introduction for more information about timeout and its default value. error can be used to override the default error message. See also Wait Until Page Contains, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. | |||||||||||||||||||||||||||||||||||||||||||||||||
Wait Until Page Does Not Contain Element | locator, timeout=None, error=None | Waits until element specified with locator disappears from current page. Fails if timeout expires before the element disappears. See introduction for more information about timeout and its default value. error can be used to override the default error message. See also Wait Until Page Contains, Wait For Condition, Wait Until Element Is Visible and BuiltIn keyword Wait Until Keyword Succeeds. | |||||||||||||||||||||||||||||||||||||||||||||||||
Warn Any Javascript Errors | excludes=None, label= | Log any JavaScript errors in the page as warning in the test report. Arguments:
Examples:
| |||||||||||||||||||||||||||||||||||||||||||||||||
Xpath Should Match X Times | xpath, expected_xpath_count, message=, loglevel=INFO | Verifies that the page contains the given number of elements located by the given xpath. One should not use the xpath= prefix for 'xpath'. XPath is assumed. Correct: Xpath Should Match X Times | //div[@id='sales-pop'] | 1 Incorrect: Xpath Should Match X Times | xpath=//div[@id='sales-pop'] | 1 See Page Should Contain Element for explanation about message and loglevel arguments. |