How to set Google Chrome in WebDriver

前端 未结 6 1916
庸人自扰
庸人自扰 2020-12-10 11:43

I am trying to set Chrome as my browser for testing with Web-Driver and set the chromedriver.exe file properly but I am still getting the following error:

or         


        
6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 11:59

    I'm using this since the begin and it always work. =)

    System.setProperty("webdriver.chrome.driver", "C:\\pathto\\my\\chromedriver.exe");
    WebDriver driver = new ChromeDriver();
    driver.get("http://www.google.com");
    

提交回复
热议问题