1

Im trying to accelerate the use of a web application using selenium Webdriver by creating hotkeys for it. I want certain webdriver click events to be associated with keyboard keys. For example, pressing "s" on the keyboard will click on the submit button.

I understand how to do the clicking and locating elements with webdriver but don't know how to go about listening to the keys from Java while Firefox is open (from a webdriver get call). My application has no GUI and since it's opening a firefox window it will lose focus so KeyListener is not an option.

I have come accross the JNI library that I'm looking into. Any other suggestions how I may do this?

4

1 回答 1

0

在这种情况下,自动化整个过程几乎总是更好的主意

比如说,您需要每天更新员工的工资。最好花时间阅读 XLS 文件(这些数据是如何交付给注定要进行重复工作的人的几乎标准方式)并逐行阅读并以某种方式将其输入到应用程序中。

我知道我没有为您提供您期望的答案,但请尝试将整个过程自动化。与简单的键映射相比,这可能有点棘手,但可行 - 并且最终更快

于 2013-04-03T14:04:19.790 回答