Friday 5 June 2015

Selenium IDE - Selenium Tool for Test Automation

In this article, we are going to see how we can work with Selenium IDE and how it can be used in identifying Web page elements. 

Since this is the most basic tool in Selenium, we will see how it can be utilized to accomplish our Automation Tasks.
Anyone with or without any Programming Knowledge can automate Web based applications using Selenium-IDE. It is a Firefox add-on and you can install it easily from here.


This is how Selenium IDE looks:



Selenium IDE provides different features such as Record and Playback, running single/multiple commands, running single/multiple Test Cases at a time, control the speed of execution of Test Cases, finding and highlighting Web page elements, etc.


Let us have a look on different components of Selenium IDE :

  • Menu Bar - It contains various options such as creating/saving Test Cases/Test Suites, exporting Test Cases, insert/delete a command, saving Test Cases in a particualar format, etc.
  • Base URL - This is where you mention the URL of your AUT (Application under Test)
  • Toolbar - It contains various components that helps in controlling the execution of Test Cases, running single Test Case or entire Test Suite, pause/resume execution, etc.
  • Test Case Pane - All the test cases are displayed in this section. It also displays the number of passed and failed Test Cases.
  • Editor - This is the section where all the commands, values and targets are entered automatically as we go through the page.



Some of the important Selenium IDE commands :
  • open - opens URL on current Web Browser instance
  • openWindow - opens URL on new Web Browser instance
  • click - clicks on an element
  • clickAndWait - clicks and wait for the page to load
  • store - used to store user defined values in a variable
  • echo - used to print data in Selenium IDE log section
  • storeText - used to store data from Web page in a variable
  • type - types a sequence of characters
  • verifyTitle - compares actual page title with expected page title
  • verifyText - compares the expected and actual values
  • verifyTextPresent - verifies presence of text on the page
  • verifyElementPresent - verifies presence of an element
  • assertText - compares the expected and actual values 
  • waitForPageToLoad - waits for the page to load
  • waitForElementPresent - waits for an element to be present
  • pause - pauses the execution of Test Script
  • refresh - refreshes the Web page
  • storeLocation - stores the URL of a Web page in a variable
  • storeTitle - stores title of a Web page in a variable

The difference between "verify" and "assert" is :
Verify - The Test Case Execution continues even if the command fails.
Assert - The Test Case Execution stops if the command fails.




Finding Web page Elements:

By default, Record button (small red circle on top right) is "ON", hence the actions on web page are recorded automatically.
Most of the testers or developers use Selenium IDE to locate Web page Elements. One can simply copy the identifier (using one of the identifying methods to be discussed) in "Target" field provided and click on "Find" button to identify Web page Element. If the required element is highlighted on the Web page, we can use the locator in "Target" field for that element in our Automation Script.
In this way, Selenium IDE can be very useful in identifying Web page Elements required in out Test Automation Scripts.


We will discuss about Selenium Webdriver and different types of locators (locating techniques) in the upcoming posts.
Happy Learning.


YouTube Channel : Click Here



References :

No comments:

Post a Comment