Bypassing Authentications
Learn how to bypass authentications in Firefox browser using Selenium.
Bypassing basic authentication by embedding username and password in URL
Authentication dialogs (given below) can be troublesome for automated testing.
One simple way to get past basic or NTLM authentication dialogs is by prefixing username and password in the URL as:
driver = new webdriver.Builder().forBrowser('firefox').build();
driver.get("http://tony:password@itest2.com/svn-demo/")
// got in, click a link
driver.findElement(By.linkText("tony/")).click();