selenium 学习笔记 ---新手学习记录(4) 问题总结(java)-autoit3脚本使用

1.安装autoit3

下载地址:点我下载

 

1 (提取码:9633)
提取码

下载完成后,一直下一步即可

 

2.上传头像使用脚本

代码如下:

 1 ControlFocus("打开","","Edit1")
 2 ;等待打开窗口
 3 WinWaitActive("打开")
 4 $d=ControlFocus("打开","","Edit1")
 5 If $d==0 Then
 6    Local $hWnd = WinWait("[CLASS:#32770]", "", 10)
 7    ControlFocus("打开","",$hWnd)
 8 EndIf
 9 ;ControlSetText($hWnd, "", "Edit1", "This is some text")
10 $b=Send("C:\Users\Administrator\Desktop\xb\selzc.jpg")
11 If $b==0 Then
12    $a=ControlSend("打开", "", "Edit1", "C:\Users\Administrator\Desktop\xb\selzc.jpg")
13 EndIf
14 ;ControlSend("[CLASS:#32770]","gsdf","[CLASS:Edit]","aaa")
15 ;ControlSetText("打开","","Edit1","C:\\Users\\Administrator\\Desktop\\xb\\selzc.jpg")
16 Sleep(2000)
17 $c=ControlClick("打开","","Button1")
18 If $c ==0 Then
19     Send("{ENTER}")
20  EndIf
21  ;判断是否存在路径错误对话框
22 $e=ControlFocus("打开","","DirectUIHWND1")
23 If $e ==1 Then
24    Send("{ENTER}")
25    Sleep(1000)
26    $f=Send("C:\Users\Administrator\Desktop\xb\selzc.jpg")
27    If $f==0 Then
28    $g=ControlSend("打开", "", "Edit1", "C:\Users\Administrator\Desktop\xb\selzc.jpg")
29    EndIf
30 EndIf
autoit3 上传头像脚本

 

转载于:https://www.cnblogs.com/kllay/p/5160602.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值