Not exactly as
- Chrome not reachable Selenium WebDriver error
- selenium.WebDriverException: chrome not reachable
- selenium.WebDriverException: chrome not reachable
I'm following Running Selenium Tests with ChromeDriver on Linux
and tried to run its demo, included below:
import java.io.File;
import java.io.IOException;
import java.net.*;
import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriverService;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class ChromeRemoteDriver {
public static void main(String []args) throws MalformedURLException{
new DesiredCapabilities();
URL serverurl = new URL("http://localhost:9515");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
WebDriver driver = new RemoteWebDriver(serverurl,capabilities);
driver.get("http://www.google.com");
WebElement searchEdit = driver.findElement(By.name("q"));
searchEdit.sendKeys("Selftechy on google");
searchEdit.submit();
}
}
after I've started my local ChromeDriver:
/usr/local/bin/chromedriver &
[1] 27777
Starting ChromeDriver 101.0.4951.41 (93c720db8323b3ec10d056025ab95c23a31997c9-refs/branch-heads/4951@{#904}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
But when running the above demo, I'm getting:
May 13, 2022 11:51:26 PM org.openqa.selenium.remote.DesiredCapabilities chrome
Exception in thread "main" org.openqa.selenium.WebDriverException: chrome not reachable
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
Why is that and how to fix?