Selenium Chrome Browser org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start

前端 未结 2 1634
旧时难觅i
旧时难觅i 2020-12-04 03:45
public class Dem {
    public static void main(String[] args) throws InterruptedException {
    WebDriver driver;
    String url = \"https://www.google.com\";
    Sy         


        
相关标签:
2条回答
  • 2020-12-04 04:23

    Debugging Steps

    It may be either of the two below issue.

    1. Chrome Driver not started for some reason:

    Run the chrome driver in terminal maually

    C:\Users\Jim> C:\Users\Jim\Downloads\chromedriver_win32\chromedriver.exe

    Now we have to get the following message denoting server started sucessfully.

    If you are not getting above message and your server is not started, then check what is error you are getting and respond accorsingly? May downloaded corrupted binary, the download it again.

    2. Unable to access the chrome driver with hostname as localhost

    If you able to start chromedriver sucessfully as in above steps, now try to access the below url with respective port. http://localhost:{port}/status

    For e.g., in above message, the server started on port 9515. Access the url in browser, http://localhost:9515/status

    You should get above message indicating server is accessible with hostname as localhost

    If your are not able access, then open C:\Windows\System32\drivers\etc\hosts in editor with administrator privilege and check localhost DNS is mapped to 127.0.0.1

    0 讨论(0)
  • 2020-12-04 04:27
    public class Demo {
        public static void main(String[] args) {
            System.setProperty("webdriver.chrome.driver","\PATH OF THE DRIVER");
            WebDriver driver = new Chrome driver();
            String url = "https://www.google.com";
            driver.get(url);
            Thread.sleep(2000);
            driver.close();
        }
    }
    
    0 讨论(0)
提交回复
热议问题