0

I am having trouble to login using selenium windows Internet Explorer. I am attaching the popup dialog

enter image description here

I need to use IE. I have tried

  1. driver.get('https://username:password@xyz/Secure/Local/console/mc_index.html') and it does not work in IE. So I need to handle this popup dialog box.
  2. with above code chrome works but I have to use IE (version ~ 11). So please avoid any other browser question.

Here is the code I am using

driver.get("https://xyz/Secure/Local/console/mc_index.html") 

driver.find_element_by_id('moreInfoContainer').click()
driver.implicitly_wait(5)
parent_h = driver.current_window_handle
# click on the link that opens a new window
print(" before Popup")
driver.find_element_by_id("overridelink").click()
print("After popup")

It only prints up-to following 2 line:

Starting Opening the Automation

before Popup

After popup dialog it does not execute next code. So regardless what I do after the line "driver.find_element_by_id("overridelink").click()" selenium does nothing. It does not even print a simple "hello" after that line.

After the popup dialog it does not return the control to selenium. It prints following line after i hit the "cancel" button.

After popup

The issue here is selenium never get the control back after popup dialog shows.

Rana
  • 389
  • 5
  • 17
  • current_window_handle returns a sort of UID for the window the driver is currently running in. If there is another window, you need to get that handle, and switch the driver to it. Exceptions are probably thrown and ignored? – pcalkins Nov 08 '19 at 20:25
  • @pcalkins Please provide an example how to do this. – Rana Nov 08 '19 at 20:35
  • not familiar with Python, but see this answer: https://stackoverflow.com/questions/10629815/how-to-switch-to-new-window-in-selenium-for-python But don't rely on the array to be structured the same way across browsers. Get the main handle, and then loop through list of handles after the action that generates the new window to find the new handle.. I think the 3rd or so answer there. – pcalkins Nov 08 '19 at 20:38
  • @pcalkins it does not execute any code after it shows the popup. Not even simple print. – Rana Nov 08 '19 at 20:54
  • ahh, that's not a new window there. The browser is waiting for login.... possibly to the domain. This may require manual intervention before any more driver calls... try/catch your driver calls to see if an "unhandled prompt" exception is thrown. What sort of authorization does the site use? – pcalkins Nov 08 '19 at 21:12
  • @PCALKINS not sure what you mean by what sort of authorization – Rana Nov 11 '19 at 16:20
  • how does the site authenticate users? – pcalkins Nov 11 '19 at 22:43
  • @ PCALKINS java servlet – Rana Nov 11 '19 at 22:46
  • ...and how does the servlet authenticate users? Does it use domain user to validate? If so, your machine is not in a state where it is an authorized domain user and you should add it. – pcalkins Nov 11 '19 at 22:53

0 Answers0