【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():双击鼠标

posted @ 2022-04-18 19:00  郭祺迦  阅读(582)  评论(0)    收藏  举报