'Java selenium - timed out waiting for driver server to start
i need help , how to fix this bug , " timed out waiting for driver server to start "
i have tried many ways like changing google version and jdk version from 7 to 18 , change browser like firefox , microsoft Edge, google . I'm feeling helpless , i just want open a tab with selenium library
this is my code :
System.setProperty("webdriver.chrome.silentOutput", "true");
System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe");
WebDriver driver = new ChromeDriver(); // bug at here
driver.get("https://stackoverflow.com/");
what should i do to fix this ?
Solution 1:[1]
At line#2, you have chrome.exe, is this Chrome browser or Chromedriver?
System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe");
You should be passing ChromeDriver.exe's path. You can download ChromeDriver from this link - https://chromedriver.chromium.org/downloads.
System.setProperty("webdriver.chrome.driver","Chromedriver path");
Alternatively, you can try to use WebDriverManager library - https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager
WebDriverManager.chromedriver().setup();
Solution 2:[2]
Try use the following
System.setProperty("webdriver.chrome.driver","C:\\ProgramFiles\\Google\\Chrome\\Application\\chrome.exe");
// Instantiate a ChromeDriver class.
WebDriver driver = new ChromeDriver();
// Maximize the browser
driver.manage().window().maximize();
// Launch Website
driver.get("https://www.google.com/");
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ahamed Abdul Rahman |
Solution 2 | Software Tester at ExpandCart |