Unable to Launch Google Chrome using default/custom profile in Selenium WebDriver that undergo http basic authentication Unable to Launch Google Chrome using default/custom profile in Selenium WebDriver that undergo http basic authentication selenium selenium

Unable to Launch Google Chrome using default/custom profile in Selenium WebDriver that undergo http basic authentication


System.setProperty("webdriver.chrome.driver","C:\\chromedriver.exe");ChromeOptions options = new ChromeOptions();options.addArguments("user-data-dir=C:/Users/user_name/AppData/Local/Google/Chrome/User Data");options.addArguments("--start-maximized");driver = new ChromeDriver(options);

If you face such error:

org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited normally

Then try to create a new Chrome profile and execute tests.

  1. Copy the folder, 'User Data'
  2. Paste & Rename the folder on the same location. e.g., New User
  3. Now, locate the directory, C:/Users/user_name/AppData/Local/Google/Chrome/New User
  4. If you like to test the profile, then bookmark some of the sites & observe them on next run.


1 Set the chromedriver property in starting the node. My approach:

java -jar selenium-server-standalone-2.31.0.jar -role node -hub http://localhost:4444/grid/register -maxSession 15 -browser browserName="chrome",version=ANY,platform=WINDOWS,maxInstances=15 -Dwebdriver.chrome.driver=lib\chromedriver.exe

2 Inside the code my approach:

capabilities = DesiredCapabilities.chrome();capabilities.setCapability("chrome.switches", Arrays.asList("--start-maximized"));driver = new RemoteWebDriver(new URL("http://127.0.0.1:4444/wd/hub"), capabilities);

3 loading the HTTP basic auth page:

String username = "Pavel";String password = "Omgtoosecrettotellyou";driver.get("http://" + username + ":" + password + "@" +"your-site.com");