【selenium】10、鼠标悬停
- move_to_element():移动到元素上
- move_by_offset():移动到页面某个坐标位置
- move_to_element_with_offset():移动到元素的某个坐标位置
1、鼠标悬停-场景案例


2、隐藏元素操作,会出现异常:
ElementNotInteractableException: Message: element not interactable
not interactable: 元素不可交互,因为元素隐藏,不是可交互状态
3、move_to_elemnt():鼠标移动到元素上
perform():执行前面的动作

4、其他不常用的操作
- move_to_element():移动到元素上
- move_to_offset():移动到页面某个坐标位置
- move_to_element_with_offset():移动到元素的某个坐标位置
- context_click():右击鼠标
- double_click():双击鼠标

本文来自博客园,作者:郭祺迦,转载请注明原文链接:https://www.cnblogs.com/guojie-guojie/p/16161138.html

浙公网安备 33010602011771号