Google+

'highlight' command in Selenium IDE for highlighting elements

highlight command is one of the Selenese commands in Selenium IDE and is mainly used to highlight the specified GUI elements in yellow background color.

Note: Debugging is the purpose behind highlighting the GUI elements during execution.

Prerequisites:

In order to implement highlight 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 'highlight' selenese command in Selenium IDE for highlighting the specified GUI elements during Execution:

Lets follow the below steps for implementing the highlight selenese command for highlighting the GUI elements during execution:

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 'highlight' into the 'Command' field as shown below:



11. Now lets aim for highlighting a text box field on the Application page. In order to highlight the text box field, we need to create the locator strategy for locating the text box field. Luckily Selenium IDE can automatically generate the locator strategy using the 'Select' button. So to generate the locator strategy for text box field, lets click on 'Select' button on the Selenium IDE as shown below:



12. After performing as specified in the above screen-shot, observe that the locator strategy for the text box field will be auto generated and displayed in the 'Target' field as shown below:



13. The purpose of second step in the Selenium IDE is to highlight the text box field on the Application page. After providing the highlight command and the locator strategy for locating the text box field, 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 the text box field on the application page get highlighted in yellow for a second as part of second step.



Conclusion

highlight command in Selenium IDE is one of the selenese commands. The purpose of this command is to highlight the GUI elements on the Application during execution. 

No comments: