Wednesday, July 18, 2012

Selenium Module #3

Introduction to Selenium IDE

IDE typically Integrated Development Environment is an application that helps developers and testers to develop and automate softwares.

Talking about Selenium IDE, it provides an integrated development environment for the Selenium scripts.It is installed as a Firefox add on. Selenium IDE includes the entire Selenium Core which is based on Javascript. It provides a nice user interface. Besides its recording capability, users can run their scripts as well.

Characteristics of Selenium IDE:

  • It provides easy record and run
  • Intelligent field selection will use IDs, names, or XPath as needed
  • Autocomplete for all common Selenium commands
  • Walk through tests
  • Debug and set breakpoints
  • Tests can be saved in multiple formats: HTML, Ruby scripts, or any other format
  • Support for Selenium user-extensions.js file
  • Automatic assertions of page title

Limitation of Selenium IDE

It supports only Mozilla Firefox. For running scripts to other browsers, you need to export the recorded test case to Selenium RC.

Understanding user interface of Selenium IDE:

Below is the user interface of Selenium IDE

Selenium IDE has following features:

1. Action bar - To control the test. It has following components.
1.1 Base URL- To enter the url of the web application which you will automate.
1.2 Speed bar- from where u can control the speed of the recorded test case to run from fast to slow.
1.3 Run the test suite option- to run all the tests in test suite.
1.4 Run the selected test case - to run only specific test case.
1.5 Pause/Resume button- to pause or resume the test.
1.6 Next step
1.7 Apply roll ups - Set of selenium commands that are grouped into single command.
1.8 Start/ Stop red colored recording button. When IDE is opened by default button is in recording mode

2.  Test suite tool - It display the tests in the current test suite.
Also it has Runs and failures section for the results.

3. Test Editor- It displays the commands being recorded or run.
It has 3 sections:
Command, Target and value
Commands means the action which will be performed like click, open, verify etc.
Target means the exact location or path of the web elements which you will click. It helps to uniquely identify the elements on the page.
Value is what you what you want to enter or input to the field. 

4. Tool Panel - It has following components:
4.1  Log- It will show the log of the currents tests which are being executed.
It also displays errors in the tests.
4.2 Reference: Its like help of the selected command. You can get the information about the command from reference.
4.3 UI-Element: shows which UI element are actually in use.
4.4 Rollup: displays the rules of RollUp

Simple Example using Selenium IDE:

Step-1: Go to the website:
Step-2: Open Selenium IDE from Tools tab in Mozilla Firefox.
Step-3: Check that Record button is in recording mode.
Step-4: Now in the Google search box type Selenium IDE and click on Google search button.
Step-5: Now to check that whether you got correct search page, you have to verify the title of the search result page. For that right click on that result page. Select "Show All Available commands -> assertTitle selenium ide- Google Search.
Observe that that command will get displayed in selenium IDE.

It will look like this :-

Step-6: Click on Stop recording button to stop the recording.

 You can now run the recorded test case through run selected test case button.

See the type command, its value is selenium ide. This is the text which you typed in the google search box.

 And if see the target they are written like id =gbqfb, selenium ide, etc. These are nothing but the exact path of the elements on web page. To learn more on targets, refer xpath module.

No comments:

Post a Comment