在monkeyrunner中鼠标和键盘可以同时使用吗?
我们可以在monkeyrunner中测试时同时执行鼠标单击事件和键盘按下事件吗? 如果是的话怎么办?请告诉我。
提前谢谢...
Can we perform mouseclick event and keyboard press event at once testing time in monkeyrunner?
If yes then how? Please tell me.
Thanx in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我得到了这个问题的答案。 Monkeyrunner 中无法使用鼠标单击。在 Monkeyrunner 中我们只能获取键盘按下事件。
I got the solution of this question. There is no way to use the mouseclick in Monkeyrunner. We can get only keyboard press event in the Monkeyrunner.
您将需要使用 MonkeyRunner.DOWN 执行这两个操作,然后执行类似 MonkeyRunner.sleep(.25) 的操作,并使用 MonkeyRunner.UP 执行这些相同的操作。
您需要选择首先发生的事件之一,但是两者都应该发生得足够快,以至于无关紧要。
You will need to use MonkeyRunner.DOWN for both actions then do something like MonkeyRunner.sleep(.25) and use MonkeyRunner.UP for those same actions.
You will need to pick one of the events to happen first, however both should happen fast enough that it won't matter.