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

边栏推荐
- epoll分析
- 基于gis三维可视化的智慧城市行业运用
- What are the advantages of SaaS services
- MySQL highly available cluster – MHA
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用exp函数和coef函数获取模型所有变量的事件密度比(Incidence Density Ratio,IDR)并解读
- 关于Go中两个模块互相调用的场景解决方案
- 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
- 手把手教你在windows上安装mysql8.0最新版本数据库,保姆级教学
- Does MySQL support foreign keys
- 自学结构体(小甲鱼c语言)
猜你喜欢

自动收售报机

How to solve the 2003 error of MySQL in Linux

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

Redis principle - sorted set (Zset)

序列检测器

windows平台下的mysql启动等基本操作

0基础自学STM32(野火)——寄存器点亮LED

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

Online text digit recognition list summation tool

Tencent cloud released orbit, an automated delivery and operation and maintenance product, to promote enterprise applications to be fully cloud native
随机推荐
Master slave replication of MySQL
R语言将距离矩阵输入给hclust函数进行层次聚类分析,method参数指定两个组合数据点间的距离计算方式、plot函数可视化层次聚类的树状图(dendrogram)
SAAS 服务的优势都有哪些
Epoll analysis
序列检测器
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
从Mpx资源构建优化看splitChunks代码分割
How to create and delete MySQL triggers
R语言epiDisplay包的aggregate函数将数值变量基于因子变量拆分为不同的子集,计算每个子集的汇总统计信息、aggregate.data.frame函数包含缺失值的情况下分组统计结果为NA
基于STM32F103ZET6库函数独立看门狗(IWDG)实验
0基础自学STM32(野火)——寄存器点亮LED
Online sql to CSV tool
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
R language uses user-defined functions to write deep learning linear activation functions and visualize linear activation functions
线段树、树状数组模板(复制粘贴确实好用)
First batch! Tencent cloud's ability to pass the solution of the government affairs collaboration platform of the China Academy of ICT
Openfeign use step polling strategy and weight log4j configuration of openfeign interceptor
R语言使用epiDisplay包的kap函数(kap.2.raters函数)计算Kappa统计量的值(总一致性、期望一致性)、对两个评分对象的结果进行一致性分析、评分的类别为多个类别
【R语言数据科学】:文本挖掘(以特朗普推文数据为例)
Pancakeswap Technology: development principle of gripper robot system