RE: How to code mouse hover with Selenium Webdriver

I was trying to code for mousehover
and i actually followed someone’s code and to me
its not working

RE: How to code mouse hover with Selenium Webdriver

also the I can’t really find the element id for

RE: How to code mouse hover with Selenium Webdriver


for this part
there is no id specified

Add Comment
3 Answers

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
http://www.toolsqa.com/selenium-webdriver/finding-elements-using-browser-inspector/

Virender

Professor Answered on July 14, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.