Google+

Using 'click' command in Selenium IDE for clicking an hyperlink

click command is one of the Selenese commands in Selenium IDE and is used to click an hyperlink, button, radio option and checkbox option.

Prerequisites:

In order to implement click command in Selenium IDE, we have to first install 'Selenium IDE' firefox add-on in firefox browser. If you don't have Selenium IDE add-on installed in your firefox browser, follow the below posts first:


And also refer to the below post for opening the Application URL in the Firefox Browser using Selenium IDE:


Implementing 'click' selenese command in Selenium IDE for clicking an hyperlink:

Lets follow the below steps for implementing the click selenese command for clicking an hyperlink:

1. Open Firefox browser and select 'Tools' Menu > 'Selenium IDE' option as shown below:



2. A 'Selenium IDE' window will be displayed as shown below:



3. Select the first row in the 'Table' pane as shown below:



4. While the first row is selected, type the letter 'o' into the 'Command' box field and observe that the 'open' command will be provided by the Selenium IDE as an auto suggestion as shown below:



5. Select 'open' from the auto suggestion and observe that 'open' text got entered into the 'Command' field as shown below:



6. Now enter any application URL say 'http://www.omayo.blogspot.com' into the 'Target' box field as shown below:



7. Click on 'Play current test case' option as shown below:



8. Observe that the application URL provided in the Selenium IDE, will be automatically opened in Firefox browser as shown below:



9. Now, select the second row in the 'Table' pane as shown below:



10. Enter the command text 'click' into the 'Command' field as shown below:



11. Enter the locator strategy for locating the 'Selenium143' link on the Application page into the 'Target' field as shown below:

Note: id=link1 is the locator strategy for the 'Selenium143' hyperlink on the Application Page.



12.  Click on 'Find' button to check whether the provided locator is properly locating the 'Selenium143' hyperlink on the Application Page. If the locator strategy is able to locate the 'Selenium143' hyperlink, the hyperlink on the Application will get highlighted when the 'Find' button is clicked as shown below:



13. The purpose of second step in the Selenium IDE is to click on the Selenium143 hyperlink on the Application page. After providing the click command and locator strategy for locating the hyperlink, the Selenium IDE window will look as below:



14. Click on 'Play current test case' option as shown below:



15. Observe that the application URL provided in the Selenium IDE will be opened as part of first step and 'Selenium143' link on the application page will be clicked as part of second step. Also observe that the executed test case in Selenium IDE will be displayed as passed as shown below:




Conclusion

click command in Selenium IDE is one of the selenese commands. The purpose of this command is to click a hyperlink, button, radio option and check box option. 

No comments: