Selenium IDE is a Firefox and Chrome extension that magnifies the scope of web application testing services by building tests without the need for any programming knowledge through its playback functionality.
We will first discuss how teams can create a test for search text on google search engine using selenium commands and then try to run it in Selenium IDE:
- Launch browser (Chrome or Firefox) and click on the Selenium icon available on the top right corner of the browser to launch the default interface of Selenium IDE
- Name your Project as "My_First_Selenium_Project" and test as "My_First_Selenium_Test"
Insert Commands
- Click in the command textbox available on the Test Script Editor
- Provide "Command: Open" and "Target: https://www.google.co.in/" to open google search engine in browser URL
- For discovering unique locator of Google search text box, right click in the box and click "Inspect Element"
- It will show a window with all the HTML code of the google search engine page, pick the div tag with attribute jsname that contains the unique value of the textbox
- Provide "Command : click at" and "Target : //div[@jsname="RNNXgb"]//input[@name="q"]" in the properties of second command to click in the textbox of Google search engine Page
- Provide "Command : type", "Target : //div[@jsname="RNNXgb"]//input[@name="q"]w" and "Value = Selenium Tutorial" in the properties of the third command to type the specified text in Google search textbox
- For discovering unique locator for the Search button, Right-click on the 'Google search' button and click "Inspect Element". Pick the input tag element that contains the unique value of the button
- Provide "Command : click at" and "Target : //div[@jsname="VlcLAe"]//input[@name="btnK"]" in the properties of the fourth command to click on the Search button present on Google search engine page
Executing the Test Script
- To run the test, click on the "Run Current Test" button displayed on the toolbar menu of the IDE. It will execute all the commands in the provided sequence and give an overall result of the test script
- The Log pane below will display the result of all the executed tests
We can further add as many tests as we want and run them based on the feature that we would like to automate in the same test script
Post a Comment