Based on the Selenium3+python3.4+chrome (57.8 version) automated test environment setup

Source: Internet
Author: User

Automated test Environment Deployment steps:

1. Download the installation Python34 and configure the Python environment variables (add Python installation path in path) after download

python:https://www.python.org/

2. Download the third-party installation tool to install Python pip, switch to cmd inside the extracted pip directory, run the Python setup.py install command installation PIP, after installation, enter PIP in the command line to verify whether the installation is successful, If successful, the relevant commands for the PIP are listed, whether the installation fails; the environment variable of the last configuration Pip is a path that is obtained when installing PIP in path: C:\Python34\Lib\site-packages\ Pip-9.0.1-py3.4.egg and C:\Python34\Scripts can do it.

Pip:https://pypi.python.org/pypi/pip

3. Install Selenium:pip install-u (uppercase) Selenium (the latest version selenium3 is installed by default)

4. If you choose Google Browser as the test platform, you will need to install the corresponding driver (Firefox does not install the driver)

Step: First download Install the latest version of Google Chrome

Two. Download the latest version of the Chromedriver.exe driver

Three. Download Drive address: http://blog.csdn.net/huilan_same/article/details/52615123

Key steps: Four. Unzip the downloaded driver package Chromedriver.exe and put it in the application directory under the Google Chrome installation directory (my installation path is: C:\Program files\google\chrome\

Application, depending on the path you installed, then configure the environment variable to add Chromedriver.exe path to Path

5. From Selenium import Webdriver #导入selenium框架包中的webdriver模块

b = Webdriver. Chrome (); #调用webdriver模块中Chrome方法自动打开谷歌浏览器

b Get ("url") #打开你要测试的网址 (Judge Url:b.title or "title" in B.title both ways)

The Webdriver module provides a rich array of APIs for us to invoke, manipulate various elements on the Web page and simulate user actions

All of the above steps seriously, estimate the environment will be able to build a good

Based on the Selenium3+python3.4+chrome (57.8 version) automated test environment setup

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.