Java Selenium Environment Building

Source: Internet
Author: User

Seleniu automated test scripts written in the Java language are typically run in the Eclipse integrated development environment, so the Java environment needs to be built before the selenium environment can be built.

One: Get the JDK installation package:

Method One: Official: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Method Two: To my Baidu network disk download: https://pan.baidu.com/disk/home#list/path=%2F&vmode=list

Two: Configure the Java environment variables:

1) Turn on the computer--Properties--Advanced system settings--advanced--Environment variables:

2) New System variables Java_home and Classpath

Variable name: Java_home variable Value: C:\Program files\java\jdk1.8.0_111 (Note: Here is the actual installation path of the JDK, modified according to the actual path)

Variable name: CLASSPATH variable Value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;

3) Modify path path, add bin path

Variable Name: PATH variable value:%java_home%\bin;%java_home%\jre\bin; (here is the Bin directory added in the path path)

4) Verify that the environment variable is OK

Enter cmd into the console, then enter "Java-version" To view the Java version of the configuration, if you can query, prove environment variable configuration OK.

Three: Get the Eclipse installation package

Method One: Official: https://www.eclipse.org/downloads/

Method Two: To my Baidu network disk download: https://pan.baidu.com/disk/home#list/path=%2F&vmode=list

IV: Get the Selenium installation package

Method One: Official: http://www.seleniumhq.org/download/

Method Two: To my Baidu network disk download: https://pan.baidu.com/disk/home#list/path=%2F&vmode=list

V: Configure Webdriver Selenium in eclipse

1) New Java Project Project

2) Right-click on the SRC directory of the new project and select Configure build path after popup build path

3) After switching to the Libraries tab in the Pop-up window, select "Add External JARs" and go to the Selenium Extract folder, Selenium-java-2.44.0.jar, Select all the files under the Selenium-java-2.44.0-srcs.jar and Libs folders, click the Open button to add all the selected jar files, and then add the selenium environment in eclipse to finish.

Six: Download Firefox, and install Firefox

To my Baidu network disk download: https://pan.baidu.com/disk/home#list/path=%2F&vmode=list

Seven: Write the first webdriver script to verify that the environment is OK

Eight: If the following page appears, it proves that the entire environment is OK.

Java Selenium Environment Building

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.