如何使用 watir-webdriver 模拟 CTRL+Click? [英] How to simulate CTRL+Click with watir-webdriver?

查看:35
本文介绍了如何使用 watir-webdriver 模拟 CTRL+Click?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想模拟 ctrl keydown 和 ctrl keyup.

I want to simulate ctrl keydown and ctrl keyup.

我的用例如下:

用户可以通过按 CTRL 键并单击所需行从列表(用表格构建)中选择多个元素.释放 CTRL 键后,将进行 AJAX 调用.

The user can select from a list (build with a table) multiple elements by pressing CTRL key and clicking on the desired row. When the CTRL key is released an AJAX call will be made.

我需要一个 watir 测试来模拟这个.我怎样才能做到这一点 ?有任何想法吗 ?我需要一个适用于 Linux 的解决方案

I need a watir test to simulate this. How can i do this ? Any ideas ? I would need a solution that works under Linux

非常感谢.

推荐答案

意识到这是旧的,但原来的问题并没有得到很好的回答,我完成这个的方式是:

Realising this is old, but the original question didn't quite get answered, the way I have completed this is to do:

browser.a.click(:control)

如果您使用的是 mac 系统,您可能需要使用 :command.

If you are on a mac system you may want to use :command.

参见 http://watir.com/guides/special-keys/

这篇关于如何使用 watir-webdriver 模拟 CTRL+Click?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