【发布时间】: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