首页 > 解决方案 > 在 Robotframework 中进行 AutoIT Widows 身份验证后,焦点未回到浏览器

问题描述

我试图在 Robotframework 中自动化的一个条件:

  1. 转到 URL(库 Selenium2Library)
  2. 使用 Windows 身份验证登录(库 AutoItLibrary)
  3. 焦点回到浏览器

RobotFramework 中的测试用例:

打开浏览器:

*** Settings ***
Library  Selenium2Library

*** Variables ***


*** Keywords ***
Begin Web Test
    open browser  ${URL}  ${BROWSER}

End Web Test
    close all browsers

登录并创建IO:

*** Settings ***
Library  Selenium2Library
Library  AutoItLibrary

*** Variables ***


*** Keywords ***
Login and createIO
  sleep  3s
  WaitForActiveWindow  WindowTitle=Authentication Required
  Send  ${Subscriptionsusername}
  Send  {TAB}
  Send  ${Subscriptionspassword}
  Send  {ENTER}
  Capture Page Screenshot


  Click Link  xpath=//*[@class='tss-main-nav']/nav/ul/li[3]

我遇到的问题:

  #Select Window  URL=${URL}
  #Select Window  NEW
  #Select Window  MAIN
  #Wait Until Element Is Visible  xpath=//*[@class='tss-main-nav']/nav/ul/li[3]
  #Set focus  Campaign Start:

在 Robotframework 上运行测试时出错:

Should be able to CreateIO :: Testing Apollo website                  | FAIL |
WebDriverException: Message: [Exception... "Component not initialized"  nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"  location: "JS frame :: chrome://marionette/content/modal.js :: get window :: line 143"  data: n
o]

将不胜感激任何解决此问题的建议...

标签: seleniumrobotframeworkautoitselenium2library

解决方案


推荐阅读