当前位置:网站首页>Selenium: mouse, keyboard events
Selenium: mouse, keyboard events
2022-08-01 05:08:00 【Mouse A who is not afraid of cats】
Mouse events
1. The method click(), which simulates the "left click" of the mouse in Selenium, was introduced earlier. This method alone is not enough.Current Web products provide richer mouse interaction methods
⑴ ⑴ For example, functions such as right-click, double-click, hover, drag, etc.
⑵ Similarly, Selenium also provides corresponding methods to simulate these miceAction
2. In WebDriver, these methods of mouse operation are encapsulated in the ActionChains class.
⑴The first letter of the class name ActionChains needs to be capitalized
3. The mouse method under the ActionChains class needs to instantiate an ActionChains object before use, and finally use the perfrom() method to submit the action
⑴ ⑴Use the ActionChains object to call the mouse method under it
Perform action
1. Method name: perfrom()
2. The reason why this method should be introduced first is because the function of this method is to execute all the actions stored in ActionChains, which can be understood as the submission action for the entire operation
⑴ ⑴ That is to say : All mouse methods in the ActionChains class need to be submitted through this method
3. When the ActionChains class method (mouse operation method) is called, it will not be executed immediately, but all operations will be stored in a queue. When the perform() method is called, the operations in the queue will be executed sequentially
⑴ can be understood as the submission of mouse events
4. This method is used in combination with other mouse methods, so it will be demonstrated in the following examples
Left mouse click
边栏推荐
猜你喜欢
随机推荐
PAT乙级 1002 写出这个数
剑指 Offer 68 - II. 二叉树的最近公共祖先
风险策略调优中重要的三步分析法
[target detection] YOLOv7 theoretical introduction + practical test
Swastika line-by-line parsing and realization of the Transformer, and German translation practice (2)
可持久化线段树
零序电流继电器器JL-8C-12-2-2
Selenium:元素定位
移动应用恶意攻击激增500% 三六零天御为APP免费构建安全屏障
(more than 2022 cattle school four) A - Task Computing + dynamic programming (sort)
RSA主要攻击方法
文件的异步读写
在沈自所的半年总结
报错:AttributeError: module ‘matplotlib’ has no attribute ‘figure’
typescript26-字面量类型
牛客多校2022第四场A,H,K,N
typescript24-类型推论
2022年超全的Android面经(附含面试题|进阶资料)
类神经网络训练不起来怎么办
7 行代码搞崩溃 B 站,原因令人唏嘘!