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.

                                                  

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. “click and wait”. 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 conforms 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

Selenium Interview Questions

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

For more Information click: Selenium Commands

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

MindMajix YouTube Channel

Table View

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.

Also Read: Running Test Cases in Selenium

 

 

Job Support Program

Online Work Support for your on-job roles.

jobservice

Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:

  • Pay Per Hour
  • Pay Per Week
  • Monthly
Learn MoreGet Job Support
Course Schedule
NameDates
Selenium Training Nov 19 to Dec 04View Details
Selenium Training Nov 23 to Dec 08View Details
Selenium Training Nov 26 to Dec 11View Details
Selenium Training Nov 30 to Dec 15View Details
Last updated: 03 Apr 2023
About Author

 

Madhuri is a Senior Content Creator at MindMajix. She has written about a range of different topics on various technologies, which include, Splunk, Tensorflow, Selenium, and CEH. She spends most of her time researching on technology, and startups. Connect with her via LinkedIn and Twitter .

read less
  1. Share:
Selenium Articles