selenium 學習筆記 ---新手學習記錄(4) 問題總結(java)-autoit3腳本使用

1.安裝autoit3ide

下載地址:點我下載spa

 

1 (提取碼:9633)
提取碼

下載完成後,一直下一步便可code

 

2.上傳頭像使用腳本blog

代碼以下:get

 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 上傳頭像腳本
相關文章
相關標籤/搜索