【问题标题】:Python Selenium: Show Tooltip on Mouse Pointer (Three.js/React/Canvas)Python Selenium:在鼠标指针上显示工具提示(Three.js/React/Canvas)
【发布时间】:2018-09-07 10:06:06
【问题描述】:

所以这是一个有点棘手的情况。使用 Three.js/ReactJS 和画布。

Scenario: When I click and drag a sphere beyond its boundaries a tooltip will show a warning message over the mouse pointer. When I release the mouse the tooltip will disappear. When I click and drag the sphere back to a position inside the boundaries, the tooltip will not be displayed once inside the boundaries.

请记住,这与由 react 处理的应用程序的状态相关联,在这种情况下,工具提示会在满足条件并在状态中更新时更新。

工具提示元素存在,但是当球体超出范围时,属性和内容会在单击并按住时更新... 使用

ActionChains(page.driver).move_to_element_with_offset(sphere_order_panel, -1047, 398).click_and_hold().move_to_element_with_offset(sphere_order_panel, -1633, 265).click_and_hold().perform()

单击元素并将其拖动到其边界之外的位置,但工具提示未更新...一旦我手动单击页面,我就在页面上放置了一个断点,我的球体被捕捉到我的鼠标位置(意思是click_and_hold 确实在工作...但是我检查了 html 并确认工具提示没有更新。但是,如果我手动使用鼠标并单击球体,工具提示将更新!是硒自动化不执行click_and_hold 正确吗?我不认为是这种情况。

有没有办法使用 selenium 将鼠标指针添加到页面上?

或者有没有办法使用execute_script()在页面上使用javascript来满足我的条件来更新工具提示?

我真的被困在了这个..这是一个棘手的情况(至少对我来说)

非常感谢任何帮助。

【问题讨论】:

    标签: python reactjs selenium canvas three.js


    【解决方案1】:

    为了解决我的问题,我必须这样做

    chain = ActionChains(page.driver).move_to_element_with_offset(sphere_order_panel, -1047, 398).click_and_hold() chain = chain.move_to_element_with_offset(sphere_order_panel, -1047, 398) chain.perform()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-06
      • 1970-01-01
      • 2021-05-20
      • 2018-12-08
      • 2012-05-08
      • 2020-02-04
      • 1970-01-01
      • 2016-01-08
      相关资源
      最近更新 更多