Selenium3 automated test [6] browser driver installation (Chrome)

Some friends, in the actual application process, prefer to use the Google browser Chrome. How does Selenium work with Chrome?

1. Download chromedriver.exe

The chromedriver.exe file is the driver file that calls chrome, so the version of the file must be compatible with the chrome version.
chromedriver.exe can be downloaded from the following website:

When the author's Chrome browser is upgraded, the version of Chrome is 75.0.3770.142, as shown in the figure. The version of chromedriver.exe downloaded is 75.0.3770.140, which corresponds to the chrome browser version (only the minor version number is different from .140), as shown in the figure.
Selenium3 automated test [6] browser driver installation (Chrome)
chromedriver.exe from 70, you can find the version corresponding to the chrome version to download. This avoids the entanglement of 2.7 and 2.8 when selecting the chromedriver version as shown in the figure, and it is no longer necessary to query how the chrome version (such as 68.0.3440.106) and chromedriver.exe (2.7 or 2.8) match.
Selenium3 automated test [6] browser driver installation (Chrome)
Copy the downloaded chromedriver.exe (2.37) to the chrome installation directory (generally, the installation path of chrome is as follows, C:\Program Files (x86)\Google\Chrome\Application), as shown in the figure.
Selenium3 automated test [6] browser driver installation (Chrome)
Set system environment variables, add the path of chrome to Path, and the steps for adding environment variables are shown in the figure.
Selenium3 automated test [6] browser driver installation (Chrome)

2. Verify Selenium

Open the IDE (such as PyCharm) to write code, as shown in the figure. Then run, you can see that the Chrome browser is successfully called and the bing homepage is opened.
Selenium3 automated test [6] browser driver installation (Chrome)

  1. The version correspondence between Google browser and chromedriver The
    following is the version correspondence between some Google (chrome) browsers and chromedriver, for reference:
    Selenium3 automated test [6] browser driver installation (Chrome)

Guess you like

Origin blog.51cto.com/starpoint/2545742