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

  • 转到URL(Library Selenium2Library)

  • 使用Windows身份验证登录(Library AutoItLibrary)

  • 重点关注浏览器

RobotFramework中的TestCase:

打开浏览器:

*** Settings ***
Library  Selenium2Library

*** Variables ***


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

End Web Test
    close all browsers

登录和创建:

*** 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]

非常感谢任何解决这个问题的建议......