当前位置:网站首页>selenium 文件上传方法
selenium 文件上传方法
2022-06-29 17:33:00 【bobob_】
1.利用AutoIT
2.模拟键盘直接复制上传文件路径
多个文档路径可以用空格和双引号分割
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("『正常测试』开始执行: " + "<" + 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是input

边栏推荐
- 育润多维发力慈善领域,勇抗企业公益大旗
- Mysql中锁的使用场景是什么
- How to solve MySQL 1045 error in Linux
- SLAM中的子图
- C comparison of the performance of dapper efcore sqlsugar FreeSQL hisql sqlserver, an ORM framework at home and abroad
- 关于Go中两个模块互相调用的场景解决方案
- Development of freedom free agreement pledge mining system
- epoll分析
- Younger sister Juan takes you to learn JDBC - 2-day dash Day1
- Can MySQL views create indexes
猜你喜欢

sequential detector

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

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

Leetcode daily question - 535 Encryption and decryption of tinyurl

Openfeign use step polling strategy and weight log4j configuration of openfeign interceptor

疫情居家外包项目之协作开发| 社区征文

0基础自学STM32(野火)——使用寄存器点亮LED——GPIO功能框图讲解

在线SQL转CSV工具

Subgraphs in slam

The soft youth under the blessing of devcloud makes education "smart" in the cloud
随机推荐
Sectigo ov pan domain name certificate is 1590 yuan a year easy to use
The aggregate function in the epidisplay package of R language divides numerical variables into different subsets based on factor variables, and calculates the summary statistics and aggregate data. W
mysql.sock的概念是什么
About Kali using xshell connection
与爱同行,育润走进贫困家庭,助推公益事业
C语言练习----指针字符串、链表
手把手教你在windows上安装mysql8.0最新版本数据库,保姆级教学
mysql在linux中2003错误如何解决
第42期:MySQL 是否有必要多列分区
关于Go中两个模块互相调用的场景解决方案
剑指 Offer 13. 机器人的运动范围 (BFS)
R语言使用自定义函数编写深度学习Leaky ReLU激活函数、并可视化Leaky ReLU激活函数
mysql如何查询表的字符集编码
自动收售报机
R language uses user-defined functions to write deep learning linear activation functions and visualize linear activation functions
Go语言多方式并发实现龟兔赛跑
固定资产管理系统让企业动态掌握资产情况
Function calculation asynchronous task capability introduction - task trigger de duplication
Openfeign use step polling strategy and weight log4j configuration of openfeign interceptor
Bags of Binary Words for Fast Place Recognition in Image Sequenc