I need to test the change in background color to #F67621 on hovering. The background color code is to be compared with predefined expected value. I am using XPath as selector.
String xPathStr="//input[@id='add']";
String str = driver.findElement(By.xpath(xPathStr)).getCssValue("background-color");
For above code can somebody suggest me how to check for hovering of button
CSS for the above mentioned code is as follows:
# add:hover , #clear:hover{
background-color:#F67621;
}