Selenium3+python Automation (3.7 version)-CHROME67 environment construction

Source: Internet
Author: User

Objective

Currently the selenium version has been upgraded to 3.0, and most of the online tutorials are based on 2.0, so it is important to understand the version number before learning. This series is still based on SELENIUM3.

I. Introduction of Selenium

Selenium is a common framework for testing the WEB application user interface (UI). It is an extremely powerful tool for running end-to-end functional testing. You can write tests in multiple programming languages, and Selenium can perform these tests in one or more browsers.

The development of selenium has undergone three stages, the first stage, namely the selenium1 era, before we run the selenium1.0 program, we have to start the Selenium server side (selenium remote Control), we are referred to as RC. RC mainly consists of three departments

Points: launcher,http Proxy,selenium core. Where selenium core is embedded in the browser page by Selenium server, selenium core is a bunch of JavaScript functions that are called to implement various actions on the browser.

Obviously cumbersome, this is not the best automated solution, so later with the Webdriver.

Selenium2 's era incorporates the Webdriver, which is what we usually call selenium,selenium2 is the default support for Firefox browser, which is very convenient. Of course also support other more browsers, IE and Chrome browser need to download the driver package, and add to the environment variable

SELENIUM3 is around October 2016 out, and now the default installation is SELENIUM3, selenium3 on the basis of selenium2 made some adjustments, the most obvious difference is SELENIUM2 support for Firefox supports up to 46 and below versions only. SELENIUM3 can support more than 47 versions, but you need to download the Geckodriver.exe driver and add it to the environment variable path.

The next content is dominated by selenium3

Environment Combination **************************

Best Environment for Beginners: python2.7+selenium2+firefox46 The following versions

Like beginning something new environment: python3.7+selenium3+firefox47 or above version

*********************************************

Small series of environment python3.7+selenium3+chrome67 version:

Windows7 64-bit

Python 3.7.0

Selenium 3.0

Chrome 67 (Note: So to install the ChromedriverV2.38 version)

Second, Python installation

1. Small computer operating system: Win7 64-bit system

2. Download the Python installation package, version 3.7

3. Download Chrome 67

Python official website: https://www.python.org/57

3.Python installation, double-click the Fool installation (do not install on the C-drive)

Third, environment variables

1. After the installation is complete, look at this directory D:\python\Scripts, there are no pip.exe and easy_install.exe (generally, there is no need to reinstall once)

2. Add D:\python and D:\python\Scripts to the environment variable path

Iv. installation of Selenium

1. Open cmd Window input: Pip (indicates normal if content is displayed)

2.cmd Input Command installation selenium:pip install Selenium

(Note: The first install must see progress 100% complete, if the halfway failed, re-enter the instructions to install, until you see 100% completed)

V. Verification of Selenium

How do you know selenium is properly installed?

1. Make sure the computer is installed on theChromeBrowser and correspondingChromeBrowser version of the driverChromeDriverunzip the downloaded driver package Chromedriver.exe and put it in the application directory in the local Google Chrome installation directory (my installation path is: C:\Users\Administrator\AppData\Local\ Google\chrome\application, depending on the path you installed, then configure the environment variable to add Chromedriver.exe path to Path。ChromeDriverhttp://chromedriver.storage.googleapis.com/index.html

2.cmd window Enter the following command

>python

>from Selenium Import Webdriver

>webdriver. Chrome ()

3. If you can start the browser, the environment installation OK.

Six,Chrome Browser version of the driver Chromedriver and Google Browser version of the corresponding table:

Chromedriver version supported versions of Chrome
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

Selenium3+python Automation (3.7 version)-CHROME67 environment construction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.