简体   繁体   English

机器人框架 Selenium Go 到浏览器弹出窗口阻止的关键字

[英]Robot Framework Selenium Go To Keyword blocked by browser popup

I am trying to use the Go To Keyword to navigate to a page.我正在尝试使用 Go To Keyword 导航到页面。 When you navigate to this page there is a browser popup that you need to use to log in.当您导航到此页面时,会出现一个浏览器弹出窗口,您需要使用它来登录。

The problem I am encountering is that this popup blocks Robot Framework from recognizing that the Go To Keyword has been completed.我遇到的问题是这个弹出窗口阻止机器人框架识别 Go To Keyword 已完成。 I have steps in my testcase to try to log in using this popup, but they never get executed because it just gets stuck on the Go To Keyword.我的测试用例中有步骤尝试使用此弹出窗口登录,但它们从未被执行,因为它只是卡在 Go To Keyword 上。

One workaround I tried is to put the Go To Keyword in a separate user created keyword with a timeout of 2 seconds, and then run that keyword in the testcase prefaced with the Run Keyword and continue on failure Keyword.我尝试的一种解决方法是将 Go To Keyword 放在一个单独的用户创建的关键字中,超时时间为 2 秒,然后在以 Run Keyword 开头的测试用例中运行该关键字并继续失败关键字。 But for some reason the popup blocks even this timeout from triggering and it's still stuck until I manually close the popup.但是由于某种原因,弹出窗口甚至会阻止触发此超时,并且在我手动关闭弹出窗口之前它仍然卡住。

Does anyone know a solution to this?有谁知道解决这个问题?

What this turned out to be was an issue with single-sign-on.事实证明这是单点登录的问题。 I had logged into the website environment with a fun account, when opening this page information was being retrieved from a different domain.我用一个有趣的帐户登录了网站环境,打开此页面时,正在从不同的域中检索信息。 Usually when you are logged in with your company account this information is used to acces the second domain.通常,当您使用公司帐户登录时,此信息用于访问第二个域。 But because my fun account does not exist in that domain this failed and the popup appeared.但是因为我的有趣帐户在该域中不存在,所以失败并且出现了弹出窗口。 Because the popup is a Windows element and not a Chrome element Selenium could not handle it.因为弹出窗口是 Windows 元素而不是 Chrome 元素 Selenium 无法处理它。

We talked about a possible solution and the best method seems to be to use the AutoItLibrary and use the RunAs Keyword to start Chrome as a user with the credentials for the second domain.我们讨论了一个可能的解决方案,最好的方法似乎是使用 AutoItLibrary 并使用 RunAs 关键字以具有第二个域凭据的用户身份启动 Chrome。 I did not fully flesh out this method because is has incompatibility issues with the way we want to execute our automatic test suite.我没有完全充实这个方法,因为它与我们想要执行我们的自动测试套件的方式不兼容。 But I wanted to put it here for reference for anyone else encountering this problem.但我想把它放在这里供遇到这个问题的任何人参考。

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

相关问题 机器人框架-Selenium2Library-使用Edge浏览器选择File关键字 - Robot Framework - Selenium2Library - Choose File keyword with Edge Browser 如何使用机器人框架 / selenium 在 iframe 中弹出 select - How to select a popup in an iframe with robot framework / selenium 机器人框架关闭浏览器弹出窗口 - Robot framework close browser popup window 选择文件和输入文本关键字在Robot Framework Selenium中不起作用 - Choose file and Input Text keyword not working in Robot Framework Selenium 如何在 Selenium Robot 框架中使用具有多个条件的“Exit For Loop IF”关键字 - How to use 'Exit For Loop IF' keyword with multiple condition in Selenium Robot framework 与Selenium对象模式设计的Robot框架关键字管理集成 - Integration with Robot framework's keyword management for Selenium Object Pattern Design Robot Framework selenium 无法打开 Edge 浏览器的浏览器 - Robot Framework selenium Unable to Open Browser for Edge Browser robot framework - 使用selenium grid启动远程浏览器时出错 - robot framework - Error when launching remote browser with selenium grid 机器人框架中的硒关键字 - Selenium keywords in Robot Framework Selenium机器人框架中的For循环 - For Loop in Selenium Robot Framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM