Mindmajix

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. “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:

  1. assert
  2. verify
  3. waitFor

 

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:

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., <!– your comment here –>.

Edit a Command or Comment

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.

0 Responses on Selenium Commands – “Selenese”"

Leave a Message

Your email address will not be published. Required fields are marked *

Copy Rights Reserved © Mindmajix.com All rights reserved. Disclaimer.
Course Adviser

Fill your details, course adviser will reach you.