【问题标题】:How to handle print preview in Firefox using selenium robot framework如何使用 selenium 机器人框架在 Firefox 中处理打印预览
【发布时间】:2021-12-01 23:30:05
【问题描述】:

我正在尝试点击 Firefox 打印预览页面中的“取消”选项。 但不幸的是,我无法在右键单击取消选项时检查元素。 不过,我能够在 chrome 中进行检查,并且能够看到阴影根元素。 以下代码适用于 chrome,但不适用于 Firefox。

switch window    NEW

execute javascript    ${cancel_link}.click()

where ${cancel_link} is the shadow root element pointing to the "cancel option"

【问题讨论】:

  • shift+ctrl+C(从页面中选择一个元素)是否有效?
  • @MSH,在打印预览页面时不起作用。不过感谢您的建议。

标签: javascript python selenium firefox robotframework


【解决方案1】:

对于 selenium 中的上述场景,似乎没有直接的答案。 不得不使用“rpaframework”库输入“tab键”,最终在打印预览页面中达到所需的选项。

https://robocorp.com/docs/libraries/rpa-framework/rpa-desktop/keywords

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-20
    • 1970-01-01
    • 2018-02-10
    • 2018-12-20
    • 1970-01-01
    • 1970-01-01
    • 2019-10-05
    相关资源
    最近更新 更多