Setting Chrome Browser from Environmental Variables




Setting the property in Environment Variables to Open Browser in Selenium. 

Navigate to Control Panel\System and Security\System\Advanced System Settings\Advance\Environment variables


  1. Add the TEMP as below
  2. Select the Path System variable and click on Edit button. Now move to the end of the Variable value field, then add a semi colon (;) 
  3. Add the ChromeDriver’s folder location
  4. Click Apply and OK




5.Add the script as below

ChromeDriver driver = new ChromeDriver();
driver.get("http://www.google.com");

6.Run the script,observe the script will execute änd open Chrome Browser with out "System.setProperty("webdriver.chrome.driver", "C:\\Users\\prasanthi.podila\\eclipse-workspace\\FrameworkFile\\ExternalFiles\\chromedriver_win32\\chromedriver.exe"); command