Basic / NTLM popup is a browser dialog. WebDriver (Selenium 2.0) cannot interact with such dialog boxes. The reason for this is that WebDriver aims only to simulate user interactions with websites, and browser windows are not currently in this area. JavaScript dialogs are part of the website, so WebDriver can handle them. In Selenium 1.0, you can perform basic authentication.
So how to solve this problem? 1) Authentication via URL http://username: password@website.com 2) Use a browser plugin that will handle Basic / NTLM authentication. 3) Use a local proxy server that will change the request header and pass username / password. 4) Use a robot, for example, AutoIt or some Java library.
Option 1: The simplest and has the least impact on the system / test. Option 2: has a high browser effect as download plugins. Each browser also uses its own plugin, and it is possible that the required plugin for a particular browser is not available. Option 3: works well with HTTP, but HTTPS requires special certificates, so it is not always an option. Not so much affects both the system and the test. Option 4: Mimic keyboard keys, this is a solution, but prone to errors. It only works when the dialog box has focus, and it is possible that this is not always the case.
source share