I'm new to selenium and stuck on launching URL in chrome.
selenium.chrome.ChromeDriver; here's code snip
import java.time.Duration;
import org.openqa.selenium.WebDriver;
import org.openqa.
import io.github.bonigarcia.wdm.WebDriverManager;
public class GoogleTest {
public static void main(String[] args) {
WebDriverManager.chromedriver().clearDriverCache().setup();
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
driver.manage().window().maximize();
driver.get("https://google.com");
}
}
I'm seeing following error
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: session not created: Chrome failed to start: exited normally.
(session not created: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Chrome browser is managed by my organization. I tried deleting policies from registry editor but it could not solve this issue. Policies keeps re appearing even after setting values to 0 . If anyone aware about this issue , please help.
WebDriver uses ChromeDriver so you need to download it
https://googlechromelabs.github.io/chrome-for-testing/
I would also recommend doing all WebDriver work inside the NUnit framework