robotframework踩坑8--AutoItLibrary操作

demo3
    # 执行计算器程序    # run C:\personal\npp.7.8.9.bin.x64\notepad++.exe
    run    calc.exe
    # 等待窗口出现 win wait active | [ WindowTitle | WindowText=WindowText | TimeOut=TimeOut ]
    win wait active    计算器    \    5
    # control click | [ strTitle=strTitle | strText=strText | strControl=strControl | strButton=left | nNumClicks=1 | nX=-2147483647 | nY=-2147483647 ]
    # control click 比坐标点击更稳定,但windows10的计算器获取的元素control属性值都相同,改用其他方式测试
    # 鼠标点击 mouse click | [ strButton=strButton | nX=nX | nY=nY | nClicks=1 | nSpeed=-1 ]
    # 利用坐标方式点击元素容错率超级低(坐标经常改变),不可取
    mouse click    left    119    307    # 8
    mouse click    left    276    415    # +
    mouse click    left    119    416    # 2
    mouse click    left    279    470    # =
    # 输入键盘字符 send | [ strSendText=4{+}6{=} | nMode=0 ]    # {}除字母、数字外其他字符
    send    4{+}6{=}
    sleep    2
    # 关闭 win close | [ StrTitle=Title ]
    win close    计算器

demo 4
    run    calc.exe
    # 组合键操作 {ALTDOWN}按下 | {ALTUP}释放
    send    {ALTDOWN}
    send    a
    send    x
    send    {ALTUP}
    # 关闭进程 process close | [ strProcess=strProcess ]
    process close    calc.exe
    # 获取窗口宽度 ${var1} | Win Get Client Size Width | [ strTitle=strTitle | strText=strText ]
    # 获取窗口高度 ${var2} | Win Get Client Size Height | [ strTitle=strTitle | strText=strText ]
    # 获取窗口标题 ${var3} | Win Get Title | [ strTitle=strTitle | strText=strText ]
    # 设置窗口标题 Win Set Title | [ strTitle=strTitle | strText=strText | strNewTitle=strNewTitle]
    # 更多用法参考它的帮助文档吧~~~~~
    # 现在也可以使用 AutoItLibrary 直接操作上传了~~~~~

 

你可能感兴趣的:(robotframework踩坑8--AutoItLibrary操作)