Highlight element with Selenium Webdriver

Here is the code to highlight the element using Selenium Webdriver. You will have to replace the driver.findElement to findElement. I have also give the example of using findElement. public WebElement findElement(By by) { WebElement elem = driver.findElement(by); if (driver instanceof JavascriptExecutor) { ((JavascriptExecutor) driver).executeScript(“arguments[0].style.border=’1px solid yellow'”, elem); } return elem; } public void type(By […]

Overriding Selenium Commands

I think it might be interesting if you want to improve or change selenium actions. In order to improve Selenium scripting I’ve overridden some Selenium methods as Click and Type. I’ve added a WaitForElementToLoad() function to Click action, as I don’t want to add this action every time after calling Click and I’ve added Highlighting […]