当前位置:网站首页>Uploading files using AutoIT
Uploading files using AutoIT
2022-06-29 17:40:00 【bobob_】
1. Write a script
$fileName=$cmdline[1]
ControlFocus(" open ","","Edit1")
ControlSetText(" open ","","Edit1",$fileName)
ControlClick(" open ","","Button1")
2. Compile the script as : uploadFile.exe
3. stay java Call in code uploadFile.exe
/**
*
* @param fileName Full path file name e.g :C:\\Users\\Administrator\\Downloads\\user_ex.csv
*/
public static void uploadFile(String fileName) {
try {
if(I2GUITestPage.isDebug()){
Runtime.getRuntime().exec("D:\\bat\\autoit\\uploadFile.exe "+fileName);
}else{
Runtime.getRuntime().exec("Z:\\resources\\uploadFile.exe "+fileName);
}
} catch (IOException e) {
e.printStackTrace();
}
}
Little knowledge points :
stay cmd In the implementation of AutoIt When automating scripts , You can pass parameters to the script .
AutoIt When the script is executing , Automatically initializes a special array $CmdLine, among $CmdLine[0] Represents the number of parameters ,$CmdLine[1] Represents the first parameter ,$CmdLine[2] representative The second parameter .
边栏推荐
- R language uses user-defined functions to write deep learning leaky relu activation functions and visualize leaky relu activation functions
- Help MySQL data analysis with databend
- The soft youth under the blessing of devcloud makes education "smart" in the cloud
- Does MySQL support foreign keys
- 【WebDriver】使用AutoIt上传文件
- Sword finger offer 13 Robot range of motion (BFS)
- Open source warehouse contribution - submit pr
- mysql游标的作用是什么
- 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
- Opencv+YOLO-V3实现目标跟踪
猜你喜欢

Basic operations such as MySQL startup under Windows platform

Tencent cloud released orbit, an automated delivery and operation and maintenance product, to promote enterprise applications to be fully cloud native

SRM供应商协同管理系统功能介绍
Master slave replication of MySQL

MySQL触发器如何创建与删除

How to solve MySQL 1045 error in Linux

selenium上传文件

High landing pressure of "authorization and consent"? Privacy computing provides a possible compliance "technical solution"

剖析下零拷贝机制的实现原理,适用场景和代码实现

sequential detector
随机推荐
Multi mode concurrent implementation of tortoise and rabbit race in go language
Issue 42: is it necessary for MySQL to have multiple column partitions
How to create a virtual image
腾讯云发布自动化交付和运维产品Orbit,推动企业应用全面云原生化
基于STM32F103ZET6库函数独立看门狗(IWDG)实验
Freedom自由协议质押挖矿系统开发
Redis 原理 - Sorted Set (ZSet)
Leetcode daily question - 535 Encryption and decryption of tinyurl
Automatic vending machine
力扣每日一题 06.29 两数相加
R语言使用自定义函数编写深度学习线性激活函数、并可视化线性激活函数
First batch! Tencent cloud's ability to pass the solution of the government affairs collaboration platform of the China Academy of ICT
R语言dplyr包filter函数通过组合逻辑(与逻辑)过滤dataframe数据中的数据、其中一个字段的内容等于指定向量中的其中一个,并且另外一个字段值大于某一阈值
力扣今日题-535. TinyURL 的加密与解密
What role does the supply chain management system play in the supply chain scenario?
SAAS 服务的优势都有哪些
selenium 文件上传方法
R语言使用自定义函数编写深度学习Leaky ReLU激活函数、并可视化Leaky ReLU激活函数
How to solve MySQL 1045 error in Linux
Industry application of smart city based on GIS 3D visualization