How to click on a specific coordinates of an element
Asked Answered
D

1

9

I need click on a specific coordinates of a element with watir-webdriver. With selemium-webdriver it will be looks like:

@driver.action.move_to(element, 30, 0).click.perform

But how do it with watir?

Delivery answered 4/2, 2013 at 11:6 Comment(0)
T
13

I think you will have to access the selenium-webdriver driver directly (assuming browser is your watir-webdriver browser):

browser.driver

To get the underlining selenium-webdriver element for a watir-webdriver element, use wd (assuming element is your watir-webdriver element you want to click):

element.wd

Putting it all together, you would do:

browser.driver.action.move_to(element.wd, 30, 0).click.perform
Tell answered 4/2, 2013 at 14:31 Comment(4)
thanks, i tried it, but it's don't work for IE 9 in my case. For IE works well fire_events. Is it possible to call in some fire_event item coordinates? I work with the modified button on similarity link, and in my case element.send_keys(:down) does not workDelivery
For IE9 are you using watir-webdriver or watir-classic?Tell
watir-webdriver 0.6.1. I do it with remote on a virtual machineDelivery
Since it works in Firefox, your issue sounds like a bug in the InternetExplorerDriver, which you could log at code.google.com/p/selenium/wiki/InternetExplorerDriver.Tell

© 2022 - 2024 — McMap. All rights reserved.