如何单击元素的特定坐标 [英] How to click on a specific coordinates of an element
本文介绍了如何单击元素的特定坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用 watir-webdriver 单击元素的特定坐标.使用 selemium-webdriver 它将看起来像:
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
但是如何使用watir?
推荐答案
我认为您必须直接访问 selenium-webdriver 驱动程序(假设 browser
是您的 watir-webdriver 浏览器):>
I think you will have to access the selenium-webdriver driver directly (assuming browser
is your watir-webdriver browser):
browser.driver
要获取 watir-webdriver 元素的下划线 selenium-webdriver 元素,请使用 wd
(假设 element
是您要单击的 watir-webdriver 元素):
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
这篇关于如何单击元素的特定坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文