SeleniumFixtureReference
IN PROGRESS
Feature: Fitnesse Selenium Fixture Reference
Goal: UI Testing
Sponsor: Trek Global
Description:
In fitnesse, you can use the fitlibrary.zk.ZkFixture to create UI testing.
Fixture Command Reference
- Fixture command start and ends with |
- italic text is command, non italic text is parameter
Page Setup
Start test with phantomjs, firefox, chrome or ie:
|start spider with|phantomjs, firefox, chrome or ie|
Auto shutdown browser after completion of test (must be true for phantomjs since it is headless):
|shut down browser automatically|true or false|
Zk Widget
Combobox
Return selected value from combobox:
|combobox|zk locator|selected value|
Set selected combobox item by label:
|combobox|zk locator|select item|label of item|
Set selected combobox item by index:
|combobox|zk locator|select item at|item index|
Enter text into combobox and fire the onChange event:
|combobox|zk locator|set text|text|
Tabbox
Set selected tab by index:
|tabbox|zk locator|select tab at|tab index|
Set selected tab by label:
|tabbox|zk locator|select tab|tab label|
Return label of selected tab:
|selected tab|zk locator|
Lookup
Perform lookup with value:
|lookup|zk locator|search|value|
Window
Open window by menu label:
|open window|menu label|
Click process button of a window:
|window|zk locator|click process button|button id|
Click toolbar button of a window:
|window|zk locator|click toolbar|value|
Click detail toolbar button of a window:
|window|zk locator|click detail toolbar'|value|
Return window message:
|window message|zk locator|
Navigate to next record:
|window|zk locator|next record|value|
Navigate to previous record:
|window|zk locator|previous record|value|
Waiting for Response
Wait for Ajax response:
|wait response|
Wait for Ajax response with timeout:
|wait response with timeout|timeout|
Sleep for x milliseconds:
|sleep|millisecond|
Widget Command
Set focus to a widget:
|focus|zk locator|
Execute widget command:
|with widget|zk locator|execute|command|
Execute widget command and return the result:
|with widget|zk locator|eval|command|
Context Click
Open context menu:
|context click|zk locator|
FitLibrary
Setting
Specify how long to wait for a page to load from a URL:
|poll url timeout|timeout in milliseconds|
If true, changes to web elements are checked after they have been made:
|set checking|true or false|
If checking that a change has been made to a web element, how long to wait for a change to be visible:
|checking timeout|timeout in milliseconds|
Javascript
Execute the JavaScript code in the browser and return the result:
|execute JavaScript|JavaScript code|
Execute the JavaScript code in the browser with the argument and return the result:
|execute JavaScript|JavaScript code|with</>|web element|
Find a element on the page using the locator specified and then execute the JavaScript code in the browser using the found element as the argument and return the result:
|execute JavaScript|JavaScript code|with element</>|xpath, id or other locator|
Text
Return the text of the given web element:
|text of|xpath, id or other locator|
Return the plain text of the given web element. Tags are removed:
|plain text of|xpath, id or other locator|
Checks that the lines in the given text element match each of the following rows in the table:
|text of|xpath, id or other locator|matches lines|
Change the text of the given web element:
|with|xpath, id or other locator|set text|text|
Add to the text of the given web element:
|with|xpath, id or other locator|add text|text|
Return the html that's enclosed by the given web element:
|inner html of|xpath, id or other locator|
Return only the text that is in the identified element, no text of any inner html will be returned:
|text of element only|xpath, id or other locator|
Returns the value of the given web element:
|element value|xpath, id or other locator|
Find Element
Returns true if the given web element exists on the page:
|element exists|xpath, id or other locator|
Returns true if the given web element does not exist on the page:
|element does not exist|xpath, id or other locator|
Returns true if the given web element is displayed (visible to the user):
|element is visible|xpath, id or other locator|
Returns true if the given web element is not displayed (invisible to the user):
|element invisible|xpath, id or other locator|
Returns the count of elements that match the given locator:
|count of|xpath, id or other locator|
Attributes
Returns the value of the given attribute in the given web element:
|attribute|attribute name|of|xpath, id or other locator|
Returns true if the given attribute exists in the given web element:
|attribute of|xpath, id or other locator|exists|
Returns the value of the given css property of the given web element:
|with|xpath, id or other locator|css property of|css property name|
Returns a list of information about the attributes of each of the children with the given tag contained by the given web element:
|attribute|attribute|of children of type|child tag|of|xpath, id or other locator|
Checkbox
Returns true if the given checkbox is currently selected:
|checkbox|xpath, id or other locator|
Either select (true) or unselect (false) the given checkbox:
|with|xpath, id or other locator|select|true or false|
Options
Returns the name of the currently-selected option in the given select:
|option of|xpath, id or other locator|
Returns a list of the names of the currently-selected options in the given multi-select.\nThis can be checked in the subsequent rows of the table:
|option list of|xpath, id or other locator|
Changes the option in the given select:
|with|xpath, id or other locator|select option|option|
Changes the option to the nth one, in the given select:
|with|xpath, id or other locator|select option at|index|
Changes the option to the one with the given text, in the given select:
|with|xpath, id or other locator|select text|text of option|
Adds the given option to the given multi-select:
|with|xpath, id or other locator|add selection|option|
Removes the given option from the given multi-select:
|with|xpath, id or other locator|remove selection|option|
Returns a list of the values of the currently-selected options in the given multi-select:
|option values|xpath, id or other locator|
Returns a list of the elements for the options in the select or multi-select.\nThis list can be checked in the subsequent rows of the table:
|options|xpath, id or other locator|
Table
Returns the elements of the given table as a TableFixture, which can be used to check the text of each of those elements:
|table values|xpath, id or other locator|
Retrieve the page at the url:
|get url|url|
Click on the given element, such as a link or button:
|click|xpath, id or other locator|
Click on the given element and select the popup window that results:
|click and select resulting window|xpath, id or other locator|
Click on the first link with the given name:
|click on named link|link name|
Click on the first link that contains the given name:
|click on partially named link|partial link name|
Submit the given form:
|submit|xpath, id or other locator|
Maximize current window:
|maximize window|
Cookie
Delete the cookie with the given name:
|delete cookie|name|
Screen Shot
Take a screen shot and insert the result in the report
|screen shot|