0

Hell0, I am new to Selenium. I have installed selenium and was writing my first code. I am getting the following error


Starting ChromeDriver 89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294}) on port 46362 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. Exception in thread "main" org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start. Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48' System info: host: 'DESKTOP-LCJO8BB', ip: '192.168.1.8', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.2' Driver info: driver.version: ChromeDriver at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:202) at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:188) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:181) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:168) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:123) at seleniumPackage.SeleniumClass.main(SeleniumClass.java:12) Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:46362/status] to be available after 20005 ms at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100) at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:197) ... 9 more Caused by: java.util.concurrent.TimeoutException at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:204) at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:156) at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75) ... 10 more

My Code



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

public class SeleniumClass {

    public static void main(String[] args) {
        System.setProperty("webdriver.chrome.driver", "F:\\Selenium\\Jars and Drivers\\Drivers\\Chrome\\chromedriver_win32\\chromedriver.exe");
        //System.setProperty("webdriver.gecko.driver", "F:/Selenium/Jars and Drivers/Drivers/Firefox/geckodriver-v0.29.0-win64/geckodriver.exe");
        WebDriver driver = new ChromeDriver();
        //WebDriver driver = new FirefoxDriver();
        driver.get("http://www.google.com");
    }

}````

Could you please assist here.

Thanks,
Jisha

2 Answers 2

0
code is correct. added code for time out exception. implicitlyWait added
public class SeleniumClass {

    public static void main(String[] args) {
        System.setProperty("webdriver.chrome.driver", "C:\\\\Drivers\\\\chromedriver.exe");
        //System.setProperty("webdriver.gecko.driver", "F:/Selenium/Jars and Drivers/Drivers/Firefox/geckodriver-v0.29.0-win64/geckodriver.exe");
        WebDriver driver = new ChromeDriver();
        //WebDriver driver = new FirefoxDriver();
        driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
        driver.get("http://www.google.com");
    }

}
Sign up to request clarification or add additional context in comments.

1 Comment

Hello @user3636689, I tried to add impicit wait too. Yet I am getting the same error. additional information, JDK version - jdk-15.0.2_windows-x64_bin, selenium - selenium-java-3.141.59
0

https://sites.google.com/a/chromium.org/chromedriver/

try - I downloaded latest stable version and it worked.

1 Comment

It worked for me as well. The issue is resolved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.