Blog

Selenium Commands – “Selenese”

Selenium commands

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.

                                                  Checkout Selenium Interview Questions

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.

Related Article: How To Install IE Developer Tool - SELENIUM

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.

Interested in mastering Selenium Course? Enroll now for FREE demo on Selenium Training.

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.

1. assert
2. verify
3. waitFor

Editing a test case:

Insert Command:

Table View:

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
command

Insert Comment:

Comments may be added to make your test case more readable. These comments are ignored when the test case is run

Screenshot_41

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

Screenshot_42

Souse view:

Select the point in your test case where you want to insert the comment. Add an HTML-style comment, i.e., .
Edit a Command or Comment

Related Page: Introduction To Selenium

Table View

Check Out Selenium Tutorials

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.

 


RELATED COURSES

Get Updates on Tech posts, Interview & Certification questions and training schedules