Friday 24 July 2015

HIghlighting the element using java script.

for (int iCnt = 0; iCnt < 3; iCnt++) {
       //Execute javascript
       js.executeScript("arguments[0].style.border='2px groove red'", driver.findElement(By.xpath("//div[starts-with(text(), '11.0')]")));
       try {
              Thread.sleep(500);
       } catch (InterruptedException e) {
               e.printStackTrace();
       }
       js.executeScript("arguments[0].style.border=''", driver.findElement(By.xpath("//div[starts-with(text(), '11.0')]")));
        }
}