Not able to open any link on chrome

133 views
Skip to first unread message

Siddharth Benadi

unread,
Apr 28, 2025, 12:57:22 PMApr 28
to Selenium Users
My Code: 

package web;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Automation {

public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.flipkart.com/");

}

}

Expected result: flipcart site should open
Actual Result: Only chrome window is opened

Console: 
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Host info: host: 'DESKTOP-8HFM02L', ip: '192.168.1.9'
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:563)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:245)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:174)
at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:110)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:51)
at web.Automation.main(Automation.java:10)
Caused by: org.openqa.selenium.WebDriverException: Driver server process died prematurely, exit value: 0
Build info: version: '4.31.0', revision: '4ae8fc9f8a'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '16.0.2'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:248)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:117)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:545)
... 7 more





Sabyasachi Mohanty

unread,
May 1, 2025, 2:19:09 AMMay 1
to seleniu...@googlegroups.com
Hi,

try this code using chrome option if you are using maven projects.


public class Automation {

public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");

                ChromeOptions co= new ChromeOptions():
                 co.seBroswerVersion(116); //take any version of your choice
WebDriver driver = new ChromeDriver(co);
driver.get("https://www.flipkart.com/");


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/selenium-users/53057270-4c99-4f2e-a52e-5194a2804c16n%40googlegroups.com.

yamini sai priya Ch

unread,
May 8, 2025, 8:23:26 AMMay 8
to seleniu...@googlegroups.com

Suriya Elamparithy

unread,
Jul 28, 2025, 7:20:40 AMJul 28
to Selenium Users
Update this line:
System.setProperty("webdriver.chrome.driver", "C:\\Path\\To\\chromedriver.exe");

  Use WebDriverManager to automatically manage drivers:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;


public class Automation {
    public static void main(String[] args) {
        WebDriverManager.chromedriver().setup(); // Automatically downloads correct chromedriver

Corey Goldberg

unread,
Jul 28, 2025, 7:31:48 AMJul 28
to seleniu...@googlegroups.com
WebDriverManager is usually never needed. Selenium Manager is built-in:


Reply all
Reply to author
Forward
0 new messages