【问题标题】:How to enter value in browser alert in RobotFramework [duplicate]如何在 RobotFramework 的浏览器警报中输入值 [重复]
【发布时间】:2020-07-02 14:23:49
【问题描述】:
Input Text Into Alert    admin    action=username

我想知道如何输入用户名和密码。我也找不到为此的xpath。

【问题讨论】:

  • 我不久前回答了this 的类似问题。我们得出结论,这是不可能的。如果您找到解决方案,请告诉我。
  • 它不是警报框,而是 HTTP 基本身份验证弹出窗口,您不能单独使用 selenium 来自动化它。您可以使用 AutoIt 通过机器人框架遍历该弹出窗口。这里还讨论了另一种方法。 serverfault.com/questions/371907/…

标签: python selenium selenium-webdriver robotframework


【解决方案1】:

您可以通过将身份验证参数放入应用程序 URL 来避免此弹出窗口,

示例:https://username:password@application_url

【讨论】:

  • 唯一一致的解决方法是将 AutoItLibrary 与自定义 firefox 配置文件一起使用。 1. First create your own firefox profile (google how to create). 2. Then launch firefox with the new profile created, and launch the <url> you want to test. 3. When the authorization alert come out, manually input the username & password and click enter or proceed. This will save the username & password to this browser cache/cookie.. 4. Next, on RIDE -> Open Browser <url> firefox ff_profile_dir=${your_new_profile_dir} Sleep 2s AutoItLibrary.Send {ENTER}
猜你喜欢
  • 1970-01-01
  • 2020-09-01
  • 2023-02-05
  • 2015-09-18
  • 2018-06-08
  • 2014-07-15
  • 1970-01-01
  • 2017-12-26
  • 1970-01-01
相关资源
最近更新 更多