Wednesday, October 29, 2014

Chapter 4- Selenium IDE Test Creation - 9922500360

Selenium IDE Test Creation

The following steps are involved in creating Selenium tests using IDE
  1. Recording and adding commands in a test
  2. Saving the recorded test
  3. Saving the test suite
  4. Executing the recorded test

RECORDING AND ADDING COMMANDS IN A TEST

For Demo purposes we will make use of www.ncalculators.com to understand selenium features.
Step 1 : Launch the Firefox browser and navigate to the website - http://www.ncalculators.com/
Step 2 : Open Selenium IDE from the Tools menu and press the record button that is on the top-right corner.
Selenium IDE 7
Step 3 : Navigate to "Math Calculator" >> "Percent Calculator >> enter "10" as number1 and 50 as number2 and click "calculate".
Selenium IDE 7
Step 4 : User can then Insert a checkpoint by right click on the webelement and select "Show all available commands" >> select "assert text css=b 5"
Selenium IDE 8
Step 5 : The recorded script is generated and the script is displayed as shown below.
Selenium IDE 9

SAVING THE RECORDED TEST

Step 1 : Save the Test Case by navigating to "File" >> "Save Test" and save the file in the location of your choice. The file is saved as .HTML as default.
The test can also be saved with an extension htm, shtml and xhtml.
Selenium IDE 9

SAVING THE TEST SUITE

A test suite is a collection of tests that can be executed as a single entity.
Step 1 : Create a test suite by navigating to "File" >> "New Test Suite" as shown below.
Selenium IDE 13
Step 2 : The tests can be recorded one by one by choosing the option "New Test Case" from "File" Menu.
Step 3 : The individual tests are saved with a name alone with saving a "Test Suite".
Selenium IDE 14

EXECUTING THE RECORDED TEST

The recorded scripts can then be executed either by clicking "Play entire suite" or "Play current test" button in the tool bar.
Step 1 : The Run status can be can be seen in status pane that displays number of tests passed and failed.
Step 2 : Once a step is executed, user can see the result in "Log" Pane.
Step 3 : After executing each step, the background of the test step turns "Green" if passed and "Red" if failed as shown below.
Selenium IDE 15

No comments: