First, the development environment
1. JDK
2. Eclipse
3. Firefox 28.0
4, Selenium-java-2.44.0.zip
After decompression:
5, Selenium-server-standalone-2.44.0.jar
Second, the new project
1. Open Eclipse to create a new Java project: Selenium2
2. Import the jar packages needed for Selenium2 development into the new project
(1) Java Project root right-click on build path--Configure build path ...
(2) Select Add External JARS ... Import Selenium-java-2.44.0.jar and
Selenium-server-standalone-2.44.0.jar
3, create a class Webdriver_demo1, realize automatically open the Firefox browser, open the URL http://www.baidu.com
4, the simple example is as follows:
Import Org.openqa.selenium.WebDriver; Import Org.openqa.selenium.firefox.FirefoxDriver; Public class Webdriver_demo1 { publicstaticvoid main (string[] args) { = "http://www.baidu.com"; New firefoxdriver (); Firefoxdriver.get (URL);} }
SELENIUM2 (webdriver) Development Environment Building (Java Edition)