Now the Test case Editor is updated as
Step 5:
Click on the “Login” button. TestCase editor will be updated as
Click on the “Login” button. TestCase editor will be updated as
After clicking on “Login” button, Firefox should take you to this page.
Note: The UI of current IRCTC is changed and added extra feature Captcha. I am excluding the captch and recording the script.
Step 6:
Toggle the record button off to stop recording. Your script should now look like the one shown below.
Step 7:
Now we are done with our test script, we shall save it in a test case. In the File menu, select “Save TestCase”. (or Ctrl+S).
Step 8:
Choose your desired location, and then name the test case as “Login”.
Click the “Save” button.
Step 9:
Notice that the file was saved by default as HTML
Step 10:
Now go back to Selenium IDE and click the Playback button to execute the whole script
The script execution will be as in the following figure
Note: Please, ignore the captcha error, I have showed you how to record and playback a test case using Selenium IDE.
Finally we are done with creating the scripts by record and playback. You should practice as many
scenarios like this on the web.
Usage of Find button in Selenium IDE
The Find button is used to see which UI element on the currently displayed webpage (in the browser) is used in the currently selected Selenium command.
From Table view, select any command that has a locator parameter. Click the Find button.
Now look on the webpage. There should be a bright green rectangle enclosing the element specified by the locator parameter.
For Example,
1. Let us use the Login test case that we created earlier.
2. To open the Login.html file, Go To File->Open->Login.html
3. Click on the fourth command with a Target entry ie: name=usernameId.
4. Now click on the Find button.
5. Notice that the Password text box becomes highlighted for a second with green outlines and some yellow shades.
This indicates that Selenium IDE was able to detect and access the expected element correctly.
If the Find button highlighted a different element or no element at all, then there must be something wrong with your script.










No comments:
Post a Comment