当前位置:网站首页>Selenium file upload method
Selenium file upload method
2022-06-29 17:40:00 【bobob_】
1. utilize AutoIT
2. Simulate keyboard to directly copy upload file path
Multiple document paths can be separated by spaces and double quotes
public void windowsCtrlCV(TestStep step) throws Exception {
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection("C:\\Users\\Desktop\\TestData3.pdf"),null);
Thread.sleep(2000);
try {
if (Constants.ISDEBUG) System.out.println("『 Normal test 』 Start execution : " + "<" + step.getDesc() + ">");
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_V);
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.keyRelease(KeyEvent.VK_V);
Thread.sleep(2000);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
} catch (Exception e) {
e.printStackTrace();
if (Constants.ISDEBUG) System.err.println(Constants.LogCustom+"windowsCtrlCV");
}
}
3. xpath yes input

边栏推荐
- 关于日期相加减问题
- Automatic vending machine
- mysql在linux中2003错误如何解决
- mysql. What is the concept of sock
- Li Kou today's question -535 Encryption and decryption of tinyurl
- 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
- 从居家办公中感悟适配器模式 | 社区征文
- 基于STM32F103ZET6库函数串口实验
- 关于KALI使用xshell连接
- R语言将距离矩阵输入给hclust函数进行层次聚类分析,method参数指定两个组合数据点间的距离计算方式、plot函数可视化层次聚类的树状图(dendrogram)
猜你喜欢

0 basic self-study STM32 (wildfire) -- use register to light LED -- Explanation of GPIO function block diagram

How to solve MySQL 1045 error in Linux

Online text digit recognition list summation tool

底层内功修养

The soft youth under the blessing of devcloud makes education "smart" in the cloud

How to solve the 2003 error of MySQL in Linux
Master slave replication of MySQL

0 basic self-study STM32 (wildfire) - register lit LED

Industry application of smart city based on GIS 3D visualization

selenium 文件上传方法
随机推荐
SRM供应商协同管理系统功能介绍
Redis 原理 - Sorted Set (ZSet)
Cross border independent station language Unicode to Hebrew
Industry application of smart city based on GIS 3D visualization
关于日期相加减问题
2022春夏系列 KOREANO ESSENTIAL重塑时装生命力
Bottom level internal skill cultivation
Redis principle - sorted set (Zset)
3h精通OpenCV(九)-最简单的人脸检测
在线文本数字识别列表求和工具
Yurun multidimensional makes efforts in the charity field and bravely resists the corporate public welfare banner
Inherit Chinese virtues, pay attention to the health of the middle-aged and the elderly, and Yurun milk powder has strong respect for the elderly
PancakeSwap技术:夹子机器人系统开发原理
Use SSH to pull codes
关于Go中两个模块互相调用的场景解决方案
What is the MySQL query view command
MySQL触发器如何创建与删除
Graduation season | Huawei experts teach interview tips: how to get a high salary offer from a large factory?
2022 software evaluator examination outline
Pancakeswap Technology: development principle of gripper robot system