RE: How to code mouse hover with Selenium Webdriver
To use ID it has to be present in the element’s html. In the image shown, highlighted element, there is no id. The only valid attribute is class. I would suggest you find this element using Xpath. Also the correct syntax is
driver.findElement(By.id(“HM_Item2_4”)); you dont have to specify the id= in it. However in this case I would suggest use Xpath.
You can take a look at the tutorial here