当前位置:网站首页>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

边栏推荐
- DevCloud加持下的青软,让教育“智”上云端
- 基于gis三维可视化的智慧城市行业运用
- About harbor private warehouse forgetting the login password
- What is the SRM system? How do I apply the SRM system?
- 基于STM32F103ZET6库函数定时器中断实验
- Custom handlerinterceptor interceptor for user authentication
- Error:Connection refused: connect
- linux中mysql 1045错误如何解决
- Master slave replication of MySQL
- 2022 software evaluator examination outline
猜你喜欢

与爱同行,育润走进贫困家庭,助推公益事业

What is the MySQL query view command

关于日期相加减问题

mysql如何查询表的字符集编码

LeetCode 每日一题——535. TinyURL 的加密与解密
![填充每个节点的下一个右侧节点指针[利用好每个点->尽可能降低时空复杂度]](/img/33/bda0a898bfe3503197026d1f62e851.png)
填充每个节点的下一个右侧节点指针[利用好每个点->尽可能降低时空复杂度]

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

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

OpenFeign使用步骤 轮询策略与权重 log4j使用 openFeign拦截器的配置

在线文本数字识别列表求和工具
随机推荐
剑桥大学教授:经常吃早餐害处多,很危险 - 知乎
[try to hack] cookies and sessions
Bags of Binary Words for Fast Place Recognition in Image Sequenc
mysql查询视图命令是哪个
在线SQL转CSV工具
[Oracle] basic knowledge interview questions
How to solve MySQL 1045 error in Linux
固定资产管理系统让企业动态掌握资产情况
R language ggplot2 visualization: use the patchwork package (directly use the plus sign +) to horizontally combine the two ggplot2 visualization results, and then horizontally combine them with the th
Does MySQL support foreign keys
Visual Studio插件CodeRush正式发布v22.1——优化调试可视化工具
力扣今日题-535. TinyURL 的加密与解密
R语言使用自定义函数编写深度学习线性激活函数、并可视化线性激活函数
selenium 组合键操作
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
[the sixth operation of modern signal processing]
Self taught structure (small turtle C language)
MySQL触发器如何创建与删除
How to solve the 2003 error of MySQL in Linux
C language practice ---- pointer string and linked list