我可以对 watir-webdriver 中的元素执行手动硬件点击吗?

发布于 2024-12-13 04:07:05 字数 417 浏览 3 评论 0原文

在 Watir 中,我可以使用 Win32API 来完成此操作,而且元素是 OLE 可访问的。在 watir-webdriver 中,情况不再如此。我不想执行 .click 或 .fire_event('click'),而是实际获取系统鼠标指针并在元素上使用它。最好是单击并拖动。

我的问题是在屏幕上定位元素,因为 watir-webdriver 位置和 Win32API 位置似乎不兼容 - 有没有办法找到元素并硬件单击它?如果是这样,相同的代码可以在两台不同的机器上运行吗?

谢谢:)

PS。我知道浮动的点击和拖动代码是纯 w-webdriver 代码,但它似乎不太像 ZK 界面。

另外,这篇文章已为我编辑以包含 Watir 标签,但应该强调的是,Watir 和 Watir-Webdriver 的功能之间的差异是这个问题的原因,而我正在使用后者。

In Watir I could do this using Win32API and the fact that the elements were OLE-accessible. In watir-webdriver this is no longer the case. I'm not looking to perform a .click, or a .fire_event('click'), but actually take the system mouse pointer and use it on an element. Preferablly to click-and-drag.

My problem is locating the elements on the screen, as the watir-webdriver location and the Win32API location do not appear to be compatible - is there a way to find the element and hardware click on it? If so, will the same code work on two different machines?

Thanks :)

PS. I am aware of the click-and-drag code floating about that is in pure w-webdriver code, but it seems to not like a ZK interface very much.

Also this post has been edited for me to include the Watir tag, but it should be emphasised that the difference between the functionality of Watir and Watir-Webdriver is the reason for this question, and that I am using the latter.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

╰沐子 2024-12-20 04:07:05

就基于 IE 的解决方案而言,您是否见过这个 CheezyWorld 博客帖子 关于该主题?

In terms of an IE based solution, have you seen this CheezyWorld Blog Posting on the topic?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文