How do I install ChromeDriver on Windows 10 and run Selenium tests with Chrome?

前端 未结 3 1510
無奈伤痛
無奈伤痛 2021-02-02 12:15

We have an Ubuntu server which we use for running Selenium tests with Chrome and Firefox (I installed ChromeDriver) and I also want to run the tests locally on my Windows 10 com

3条回答
  •  [愿得一人]
    2021-02-02 12:49

    Let me brief out the requirements first. You need to download the chrome web driver zip from here. https://chromedriver.storage.googleapis.com/index.html?path=2.33/

    Extract the file and store it in a desired location.

    Create a new project in Eclipse and include the following code in your class.

    System.setProperty("webdriver.chrome.driver", "C:\\temp\\chromedriver.exe");
    WebDriver driver = new ChromeDriver();
    

    Explanation : System.setProperty(key,value):

    Key is default and same for all the systems, value is the location of your chromedriver extract file.

提交回复
热议问题