After I am closing Authentication Required popup properly (with Robot class), WebDriver (GeckoDriver / FirefoxDriver) stops identifying objects and throwing TargetInvokeException.
Env Details:
Web Driver - geckodriver.exe - Version 0.20.1
OS - Windows 10
Language - Java
Application - Web application
Browser - Firefox (using the above geckodriver)
Issue:
1. With driver, Initially I enter the URL.
2. Immediately an "Authentication Required" popup will display (please see the attachment at the bottom ).
3. I fill the details with Robot class, and closing the popup.
4. Next step is, driver needs to click on a Web Element which is a button.
5. At this step, while debugging I am getting the error below ( I debugged Invoker.class):
Invoker class >> invokeMethod >> InvocationTargetException
---- basically the issue is with WebDriver itself. It stops identifying any elements.
---- I tried with Page Object and without Page Objects.
---- I tried "switchtowindow()" (windowhandle), and "switchtodefaultcontent()" as well.
6. If the "Authentication Required" popup is not shown, web driver does not have any issue for identifying Web elements.
But in the TestNG Results Console the issue description is different from the above . So, I believe, we can ignore this issue, as this may not be the real cause), the error below was shown instead:
org.openqa.selenium.NoAlertPresentException: No modal dialog is currently open
Driver info: org.openqa.selenium.firefox.FirefoxDriver