When using WebDriver to test on the Chrome browser, you need to download the driver corresponding to the native chrome browser from the URL http://chromedriver.storage.googleapis.com/index.html , the driver name is chromedriver;
The version of chromedriver needs to correspond to the native chrome browser in order to use it normally;
Step 1: Download the corresponding version of the chromedriver driver file. For the specific version, please refer to the correspondence table at the bottom of the article:
For example, the chrome browser version of this machine is: version 61.0.3163.100 (official version) (64-bit), and the corresponding chromedriver version is 2.33.
Step 2: Unzip the file after downloading, and then put it in the file path of the native chrome browser, such as:
C:\Program Files (x86)\Google\Chrome\Application
Step 3: After the operation, you can use the following code to directly call up the browser:
driver = new ChromeDriver();
Attached is the correspondence table between chromedriver and chrome:
chromedriver version | Supported Chrome Versions |
---|---|
v2.33 | v60-62 |
v2.32 | v59-61 |
v2.31 | v58-60 |
v2.30 | v58-60 |
v2.29 | v56-58 |
v2.28 | v55-57 |
v2.27 | v54-56 |
v2.26 | v53-55 |
v2.25 | v53-55 |
v2.24 | v52-54 |
v2.23 | v51-53 |
v2.22 | v49-52 |
v2.21 | v46-50 |
v2.20 | v43-48 |
v2.19 | v43-47 |
v2.18 | v43-46 |
v2.17 | v42-43 |
v2.13 | v42-45 |
v2.15 | v40-43 |
v2.14 | v39-42 |
v2.13 | v38-41 |
v2.12 | v36-40 |
v2.11 | v36-40 |
v2.10 | v33-36 |
v2.9 | v31-34 |
v2.8 | v30-33 |
v2.7 | v30-33 |
v2.6 | v29-32 |
v2.5 | v29-32 |
v2.4 | v29-32 |