Using Selenium+python+webdriver to complete the UI function automation, often encounter browser version and driver version mismatch and cause error, the following selenium and Chrome browser and driver version matching to do a summary.
When you use Webdriver to test on a Chrome browser, you need to download the driver that corresponds to the native Chrome browser, and the version of the driver named Chromedriver;chromedriver needs to correspond to the native Chrome browser. Can be used normally, the following steps are as follows:
The first step: Download the corresponding version of the Chromedriver driver file, the specific version of the corresponding relationship table at the bottom of the article: if the browser version of this machine is: Version 61.0.3163.100 (official version) (64-bit), The corresponding Chromedriver version is 2.33.
The second step: Extract the files after downloading, and then put in the native Chrome file path, such as: C:\Program files (x86) \google\chrome\application
Step three: After you are done, you can use the following code to directly adjust the browser: Driver =new chromedriver ()
Note:
1.chrome History Explorer: https://www.chromedownloads.net/
2.chromedriver:http://chromedriver.storage.googleapis.com/index.html
3. Environment configuration:
Import OS #调用系统文件需要应用此包中的方法
Chromedriver = ' C:\Program Files (x86) \google\chrome\application\chromedriver ' #指定chromedriver storage path
os.environ["Webdriver.chrome.driver"]=chromedriver #配置环境
4.selenium Chromedriver and Chrome version mapping table:
Chromedriver version |
supported by Chrome version |
v2.40 |
v66-68 |
v2.39 |
v66-68 |
v2.38 |
v65-67 |
v2.37 |
v64-66 |
v2.36 |
V63-65 |
v2.35 |
V62-64 |
v2.34 |
v61-63 |
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 |
Selenium match with Chrome browser and driver version