First, the development environment:
1. Install the JDK:
Http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html
2. Install Eclipse
http://www.eclipse.org/downloads/
3. Install Selenium: (Java version)
http://www.selenium.com/
At present selenium official website is blocked, have the need contact contact me. or use proxy access.
Ii. new Java project and Manve project
1, JDK configuration succeeded
2, Eclipse can use normally,
3, Selenium (Java version now complete)
Note: The new Manve project needs to build a manve environment. For the time being, there is no need for friends to contact me. qq:807002272
-
new Java project [open eclipse->file->new->other- >java project
650) this.width=650; "src=" http://img.blog.csdn.net/20150706140012616 "alt=" write a picture description here " Title= "style=" Border:none;height:auto; "/>
-
selenium configuration to project
Unzip the selenium and copy it to the newly created project.
650) this.width=650; "src=" http:/ img.blog.csdn.net/20150706140813738 "alt=" here to write a picture describing "title=" "style=" Border:none;height:auto; "/>
650) this.width=650; "src=" http://img.blog.csdn.net/20150706140930025 "alt=" here write a picture describing "title=" "style=" border:none; Height:auto; "/>
-
Configure the jar package file to build Path
650) this.width=650; "src=" http://img.blog.csdn.net/20150706141315172 "alt=" here write a picture describing "title=" "style=" border:none; Height:auto; "/>
blockquote style= "margin:0px 0px 1.1em;padding:15px 20px;border-left-width:10px;border-left-style:solid;" >
SELENIUM-JAVA-2.46.0.JAR 
selenium-java-2.46.0-srcs.jar
Follow the above figure to find the 2 packages and add them. Click OK
650) this.width=650; "Src=" http ://img.blog.csdn.net/20150706141848939 "alt=" here to write a picture describing "title=" "style=" Border:none;height:auto; "/>
Third, the test environment to build success
Create a new Java file; Enter the following code; Run with Java application.
import org.openqa.selenium.By; import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.firefox.*; public class snippet { public static void main (String[] args) { //If Firefox is not installed by default on the C drive, you need to develop its path system.setproperty ("Webdriver.firefox.bin", "D:/firefox/firefox.exe"); webdriver driver = new firefoxdriver (); driver.get ("http://wd.txiake.com/"); driver.manage (). window (). Maximize (); webelement Txtbox = driver.findelement (By.namE ("Q")); txtbox.sendkeys ("20150410"); webelement btn = driver.findelement (By.id ("Global_search_btns")); btn.click (); Driver.close (); } }
This article is from "an old City, memory is still." "Blog, be sure to keep this provenance http://diaosi58.blog.51cto.com/2722311/1672000
[Selenium2]+eclipse+java Environment Construction