在非常规的上传界面中,AutoIt可以操作Windows资源管理器实现上传路径的输入。

采用AutoIt实现文件上传

AutoIt中编辑以下脚本,需通过“AutoIt Windows Info”定位资源管理器路径输入位置信息及打开按钮信息。

1 ;ControlFocus("title","text",controlID) Edit1=Edit instance 1
2 ControlFocus("打开", "","Edit1")
3 ; Wait 10 seconds for the Upload window to appear
4 WinWait("[CLASS:#32770]","",10)
5 ; Set the File name text on the Edit field
6 ControlSetText("打开", "", "Edit1", "D:\test.jpeg")
7 Sleep(1000)
8 ControlClick("打开", "", "Button1")
9 ; Click on the Open button

通过”Compile Script to .exe”将脚本转换成对应32 or 64bit操作系统运行的exe程序。

注意:

调用AutoIt生成的exe前请先打开Web上传图片按钮。

相关文章:

  • 2022-12-23
  • 2021-11-01
  • 2021-08-11
  • 2021-06-06
  • 2022-12-23
  • 2021-08-03
  • 2021-07-22
  • 2022-12-23
猜你喜欢
  • 2022-01-12
  • 2021-11-20
  • 2021-10-23
  • 2021-04-20
  • 2022-01-04
相关资源
相似解决方案