@@ -0,0 +1,1116 @@
+/* Code to highlight a web element in Selenium.Makes use of Javascript to highlight.%0A * This class implements the AbstractWebDriverEventListener.%0A * Create an Object of this class type and register it with a EventFiringWebDriver. %0A * Make sure you do all the web driver operations on the EventFiringWebDriver,so that the logging happens here.%0A * There are several other methods in the AbstractWebDriverEventListener.You can implement/use it if required%0A*/%0A%0Aimport org.openqa.selenium.By;%0Aimport org.openqa.selenium.JavascriptExecutor;%0Aimport org.openqa.selenium.WebDriver;%0Aimport org.openqa.selenium.WebElement;%0Aimport org.openqa.selenium.support.events.AbstractWebDriverEventListener;%0A%0Apublic class WebElementHighlighterAsEventListener extends AbstractWebDriverEventListener %7B%0A%0A%09public void beforeFindBy(By arg0, WebElement arg1, WebDriver arg2) %7B%0A%09%09%0A%09%09arg1 = arg2.findElement(arg0);%0A%09%09for (int i = 0; i %3C 1; i++) %7B%0A%0A%09%09%09JavascriptExecutor js = (JavascriptExecutor) arg2;%0A%09%09%09js.executeScript(%0A%09%09%09%09%09%22arguments%5B0%5D.setAttribute('style', arguments%5B1%5D);%22, arg1,%0A%09%09%09%09%09%22color: black; border: 3px solid black;%22);%0A%09%09%7D%0A%0A%09%7D%0A%0A%7D%0A

Create WebElementHighlighterAsEventListener.java