Types of Selenium IDE Commands

Selenium IDE commands, is also known as Selenese. These are a set of commands that are used in Selenium IDE which is used while testing web based applications. There are three different types of Selenium IDE Commands and they are as follows.

Actions

These are the commands used to manipulate the state of the applications. They perform things such as “Type this box”, “Click this link”, “Select option” etc. When a command fails or an error occurs, the test gets terminated immediately. At the same time, many Action commands can be used with a suffix “AndWait” such as Click and wait, type and wait etc. In this case, Selenium will wait till a new page gets loaded.

Accessors

These types of commands are used to verify the state of applications and to store the results in variables. They can be used to generate assertions automatically.

Assertions

They are also used to verify the state of applications, but they confirm whether the state conforms to the desired state. Selenium IDE Assertions can be divided into three categories.

  • Assert: – The test will be aborted when an assert fails.
  • Verify: – The test will continue execution, logging the failure when Verify fails.
  • Wait for: – The test will wait till the specified conditions are met. However, the test will be cancelled if the condition does not become true within the stipulated time limit.

Mostly used Selenium IDE commands

  • type:  To Set the value of an input field, as though you typed it in.
  • open: To opens a page using a URL.
  • click: to clicks on a link, button, checkbox or radio button.
  • clickAndWait: Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad.
  • select: Select an option from a drop-down using an option locator.
  • selectFrame: Selects a frame within the current window.
  • verifyTitle/assertTitle: Verifies an expected page title.
  • verifyTextPresent: Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.
  • verifyElementPresent: Verifies that the specified element is somewhere on the page.
  • waitForPageToLoad: Waits for a new page to load. You can use this command instead of the “AndWait” suffixes, “clickAndWait”, “selectAndWait”, “typeAndWait” etc.
  • highlight: Briefly changes the backgroundColor of the specified element yellow. Useful for debugging.
  • pause: Wait for the specified amount of time (in milliseconds)
  • store: The name of a variable in which the result is to be stored. This command is a synonym for store Expression.
  • echo: Prints the specified message into the third table cell in your Selenese tables. Useful for debugging.
  • refresh: Simulates the user clicking the “Refresh” button on their browser

 

Be First to Comment

Leave a Reply

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