当前位置:网站首页>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 create and delete MySQL triggers
- Bottom level internal skill cultivation
- Error:Connection refused: connect
- R语言将距离矩阵输入给hclust函数进行层次聚类分析,method参数指定两个组合数据点间的距离计算方式、plot函数可视化层次聚类的树状图(dendrogram)
- How to create a virtual image
- 在线文本数字识别列表求和工具
- 从Mpx资源构建优化看splitChunks代码分割
- Custom handlerinterceptor interceptor for user authentication
猜你喜欢

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

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

How to create and delete MySQL triggers

迈动互联中标大家保险集团

传承中华美德,关注中老年大健康,育润奶粉敬老情浓

sequential detector

Collaborative development of epidemic home outsourcing project 𞓜 community essay solicitation

mysql查询视图命令是哪个
![[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)

Automatic vending machine
随机推荐
Development of freedom free agreement pledge mining system
开源仓库贡献 —— 提交 PR
反射
Understanding adapter mode from home office | community essay solicitation
2022 software evaluator examination outline
KUKA子程序/函数怎么建立和使用方法
Bottom level internal skill cultivation
R语言使用MASS包的glm.nb函数建立负二项广义线性模型(negative binomial)、summary函数获取负二项广义线性模型模型汇总统计信息
Viewing splitchunks code segmentation from MPX resource construction optimization
Leetcode daily question - 535 Encryption and decryption of tinyurl
Kubernetes deployment dashboard (Web UI management interface)
腾讯云发布自动化交付和运维产品Orbit,推动企业应用全面云原生化
设置双击运行 jar 文件
正则表达式
在线文本数字识别列表求和工具
The soft youth under the blessing of devcloud makes education "smart" in the cloud
Issue 42: is it necessary for MySQL to have multiple column partitions
0 basic self-study STM32 (wildfire) - register lit LED
0基础自学STM32(野火)——使用寄存器点亮LED——GPIO功能框图讲解
机器人不需要保养和出界也能拿金牌是一样一样的