Selenium Commands – “Selenese”
Selenium commands, often called selenese, are the set of commands that run your tests. A sequence of these commands is a test script
A command is what tells Selenium what to do. Selenium commands come in three “flavors”: Actions, Accessors and Assertions.
Actions are commands that generally manipulate the state of the application. They do things like “click this link” and “select that option”. If an Action fails, or has an error, the execution of the current test is stopped.
Many Actions can be called with the “AndWait” suffix, e.g. “clickAndWait”. This suffix tells Selenium that the action will cause the browser to make a call to the server, and that Selenium should wait for a new page to load.
Accessors examine the state of the application and store the results in variables, e.g. “storeTitle”. They are also used to automatically generate Assertions.
Assertions are like Accessors, but they verify that the state of the application confirms to what is expected. Examples include “make sure the page title is X” and “verify that this checkbox is checked”.
All Selenium Assertions can be used in 3 modes:
For example, you can “assertText”, “verifyText” and “waitForText”. When an “assert” fails, the test is aborted. When a “verify” fails, the test will continue execution, logging the failure.
Editing a test case:
Select the point in your test case where you want to insert the command. To do
this, in the Test Case Pane, left-click on the line where you want to insert a new
Comments may be added to make your test case more readable. These comments are ignored when the test case is run
Select the line in your test case where you want to insert the comment. Right-click and select Insert Comment. Now use the Command field to enter the comment. Your comment will appear in purple font
Select the point in your test case where you want to insert the comment. Add an HTML-style comment, i.e., <!– your comment here –>.
Edit a Command or Comment
Simply select the line to be changed and edit it using the Command, Target, and Value fields
Opening and Saving a Test Case
Like most programs, there are Save and Open commands under the File menu. When you open an existing test case or suite, Selenium-IDE displays its Selenium commands in the Test Case Pane.