SELENIUM2 (webdriver) Development Environment Building (Java Edition)

Source: Internet
Author: User

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)

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.