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?
We can use the ClickAt command in Selenium IDE. The ClickAt command has two arguments − the element locator and the coordinates which mentions the x and y coordinates of the mouse with respect to the element identified by the locator.
We can click a button with Selenium webdriver in Python using the click method. First, we have to identify the button to be clicked with the help of any locators like id, name, class, xpath, tagname or css. Then we have to apply the click method on it. A button in html code is represented by button tagname.
elementFromPoint(x, y). click();
We can find and click elements by title in Selenium webdriver. An element can be identified with a title attribute with xpath or css selector. With the xpath, the expression should be //tagname[@title='value']. In css, the expression should be tagname[title='value'].
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With