autoit使用

AutoIt Window Info: 用于识别Windows控件信息
Compile Script to.exe: 用于将AutoIt编写的脚本转换成可执行的文件
Run Script: 用于执行AutoIt脚本
SciTE Script Editor: 用于编写AutoIt脚本

auto.py

#coding=utf-8
from selenium import webdriver
import os

driver = webdriver.Chrome()

#打开上传功能页面
file_path =  'file:///' + os.path.abspath('uplad.html')
driver.get(file_path)

#点击打开上传窗口
driver.find_element_by_name("file").click()
#调用upfile.exe上传程序
os.system("D:\\upfile2.exe")

# driver.quit()

upfile2.au3

;ControlFocus("title","text",controlID) Edit1=Edit instance 1
ControlFocus("打开", "","Edit1")


; Wait 10 seconds for the Upload window to appear
  WinWait("[CLASS:#32770]","",10)


; Set the File name text on the Edit field

  ControlSetText("打开", "", "Edit1", "D:\upload_file.txt")

  Sleep(2000)

; Click on the Open button

  ControlClick("打开", "","Button1");

uplad.html





upload_file



  

upload_file

你可能感兴趣的:(autoit使用)