☰ See All Chapters |
Selenium IDE Selenese Commands
To create test scripts manually we use commands called as selenese commands. Below is the list of available selenese commands:
add selection
answer on next prompt
assert
assert alert
assert checked
assert confirmation
assert editable
assert element present
assert element not present
assert not checked
assert not editable
assert not selected value
assert not text
assert prompt
assert selected value
assert selected label
assert text
assert title
assert value
check
choose cancel on next confirmation
choose cancel on next prompt
choose ok on next confirmation
click
click at
close
debugger
do
double click
double click at
drag and drop to object
echo
edit content
else
else if
end
execute script
execute async script
for each
if
mouse down
mouse down at
mouse move at
mouse out
mouse over
mouse up
mouse up at
open
pause
remove selection
repeat if
run
run script
select
select frame
select window
send keys
set speed
set window size
store
store attribute
store json
store text
store title
store value
store window handle
store xpath count
submit
times
type
uncheck
verify
verify checked
verify editable
verify element present
verify element not present
verify not checked
verify not editable
verify not selected value
verify not text
verify selected label
verify selected value
verify text
verify title
verify value
wait for element editable
wait for element not editable
wait for element not present
wait for element not visible
wait for element present
wait for element visible
webdriver answer on visible prompt
webdriver choose cancel on visible confirmation
webdriver choose cancel on visible prompt
webdriver choose ok on visible confirmation
while
These Selenium commands can be classified into three flavours: Actions, Accessory and Assertions.
Actions: user actions on application / Command the browser to do something. Actions are commands that generally manipulate the state of the application.
e.g. 1. Click link- click / Clickandwait
2. Selecting items
Accessors: Accessors examine the state of the application and store the results in variables, e.g. "storeTitle".
Assertions: For validating the application we are using Assertions
For verifying the web pages
For verifying the text
For verifying alerts
Assertions can be used in 3 modes:
assert
verify
waitFor
Example: "assertText","verifyText" and "waitForText".
NOTE:
1. When an "assert" fails, the test is aborted.
2. When a "verify" fails, the test will continue execution
3. "waitFor" commands wait for some condition to become true
Commonly Used Selenium Commands
These are probably the most commonly used commands for building test.
open - opens a page using a URL.
click/clickAndWait - performs a click operation, and optionally waits for a new page to load.
verifyTitle/assertTitle - verifies an expected page title.
verifyTextPresent- verifies expected text is somewhere on the page.
verifyElementPresent -verifies an expected UI element, as defined by its HTML tag, is present on the page.
verifyText - verifies expected text and it’s corresponding HTML tag are present on the page.
verifyTable - verifies a table’s expected contents.
waitForPageToLoad -pauses execution until an expected new page loads. Called automatically when clickAndWait is used.
waitForElementPresent -pauses execution until an expected UI element, as defined by its HTML tag, is present on the page.
All Chapters