我正在使用 Ruby gem Rautomation 来测试基于 Windows 的应用程序。该应用程序在远程 Citrix 服务器后面运行,因此我无法以通常的方式与该应用程序交互。我无法使用诸如 windows inspect.exe 之类的刮刀访问应用程序上的任何元素。我想做的是使用键盘和/或鼠标在应用程序上选择文本,然后将其复制到文件中以进行验证。
这是我想做的代码片段:
window = RAutomation::Window.new(:title => /Manager App/i, :adapter => 'ms_uia')
window.move_mouse(60,95)
window.click_mouse_and_hold # is there a 'hold' method??
window.move_mouse(80,95)
window.release_mouse # is there a 'release' method??
window.send_keys [:left_control, 'c']
或者
window.move_mouse(60,95)
window.click
window.send_keys :shift # hold this key down somehow??
window.move_mouse(80,95)
window.release_shift # is there a 'release' key method??
window.send_keys [:left_control, 'c']
我想做的是拖动鼠标来选择这个应用程序上的一段文本,或者选择一些文本的开头,按住 shift,然后选择我需要的文本的结尾。基本上是通过 Rautomation 复制用户在现实生活中选择和复制文本的方式。这可能吗?
谢谢