Friday, 5 June 2015

Selenium IDE

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 Background 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 like :




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, etc.


Lets have a look on different components of Selenium IDE :


  • Menu Bar - It contains various options such as creating/saving Test Cases/Test Suites, export to a particular language, insert/delete a command, saving in a particualar format, etc.
  • Base URL - This is where your test URL goes (the page that you are going to test).
  • Toolbar - It contains various components that helps in controlling the execution of Test Cases, running single Test Case or entire Test Suite, pause option, etc.
  • Test Case Pane - All the test cases are displayed in this section. 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.




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 Elements. One can simply copy the identifier (using one of the identifying methods to be discussed) in "Target" field provided and click on "Find" to identify Web 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.


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