zoukankan      html  css  js  c++  java
  • AutoIT: 如何通过坐标相对位置来对无法识别的Menu以及GridView进行定位点击操作

    一般情况下,GridView中的数据来自数据库,我们通过Windows Info,是无法获取GridView中的信息的。
    而软件定制的Menu,很多时候无法通过系统提供的WinMenuSelectItem来获取。
    对于GridView窗口或者WinMenuSelectItem窗口等等,如果无法通过常规手段获取的资源,都可以使用ControlClick和ControlSetText命令对字段进行点击/双击/赋值操作。

    ;Get the handle of the main window
    $handle = WinGetHandle("[class:WindowsForms10.Window.20008.app.0.1f550a4_r15_ad1]")
    ;Double Click on a defined pos(200, 120)
    ControlClick($handle,"","WindowsForms10.Window.8.app.0.1f550a4_r15_ad129","left",2, 200, 120)
    $str2 = "0000-0000-0000-0000-02" & Random(10,99,1)
    Sleep(10)
    ; Send the text to an edit box
    ControlSetText($handle,"", "WindowsForms10.EDIT.app.0.1f550a4_r15_ad11",$str2)
    
    ;Click a menu by pos(30, 10)
    ControlClick($handle,"", "WindowsForms10.Window.8.app.0.1f550a4_r15_ad136", "left",1, 30, 10)
    Sleep(10)
    
    $handle2 = WinGetHandle("[class:WindowsForms10.Window.20808.app.0.1f550a4_r15_ad1]")
    ControlClick($handle2,"", "", "left", 1,50, 80)
    WinWaitActive("[Title:Save .NET Reactor Project File As..]")
    $handle3 = WinGetHandle("[title:Save .NET Reactor Project File As..]")
    ControlSetText($handle3,"","Edit1","D:	estabcdefgg.nrproj")
    ControlClick($handle3,"", "Button1")
    WinWaitActive("确认另存为")
    $handle4 = WinGetHandle("确认另存为")
    ControlClick($handle4,"","Button2")
    ControlSetText($handle3,"","Edit1","D:	estabcdefggffffg.nrproj")
    ControlClick($handle3,"", "Button1")
  • 相关阅读:
    common daemon
    java和 javaw 以及 javaws的区别
    Windows 64位环境的Java 服务配置
    Java Service Wrapper
    使用exe4j把java程序生成可执行的.exe文件
    Oracle安装
    Oracle 排序问题(null带来的)
    剖析简易计算器带你入门微信小程序开发
    实战SpringMVC+Mybatis搭建高性能安全站点
    SpringMVC利用拦截器防止SQL注入
  • 原文地址:https://www.cnblogs.com/autotest/p/3262338.html
Copyright © 2011-2022 走看看