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