当前位置:网站首页>Selenium:鼠标、键盘事件
Selenium:鼠标、键盘事件
2022-08-01 04:59:00 【不怕猫的耗子A】
鼠标事件
1、前面介绍了Selenium中模拟鼠标"左键单击"的方法click(),仅仅只有这个方法是完全不够的。现在的Web产品中提供了更丰富的鼠标交互方式
⑴例如鼠标右击、双击、悬停、拖动等功能
⑵同样的在Selenium中也提供了对应的方法来模拟这些鼠标操作
2、在WebDriver中,将这些关于鼠标操作的方法封装在了ActionChains类中
⑴类名ActionChains两个单词首字母需要大写
3、ActionChains类下的鼠标方法在使用前都需要先实例化一个ActionChains对象,最后使用perfrom()方法进行提交动作
⑴使用ActionChains对象调用其下的鼠标方法
执行动作
1、方法名:perfrom()
2、之所以要先介绍这个方法是因为这个方法的作用为:执行所有的ActionChains中存储的行为,可以理解成对整个操作的提交动作
⑴也就是说:在ActionChains类中的所有鼠标方法,都需要经过这个方法进行提交
3、调用ActionChains类方法(鼠标操作方法)时,不会立即执行,而是将所有操作都存放在一个队列里,当调用perform()方法时,队列里的操作会依次执行
⑴可以理解为对鼠标事件的提交操作
4、这个方法都是与其他鼠标方法结合起来使用的,因此会在后面的例子中进行演示
鼠标左键单击
边栏推荐
- (2022牛客多校四)K-NIO‘s Sword(思维)
- typescript21 - Comparison of Interfaces and Type Aliases
- High Numbers | 【Re-integration】Line Area Score 880 Examples
- 基于ProXmoX VE的虚拟化家庭服务器(篇一)—ProXmoX VE 安装及基础配置
- y83.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十四)
- USB3.0:VL817Q7-C0的LAYOUT指南(三)
- HJS-DE1/2时间继电器
- typescript20-接口
- Power button (LeetCode) 212. The word search II (2022.07.31)
- 4D line-by-line analysis and implementation of Transformer, and German translation into English (3)
猜你喜欢
出现Command ‘vim‘ is available in the following places,vim: command not found等解决方法
API设计笔记:pimpl技巧
【愚公系列】2022年07月 Go教学课程 024-函数
云服务器下载安装mongo数据库并远程连接详细图文版本(全)
MySQL-DML语言-数据库操作语言-insert-update-delete-truncate
Typescript20 - interface
DL-31/6电流继电器
MySQL-数据定义语言-DDLdatebase define language
(2022牛客多校四)K-NIO‘s Sword(思维)
(more than 2022 cattle school four) A - Task Computing + dynamic programming (sort)
随机推荐
开源许可证 GPL、BSD、MIT、Mozilla、Apache和LGPL的区别
华为Android开发面试后得出的面试秘诀
阿叶的目标
Excel做题记录——整数规划优化模型
typescript28 - value of enumeration type and data enumeration
The difference between scheduleWithFixedDelay and scheduleAtFixedRate
The method of solving stored procedure table name passing through variable in mysql
(2022牛客多校四)N-Particle Arts(思维)
【云原生之kubernetes实战】kubernetes集群的检测工具——popeye
Excel record of integer programming optimization model to solve the problem
力扣(LeetCode)212. 单词搜索 II(2022.07.31)
ModuleNotFoundError: No module named ‘tensorflow.keras‘报错信息的解决方法
状态压缩dp
PMP 项目沟通管理
【愚公系列】2022年07月 Go教学课程 024-函数
UE4 模型OnClick事件不生效的两种原因
【目标检测】YOLOv7理论简介+实践测试
PAT乙级 1001 害死人不偿命的(3n+1)猜想
零序电流继电器器JL-8C-12-2-2
出现Command ‘vim‘ is available in the following places,vim: command not found等解决方法