• windows自动化-脚本案例


    ; Script Start - Add your code below here
    Run("D:Navicat Premium
    avicat.exe")
    Sleep(1000)
    
    ;~ 获取窗口句柄
    $handle=WinGetHandle("Navicat Premium", "")
    Sleep(1000)
    
    ;~ 最大化
    WinSetState($handle, "", @SW_MAXIMIZE)
    Sleep(1000)
    
    ;~ 激活窗口
    WinActivate($handle)
    Sleep(1000)
    
    ; 定位控件——获取窗口句柄,根据classnameNN为TVirtualStringTree1
    $control_handle = ControlGetHandle($handle,"","TVirtualStringTree1")
    Sleep(1000)
    
    ;~ 右击控件
    ControlClick($handle,"",$control_handle,"right")
    Sleep(1000)
    
    
    Send("{DOWN 3}")
    Sleep(1000)
    
    Send("{ENTER}")
    Sleep(1000)
    
    Send("{DOWN 5}")
    Sleep(1000)
    
    Send("{ENTER}")
    Sleep(1000)
    
    ;~ 获取窗口句柄
    $handle_mariadb_newconf=WinGetHandle("MariaDB - 新建连接", "")
    Sleep(1000)
    
    
    ;~ 激活窗口
    WinActivate($handle_mariadb_newconf)
    Sleep(1000)
    
    ; 定位控件——获取窗口句柄,根据classnameNN为TVirtualStringTree1
    $control_handle_new_name = ControlGetHandle($handle,"","TEdit5")
    Sleep(1000)
    Send("mariadb_2")
    
    
    $control_handle_ip = ControlGetHandle($handle_mariadb_newconf,"","TEdit1")
    ControlClick($handle_mariadb_newconf,"",$control_handle_ip,"left")
    Sleep(1000)
    Send("^a")
    Send("120.24.25.71")
    
    $control_handle_port = ControlGetHandle($handle_mariadb_newconf,"","TEdit4")
    Sleep(1000)
    ControlClick($handle_mariadb_newconf,"",$control_handle_port,"left")
    Sleep(1000)
    Send("^a")
    Send("3306")
    
    $control_handle_user = ControlGetHandle($handle_mariadb_newconf,"","TEdit3")
    Sleep(1000)
    ControlClick($handle_mariadb_newconf,"",$control_handle_user,"left")
    Sleep(1000)
    Send("^a")
    Send("USER")
    
    $control_handle_mm = ControlGetHandle($handle_mariadb_newconf,"","TEdit2")
    Sleep(1000)
    ControlClick($handle_mariadb_newconf,"",$control_handle_mm,"left")
    Sleep(1000)
    Send("^a")
    Send("mmmmmmm")
    
    Sleep(1000)
    Send("{ENTER}")
    

      

  • 相关阅读:
    tomcat进阶操作
    tomcat环境部署
    CentOS 7.2安装lepus数据库监控系统
    常见的Linux系统监控命令
    zabbix使用jmx监控tomcat
    zabbix配置文件详解
    zabbix2.2.22 升级3.0.18
    zabbix日志监控
    zabbix api的使用
    zabbix低级自动发现之mysql多实例
  • 原文地址:https://www.cnblogs.com/andy9468/p/11939412.html
Copyright © 2020-2023  润新知