zoukankan      html  css  js  c++  java
  • Selenium的鼠标事件,键盘事件

    在 WebDriver 中, 将这些关于鼠标操作的方法封装在 ActionChains 类提供。

    ActionChains 类提供了鼠标操作的常用方法:

    • perform(): 执行所有 ActionChains 中存储的行为;

    • context_click(): 右击;

    • double_click(): 双击;

    • drag_and_drop(): 拖动;

    • move_to_element(): 鼠标悬停。

    • from selenium.webdriver import ActionChains

    导入提供鼠标操作的 ActionChains 类。

    • ActionChains(driver)

    调用 ActionChains()类, 将浏览器驱动 driver 作为参数传入。

    • move_to_element(above)

    context_click()方法用于模拟鼠标右键操作, 在调用时需要指定元素定位。

    • perform()

    执行所有 ActionChains 中存储的行为, 可以理解成是对整个操作的提交动作。

  • 相关阅读:
    【原】戏说Java
    git分支branch合并到主分支master
    环境搭建
    zookeeper简单实战
    zookeeper介绍
    临时表与中间表
    避免活跃性
    sss
    sss
    sss
  • 原文地址:https://www.cnblogs.com/cyq0528/p/9897282.html
Copyright © 2011-2022 走看看