Wednesday 24 September 2014

Read background color of an element?

driver.get("http://www.google.co.in/");

String color = driver.findElement(By.name("btnK")).getCssValue("background-color");
   
System.out.println("The background color of Google search button"+color);

No comments:

Post a Comment