当前位置:网站首页>【WebDriver】使用AutoIt上传文件
【WebDriver】使用AutoIt上传文件
2022-06-29 17:33:00 【bobob_】
一、AutoIt用于Windows GUI(图形化界面)中进行自动化操作。
官方网站:https://www.autoitscript.com/site/
编辑要操作的windows 脚本

点击捕捉元素

找到元素

通过上面两个图AutoIt Windows Info中Control页面 获得以下信息。
窗口的title为“文件上传”,标题的Class为“#32770”。
文件名输入框的class 为“Edit”,Instance为“1” ,ClassnameNN为“Edit1”。
打开按钮的class 为“Button”,Instance为“1” ,ClassnameNN为“Button1”。
3、打开SciTE Script Editor编辑器,编写脚本。
SciTE Script Editor编辑器如下图:

ControlFocus("打开", "", "Edit1")
WinWait("[CLASS:#32770]","",3)
ControlSetText("打开","","Edit1","C:\DuBo\Desktop\TestData3.pdf")
Sleep(2000) ;等待2秒钟
ControlClick("打开","","Button1")
4、将脚本保存为uploadFile.au3,然后保持uploadFile.html的上传文件窗口处于打开状态,再通过通过Run Script 工具将uploadFile.au3打开运行

5.通过自动化测试脚本调用upfile.exe程序实现上传
public class UploadFile {
public static void main(String[] args) {
.........
try {
String str = "E://uploadFile.exe";
rn.exec(str);
} catch (Exception e) {
System.out.println("Error to run the exe");
}
}
}
边栏推荐
- R语言ggplot2可视化:使用patchwork包(直接使用加号+)将两个ggplot2可视化结果横向组合、接着再和第三个图像横向组合起来(三幅图各占比例为50%、25%、25%)
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用exp函数和coef函数获取模型所有变量的事件密度比(Incidence Density Ratio,IDR)并解读
- 基于STM32F103ZET6库函数定时器中断实验
- R语言使用自定义函数编写深度学习线性激活函数、并可视化线性激活函数
- 基于STM32F103ZET6库函数PWM输出实验
- The R language uses the KAP function (kap.2.raters function) of epidisplay package to calculate the value of kappa statistics (total consistency, expected consistency), analyze the consistency of the
- 基于STM32F103ZET6库函数串口实验
- The dplyr package filter function of R language filters the data in dataframe data through combinatorial logic (and logic). The content of one field is equal to one of the specified vectors, and the v
- MySQL highly available cluster – MHA
- 育润多维发力慈善领域,勇抗企业公益大旗
猜你喜欢
![[R language data science]: Text Mining (taking Trump's tweet data as an example)](/img/4f/09b9885915bee50fb40976a5002730.png)
[R language data science]: Text Mining (taking Trump's tweet data as an example)

Bottom level internal skill cultivation

LSB hidden items of stream carrier based on assembly implementation

如何创建虚拟形象

“授权同意”落地压力大?隐私计算提供一种可能的合规“技术解”

How to solve the 2003 error of MySQL in Linux

人脸识别4-百度商用方案调研

Basic operations such as MySQL startup under Windows platform

育润多维发力慈善领域,勇抗企业公益大旗

mysql在linux中2003错误如何解决
随机推荐
KUKA机器人外部轴配置你一定要知道的那些知识
mysql视图能不能创建索引
Tencent cloud released orbit, an automated delivery and operation and maintenance product, to promote enterprise applications to be fully cloud native
基于STM32F103ZET6库函数串口实验
How MySQL queries character set codes of tables
自定義HandlerInterceptor攔截器實現用戶鑒權
跨境独立站语言unicode转希伯来语
SCM系统是什么?供应链管理系统有哪些优势?
Kubernetes部署Dashboard(WEB UI管理界面)
[Oracle] basic knowledge interview questions
Browser large screen capture
C语言练习----指针字符串、链表
MySQL highly available cluster – MHA
毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
reflex
Online sql to CSV tool
C language practice ---- pointer string and linked list
regular expression
Custom handlerinterceptor interceptor for user authentication
2022 software evaluator examination outline