×

Selenium IDE Commands

Selenium –IDE Commands (SELENESE):

Selenese commands are the set of commands used in Selenium IDE. Selenese command has two parameters target and value.

Selenese command tests the existence of UI elements based on their HTML tags, test for broken links, input fields, submitting forms, and check for specific content, Selection list options, and table data among other things.

 Selenium commands support testing for Ajax functionality, window size, mouse position, and alerts, pop up windows, event handling, and many other web-application features. 

We have three types of Selenium IDE commands:

Actions Command:

Actions command directly interact with page element, e.g.-  

COMMAND WEB ELEMENT
Type/send keys Edit Box
Click Check box, Radio button
Click and Wait Link
Select Dropdown
Click and Wait Image

If an Action command fails, it has an error, and then the execution of the current test is stopped.

Some commonly used actions command is as follows:

Command/Syntax Description
open (url) Open a browser using a URL
type /send keys (locator, value) It is a sequence of character use while performing an action on the edit box.
click (locator) Click command is enabled when the user clicks on a link, button, checkbox, or radio button.
clickAt (locator,cordString) It is enabled when the user clicks on an element with the help of the locator and its co-ordinates.
doubleClick (locator) This command is enabled when the user double clicks on a web element.
focus (locator) It moves the focus to the specified element.
highlight (locator) It is used to change the background color of the specified element.
close() The user is clicking the close button in the title bar of a popup window or tab.
store (expression,variableName) Specifies the name of a variable in which the result is to be stored, and expression is the value which is to be stored.
waitForCondition (script,timeout) Executes the specified JavaScript repeatedly until it is true.

Accessors Command:

Accessor’s commands are used to examine the state of the application and store the value in a variable.

 The most commonly used Accessors commands are as follows:

    Command/Syntax       Description
storeTitle (variableName) storeTitle command helps us to get the title of the current page.
storeText (locator, variableName) storeTextcommand is used to get the text of an element.
storeValue (locator,variableName) It is used to get the value of an input field.
storeTable (tableCellAddress, variableName) storeTable command helps us to get the text from a cell of a table.
storeLocation (variableName) To get the absolute URL of the current page.
storeElementIndex (locator, variableName) This command gets the relative index of an element to its parent (starting from 0).
storeBodyText (variableName) To get the entire text of the page.
storeAllButtons (variableName) It will return the IDs of all buttons on the page.
storeAllFields (variableName) Return the IDs of all input fields on the page.
storeAllLinks (variableName)  It will return the IDs of all links on the page.

Assertions Command:

These commands are used to verify if a specific condition met.

Assertions divided into three modes -

  • Assert
  • Verify  
  • WaitFor

The most commonly used Assertions commands are: 

Command/Syntax Description
verifySelected(selectLocator, optionLocator) Verify that the selected option of a drop-down satisfies the optionSpecifier.
verifyAlert (pattern) It is used to verify the alert text with the help of accessorstoreAlert.
verifyAllButtons (pattern) It is used to verify the button with the help of accessorstoreAllButtons.
verifyAllLinks (pattern) Verify all links with the help of accessorstoreAllLinks.
verifyBodyText(pattern) It is used to verify the body text with the help of accessorstoreBodyText.
verifyAttribute(attributeLocator, pattern) Verify an attribute of an element with the help of accessorstoreAttribute.
waitForErrorOnNext (message) Enables Waits for error; with the help of accessorassertErrorOnNext.
waitForAlert (pattern)      It is used to enable waits for the alert:                 accessorstoreAlert.
verifyAllWindowIds (pattern) Verifies the window id; with the help of accessorstoreAllWindowIds.

Related Topics

Selenium WebDriver - Firefox or Gecko (Marionette) browser

Selenium web driver-Firefox or Gecko (Marionette) browser In this tutorial, we are going to learn how to run the Selenium WebDriver test script in the Firefox Browser using the Gecko Driver. Before going...

4 minutes read.

Selenium IDE Commands

Selenium –IDE Commands (SELENESE): Selenese commands are the set of commands used in Selenium IDE. Selenese command has two parameters target and value. Selenese command tests the existence of UI elements based on their HTML tags,...

