Saturday, March 3, 2018

How to highlight an Element in Selenium WebDriver

Today, we will discuss How to highlight element using selenium webdriver. Here we are using JavascriptExecutor interface to achieve highlight effect using CSS design. In UFT automation application there is an inbuilt highlight method , but in selenium there is no such type of highlight effect by default, so we have designed few lines of code to provide highlight effect.

Why do we highlight an element in selenium ?

The main purpose of highlighting an element in selenium is to keep track of execution flow of each step one by one. Based on that we can get the execution break down easily and in case of any exception we will easily keep track of it.

This is all about highlighting an element in selenium. Hope you like this simple example. Thank you for reading this article, and if you have any problem, have a another better useful solution about this article, please write message in the comment section.