Introduction
- Selenium is an automated testing tool that we can use it drive the browser perform specific actions, such as clicking, drop-down and other operations
- ChromeDriver Chrome is a browser driver for driving the Google Chrome complete the appropriate action
Selenium installation
Related Links
Installation Procedure (Windows / Linux Universal)
- The installation command:
pip install selenium
- Verify that the installation was successful
- Python interactive mode to enter the command line:
python
- Selenium import library:
import selenium
- If no error is proved that the installation was successful, otherwise fail
ChromeDriver installation
Related Links
installation steps
- Download Chrome browser version and operating system corresponding to the type of ChromeDriver archive (or may not work)
- Extracting archive ChromeDriver
- The ChromeDriver executable file to configure the environment variables
- Windows
- Recommendations directly to the chromedriver.exe file onto a Python Script directory
- May individually be path configuration environment variable, right "this computer" -> "Properties" -> "Advanced System Settings" -> "Advanced" -> "Environment variables", the "environment variable" a "Path" in Tap New to enter chromedriver.exe path to the file, and click OK
- Linux
- The executable file can move to the / usr / bin directory:
sudo mv <chromedriver> /usr/bin
- May be separately configured to route the PATH $ (e.g. in the / usr / local under chromedriver / chromedriver directory)
- Excuting an order:
export PATH="$PATH:/usr/local/chromedriver"
- Excuting an order:
source ~/.profile
- Verify that the installation was successful (Windows / Linux Universal)
- Execute commands directly at the command line:
chromedriver
- If no error is proved installed and configured properly, otherwise fail
If successful test configuration (Windows / Linux Universal)
- Python interactive mode to enter the command line:
python
- Execute the code:
from selenium import webdriver
browser = webdriver.Chrome()
- If you bring up a blank Chrome browser, the configuration was successful
- If you flash back pop-up browser, then ChromeDriver version and the version is not compatible with Chrome