5

A condition that I am trying to automate in Robotframework:

  1. Go to URL(Library Selenium2Library)
  2. Login with windows authentication (Library AutoItLibrary)
  3. focus back to the browser

TestCase in RobotFramework:

Open browser:

*** Settings ***
Library  Selenium2Library

*** Variables ***


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

End Web Test
    close all browsers

Login and createIO:

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

The problem I have:

  • After this authentication, the user gets access to the browser but the next test where the link is clicked does not work. It's like the focus is not on the browser. I used all these after the authentication:

  #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:

Error when I run the test on 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]

Would appreciate any suggestions to solve this...

JINOPPIE
  • 51
  • 2
  • I've never done this, thus shooting in the dark, but - what if you add a short sleep (a few seconds) after sending the enter? Once you've filled in the authentication, it takes some (small amount of) time for the data to be sent to the server, then for it to process it, and send back response data to the browser - perhaps, selenium tries to interact with the page too soon? – Todor Minakov Jul 19 '18 at 08:34
  • I did add a sleep 3s and this time came back with a different error: "NoAlertPresentException: Message: No modal dialog is currently open " – JINOPPIE Jul 19 '18 at 09:19
  • Are you trying to click an alert box in your follow-up RF code? It doesn't looks so by your sample, though I have to ask. If not, [see this SO question](https://stackoverflow.com/questions/17576148/webdriver-error-no-alert-is-present-after-unexpectedalertpresentexception-is), it may help you further. – Todor Minakov Jul 19 '18 at 10:02
  • After the authentication, the browser has a button/link (Create IO). From there it goes to a form. – JINOPPIE Jul 19 '18 at 10:19

0 Answers0