SELENIUM+IDEA+MAVEN+TESTNG Environment Construction

Source: Internet
Author: User
Tags testng

First install the Java environment.

1. Download and install Jdk1.7 or Jdk1.8

Http://www.oracle.com/technetwork/java/javase/downloads/index.html

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2. Create a new environment variable java_home, point to the JDK's installation directory, such as C:\Program files\java\jdk1.7.0_75, and add%java_home%\bin and%java_home\jre\bin to the path variable. separated by semicolons.

3. Open a cmd, execute java–version, and display the Java version number indicating that the Java installation was successful.

Second Preparation IntelliJ IDEA development tool

1. Download and install idea

https://www.jetbrains.com/idea/download/

2. Search online for a registration code.

Third, configure the MAVEN environment.

1. Download compatible with the idea version of MAVEN (IDEA13 is incompatible with Maven3.3, Maven3.1 compatible; IDEA14 is compatible with Maven3.3. )

http://maven.apache.org/download.cgi

2. Extract maven to a directory that is not easy to passive, such as C:\Program files\java\apache-maven-3.3.3.

3. Create a new environment variable m2_home, point to the extracted Maven directory, such as C:\Program files\java\apache-maven-3.3.3, and add%m2_home%\bin to the PATH variable.

4. Copy the settings.xml files in the attachment to the following two paths:

A. C:\Users\User_Name\.m2

B. path\to\apache-maven-3.3.3\conf

5. Open a cmd, execute mvn–v, and display the MAVEN version number indicating the MAVEN installation was successful.

IV Configuration SELENIUM2 webdriver operating environment

1. Download the driver used by Iedriverserver, chromedriver, etc. Firefox browser does not need to download driver separately.

Https://code.google.com/p/selenium/wiki/InternetExplorerDriver

Https://code.google.com/p/selenium/wiki/SafariDriver

Https://code.google.com/p/selenium/wiki/ChromeDriver

Http://code.google.com/p/chromedriver/downloads/list

2. Create a new directory Selenium on the C drive and place the downloaded driver file in C:\Selenium (where you can place it anywhere you specify in the code).

V adding dependencies for selenium and testng related jar packages in the MAVEN project

1. Create a new MAVEN project in idea.

2. To http://mvnrepository.com/, search for the following related JAR package group ID, artifact ID, version and other related information, and add this to the dependencies of the Pom.xml file (other jar packages used in the project can also be searched and added to the Pom.xml file on that URL):

Selenium-firefox-driver, Selenium-chrome-driver, Selenium-ie-driver, Selenium-support, testng

SELENIUM+IDEA+MAVEN+TESTNG Environment Construction

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.