ITPub博客

首页 > 数据库 > > Helium文档14-WebUI自动化-hover鼠标悬浮

Helium文档14-WebUI自动化-hover鼠标悬浮

作者:LCR_ 时间:2022-04-12 15:59:48 0 删除 编辑

前言

hover 实现功能是将鼠标光标悬停在给定的元素或点上

入参介绍

element
复制代码
def hover(element):
    """
    :param element: The element or point to hover.
    :type element: str, unicode, :py:class:`HTMLElement`, \
:py:class:`selenium.webdriver.remote.webelement.WebElement` or :py:class:`Point`

    Hovers the mouse cursor over the given element or point. For example::

        hover("File size")
        hover(Button("OK"))
        hover(Link("Download"))
        hover(Point(200, 300))
        hover(ComboBox("File type").top_left + (50, 0))
    """
复制代码

 

举例说明

复制代码
from helium import *
import time
start_chrome("https://cn.bing.com/")
driver = get_driver()
driver.maximize_window()  # 窗口最大化
hover(S("#shBingAppQR"))  # 悬浮
highlight(S("#shBingAppQR"))
time.sleep(5)
kill_browser()
复制代码

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70000523/viewspace-3154428/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2022-02-22

  • 博文量
    1402
  • 访问量
    15034