简体   繁体   English

如何使用 selenium 机器人框架在 Firefox 中处理打印预览

[英]How to handle print preview in Firefox using selenium robot framework

I am trying to tap on the 'cancel' option in the print preview page in Firefox.我正在尝试点击 Firefox 打印预览页面中的“取消”选项。 But unfortunately, I am not able to inspect the element on right clicking on the cancel option.但不幸的是,我无法通过右键单击取消选项来检查元素。 I was able to inspect in chrome though and was able to see the shadow root element.不过,我能够在 chrome 中进行检查,并且能够看到阴影根元素。 The following code worked perfectly for chrome, but not working in firefox.以下代码适用于 chrome,但不适用于 Firefox。

switch window    NEW

execute javascript    ${cancel_link}.click()

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

Seems like there is no direct answer for the above scenario in selenium.硒中的上述情况似乎没有直接答案。 Had to use "rpaframework" library to enter the "tab key" and finally reach the desired option in the print preview page.不得不使用“rpaframework”库来输入“tab键”,最后在打印预览页面中到达所需的选项。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在硒机器人框架脚本中使用JavaScript单击元素? - How to click an element using javascript in selenium robot framework script? 如何在硒机器人框架中使用JavaScript接受警报 - How to accept alert using javascript in selenium robot framework 使用 Selenium2Library 通过机器人框架处理 mozilla firefox 下载框 - Handling mozilla firefox download box through robot framework using Selenium2Library 如何使用Robot Framework处理提示框? - How to handle prompt box with Robot Framework? 如何使用 Java 使用 Selenium WebDriver 处理 Firefox 中的身份验证弹出窗口 - How to handle authentication popup in Firefox with Selenium WebDriver using Java 如何使用 Python、JavaScript 或 Robot Framework 和 Selenium 使用部分标题文本导航到新的浏览器窗口 - How to navigate to new browser window using partial title text using either Python, or JavaScript or Robot Framework and Selenium 如何使用Robot Framework选择此单选按钮? - How to select this radio button using Robot Framework? 直接查看打印预览 Firefox - Direct viewing to Print Preview Firefox 在 Firefox 中打印 iframe 时如何打开打印预览对话框? - How to open the print preview dialog when printing an iframe in Firefox? 如何使用eclipse在打印前进行预览? - How to preview before print using eclipse?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM