1

Searching from many forums i got the code to hover the mouse over an element .I want to hover the mouse over a thumbnail image. i put html element ".thumbnail" as class inside find_element method .I dont know which parameter should i place inside find_element method?

My html element is given below.

<a class="thumbnail">
<span class="badgeFeatured">featured</span>
<img alt="" src="https://do3dm75n3e02m.cloudfront.net/arts/preview_3ds/14/original/open-uri20121128-5897-wh90rf_1354148717.png20121128-5897-194vld7-0?1354148717">
<p>Flourish Happy Birthday</p>
</a>


 el = driver.find_element(:class => "thumbnail")
driver.move_to.(el).perform

Due to this problem it does not move mouse over the thumbnail image.

7
  • Look at the answers in this question - stackoverflow.com/questions/9784118/…. Your previous question was closed as a duplicate of this one Commented May 17, 2013 at 7:23
  • hey question is almost similar.but i think you didnt check what i asked.my question is " I don't know which parameter should I place inside find_element method?" can you answer for this? Commented May 17, 2013 at 7:39
  • Look at this. It should be find_element(:class, "thumbnail"), not find_element(:class => "thumbnail") Commented May 17, 2013 at 7:59
  • why it is showing undefined local variable driver? Commented May 17, 2013 at 8:09
  • because capybara provides native access to underlying selenium driver via page.driver.browser, not via driver Commented May 17, 2013 at 8:23

1 Answer 1

1

In Webdriver(java), we can perform mouse over action like this:

Actions actions = new Actions(driver);
WebElement imageSpan = driver.findElement(By.className("badgeFeatured"));
actions.moveToElement(imageSpan);
Sign up to request clarification or add additional context in comments.

1 Comment

hey iam using ruby not java

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.