Selenium Construction, operation

Source: Internet
Author: User

(reproduced online)I. Installing the JDK can be JAVADownload the latest JDK in http://www.java.com/zh_CN/download/and follow the prompts to install     environment variable configuration: My Computer right----high-level--environment variables     Add variable java_home, variable value such as: C:\Program files\java\jdk1.7.0_17    New variable classpath, variable value is:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;    Modify the variable path to increase the JDK path:%java_home%\bin;   Two. Install eclipse    Download the latest version     I'm using 4.2.2, this is a free install version of http://www.eclipse.org/downloads/    three. Install firefox    You can download the latest version in the http://firefox.com.cn/download/of Firefox website and install it as prompted.     four. Download selenium related media     Download the latest version in selenium http://docs.seleniumhq.org/download/     1.selenium ide    After downloading the file for Selenium-ide-1.10.0.xpi, open the Firefox browser, drag the Selenium-ide-1.10.0.xpi file into the browser, follow the prompts to install, restart, will be seen in the Firefox tool selenium IDE, when selected, will pop up the Selenium IDE's interface.     Selenium IDE enables script recording and playback, and generates automated scripts in multiple languages, a powerful weapon for beginners to learn. ~     To build a multilingual script, you must Selenium the IDE's options-- >options. The Enable experimental feature is checked in the-->general and will be seen in the Options-->formatVarious language options can be generated     2.selenium rc    downloaded file is Selenium-server-standalone-2.32.0.jar, start Selenium The RC command is Java-jar Selenium-server-standalone-2.32.0.jar, and you can write a batch as follows: F: CD f:\tool\selenium\seleniumrc  Java-jar selenium-server-standalone-2.32.0.jar    3.selenium Client drivers    I'm using the Java language, So the next is Selenium-java-2.32.0.zip, unzip the package to be used. (The package is unpacked with two jar packages: Selenium-java-2.32.0.jar and Selenium-java-2.32.0-srcs.jar)    five. Selenium integration into eclipse    1. Open Eclipse Create project      file-->new-->java projects--> project name:test-->finish   2. Importing the Selenium plug-in package       TestRight-click on the project name, click Libraries in the Java Build path of the Properties page, click Add External JARs, Select Selenium-java-2.32.0.jar in the Selenium-server-standalone-2.32.0.jar and selenium-java-2.32.0 folders to import six. Record and replay script 1. Open Firefox, enter http://www.baidu.com 2 in the Address bar. Open the Selenium IDE, click the Record button, BaiduSearch box, enter Software Testingand click on "Baidu a bit", click the Record button again to stop Recording 3. In the Selenium IDE, you select JUnit 4 (Remote Control) in Options-->format to generate JUnit script 4. Start Selenium RC 5. At EC Create a new Test1 package and Test2 class in the Lipse Test project, copy the Junit script generated by the Selenium IDE to the Test2 class, and modify the response's package name and class name 6. Select Test2.java, right-click Debug As-junit Test, The code starts to run.

Selenium Construction, operation

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.