3 minutes read.

WebDriver-Class Name Locator

WebDriver-Class Name Locator In this tutorial, we will learn about the Class name locator of selenium WebDriver. The Class Name locator is used to identify any element in UI based on the...

4 minutes read.

Selenium WebDriver-CSS Selector: Substring Matching

CSS Selector: Substring Matching Selenium WebDriver In this tutorial, we will learn how to identify the web element using the substring method. A Sub-string contains three methods for identifying the web element...

9 minutes read.

CSS Selector: Attribute in Selenium IDE

CSS Selector: Attribute Locating the attribute of a CSS selector, we would access the Password textbox, which is present in the login form of Facebook. The Password textbox has a type attribute...

1 minute read.

Selenium WebDriver- Microsoft Edge Browser

Selenium WebDriver- Microsoft Edge Browser: In this tutorial, we will learn how to launch the Microsoft Edge browser in the Selenium WebDriver. Before we start automating our test script with Microsoft Edge...

4 minutes read.

Id Locator in Selenium IDE

Id Locator Id locator is used to find the web element by the help of id of that element because ID is likely to be unique for each web element. Target Format: Id=id of the...

2 minutes read.

Selenium WebDriver installation

Installation Steps of Selenium WebDriver In this tutorial, we will see the process of selenium webdriver installation. Selenium WebDriver installation process is done in four Stages: Java Installation (version 8 or higher version) Eclipse...

4 minutes read.

Selenium Assertion

Selenium Assertion: In this section, we will learn about the Assertion in Selenium WebDriver. An Assertion is a feature available in TestNG, which is used to verify the expected result of...

7 minutes read.

CSS Selector: Class in selenium IDE

CSS Selector: Class Identify a web element with the help of Class as a CSS Selector is like using id attribute. The only difference between Class and id is in their...

2 minutes read.

Selenium WebDriver Commands

Selenium WebDriver Commands: As we learn previously in the Selenium-IDE tutorial, Selenium commands are the set of commands that are used to run a Selenium test script. But whereas, Selenium WebDriver had...

2 minutes read.

WebDriver-Id Locator

WebDriver-Id Locator: The Id Locator is used to identify any web element in UI with the help of the ID attribute. The First preference is always goes to ID locator while inspecting...

4 minutes read.

WebDriver Interface | Class Diagram

WebDriver interface/class diagram: The interface of WebDriver includes the following stages, which is as follows: Search Context Web driver Remote web driver Driver class Search Context  The first interface of the web driver class is search Context,...

2 minutes read.

WebDriver-Tag Name Locator

Selenium WebDriver-Tag Name Locator The tag name locator is used along with the findElements() method to identify multiple similar elements in the UI. It is used to locate the web element with...

3 minutes read.

Selenium WebDriver-Locators

Selenium WebDriver-Locators The WebDriver uses the same set of locating strategies like selenium -IDE for specifying the location of the web element. Each locating strategy has its command in Java to locate...

1 minute read.

WebDriver-Link Text locator

WebDriver-Link Text locator The Link text locator is used to identify only web link elements based on the value of the link. The Link text locators cannot be used for other than...

4 minutes read.

Verification Controls Methods in Selenium WebDriver

Verification Controls Methods  The verification controls methods are used to check whether the web element is displayed, enabled, and selected. Some of the most commonly used verification controls are as follow: Verification controls Description Return...

4 minutes read.

Selenium WebDriver - Browser Controls Commands

Selenium WebDriver - Browser Controls Commands WebDriver includes operations like opening a browser, fetch the title, and closing the browser, etc. Some of the most commonly used Browser controls commands for Selenium WebDriver...

6 minutes read.

Selenium-IDE Installation in Mozilla Firefox

A beginners guides to Selenium-IDE Installation Since Selenium IDE is designed only for Firefox and Chrome plug-in, we are assuming that you have already installed the Mozilla Firefox browser in your...

1 minute read.

CSS Selector: Inner text in Selenium IDE

CSS Selector: Inner text The inner text is used to identify and create a CSS Selector using a string pattern of the HTML tag which is displayed on the web page. Syntax...

1 minute read.