Tuesday 8 April 2014

Record and playback using selenium IDE

Now that we are familiar with the basic features and functionalities of the selenium IDE we will begin to create test cases using the IDE. The simplest approach to creating test cases using the selenium IDE is using its record and playback capability. People who are relatively new to automation can use this approach to quickly learn the basics to creating a simple automation test script.

Step1: Launch Firefox browser and open selenium IDE.

image

Step2: Ensure that the selenium IDE is currently in recording mode, i.e., whether the record button is enabled. This is by default turned when user opens up selenium IDE.

Step3: Navigate to a URL of your choice (example: www.google.co.in). This would cause the IDE to set the test case base URL to be www.google.co.in

Step4: Click on the google search bar and enter the text ‘selenium’. This would cause the selenium IDE to start recording the browser actions performed by the user. The browser actions are created test steps under the Table tab of the test case pane.

image

Step5: Stop the recording by clicking on the record button of the selenium IDE.

Step6: imageSave the test case. You will observe that the test case would get saved in .html format.

Now we have created a simple test case by recording the browser actions using selenium IDE. Now to playback this script.

Step7: In the test case pane, the new test case will be given the new name used while creating the same. Click on this new test case and then use the ‘Play current test case’ button.

image

This would cause the earlier recorded browser actions to playback. Once a test case gets completely executed the status will be shown on the test case pane as either passed or failed.

This is the simplest approach to creating and executing test cases using selenium IDE.

No comments:

Post a Comment