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

边栏推荐
- KUKA robot external axis configuration what you must know
- [the sixth operation of modern signal processing]
- 关于Go中两个模块互相调用的场景解决方案
- 0基础自学STM32(野火)——使用寄存器点亮LED——GPIO功能框图讲解
- PCB板框的绘制——AD19
- Kubernetes deployment dashboard (Web UI management interface)
- Redis bloom filter and cuckoo filter
- mysql视图能不能创建索引
- 基于STM32F103ZET6库函数独立看门狗(IWDG)实验
- 0 basic self-study STM32 (wildfire) - register lit LED
猜你喜欢

mysql. What is the concept of sock

How MySQL queries character set codes of tables

自动收售报机

“授权同意”落地压力大?隐私计算提供一种可能的合规“技术解”
Help MySQL data analysis with databend

Redis 原理 - Sorted Set (ZSet)

What is the MySQL query view command

从Mpx资源构建优化看splitChunks代码分割

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

与爱同行,育润走进贫困家庭,助推公益事业
随机推荐
从居家办公中感悟适配器模式 | 社区征文
mysql.sock的概念是什么
R语言epiDisplay包的aggregate函数将数值变量基于因子变量拆分为不同的子集,计算每个子集的汇总统计信息、aggregate.data.frame函数包含缺失值的情况下分组统计结果为NA
regular expression
Error:Connection refused: connect
基于STM32F103ZET6库函数定时器中断实验
R语言ggplot2可视化:使用patchwork包(直接使用加号+)将一个ggplot2可视化结果和一个plot函数可视化结果横向组合起来形成最终结果图
What role does the supply chain management system play in the supply chain scenario?
KUKA robot external axis configuration what you must know
Tencent cloud released orbit, an automated delivery and operation and maintenance product, to promote enterprise applications to be fully cloud native
How to use interrupt
Custom handlerinterceptor interceptor for user authentication
2022 software evaluator examination outline
Use SSH to pull codes
Li Kou today's question -535 Encryption and decryption of tinyurl
High landing pressure of "authorization and consent"? Privacy computing provides a possible compliance "technical solution"
PCB frame drawing - ad19
R language ggplot2 visualization: use the patchwork package (directly use the plus sign +) to horizontally combine a ggplot2 visualization result and a plot function visualization result to form the f
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
基于STM32F103ZET6库函数串口实验