Any new leads on this issue? I recently switched PC and now facing the same problem so many users faced. It was usually solved with downloading the latest chromedriver.exe or by moving the chrome.exe under the appdata folder structure but now I have done all the basic steps mentioned in various forums and answers but still getting the org.openqa.selenium.WebDriverException: unknown error: Failed to create Chrome process.
Tried --no-sandbox option, tried checking chrome.exe to have the run as admin unchecked. Nothing seems to be working.
My old pc had terrible config of all of the above and never faced an issue (magic). Now I cannot get it to work.
The exception is produced from this line: driver = new ChromeDriver(options);
and the code giving the options to chrome is:
System.setProperty("webdriver.chrome.driver",
System.getProperty("user.dir") + "/src/main/resources/drivers/chromedriver.exe");
final String regex = "^\\D*\\$$";
final Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE);
final Matcher matcher = pattern.matcher(System.getProperty("user.name"));
boolean isNotHuman = matcher.matches();
ChromeOptions options = new ChromeOptions();
if (isNotHuman){
log.info("Chrome starting headless - isNotHuman: " + isNotHuman + " process run by " +System.getProperty("user.name")) ;
options.addArguments("--headless");
options.addArguments("--window-size=1980,1080");
else {
log.info("Chrome starting maximized - isNotHuman: " + isNotHuman + " process run by " +System.getProperty("user.name"));
//options.addArguments("--no-sandbox");
options.addArguments("--start-maximized");
}