简体   繁体   English

自动热键:检测GUI的响应

[英]Autohotkey: detecting the response of GUI

I have a simple database application, for which I want to automate the following: 我有一个简单的数据库应用程序,要对其自动化以下操作:

  1. Click on 'View Table' button 点击“查看表格”按钮
  2. Start timer 启动计时器
  3. Wait till the content appears 等到内容出现
  4. End timer 结束计时器
  5. Click on 'Close Table' button 点击“关闭表格”按钮

repeat this process for 50 times and calculate the average time. 重复此过程50次并计算平均时间。

So, my question is: 所以,我的问题是:

I know how to do all other steps with autohotkey but 3. Is it possible to detect that the fetching operation is done, if I do not have code? 我知道如何使用autohotkey来执行所有其他步骤,但是3。如果我没有代码,是否可以检测到提​​取操作已完成?

As Gary Hughes said in the comment, one solution is to grab text of the window or text of a textbox and compare to see if its changed. 正如加里·休斯(Gary Hughes)在评论中所说,一种解决方案是获取窗口文本或文本框文本,然后进行比较以查看其是否已更改。

Another solution would be to take a screenshot of an area of the original or changed window that will always be there, and then do an ImageSearch to check if its visible or not. 另一个解决方案是对将始终存在的原始窗口或更改后的窗口区域进行屏幕截图,然后执行ImageSearch来检查其是否可见。

Another would be to notice if a certain area of the window changes color when the content appears, and then do a PixelSearch to check for the visibility of a color at a certain x/y location. 另一个要注意的是,当内容出现时,窗口的特定区域是否会更改颜色,然后执行PixelSearch来检查特定x / y位置上颜色的可见性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM