One of selenium Study Notes

Source: Internet
Author: User

Selenium is the most popular open source web application testing tool. I mainly studied selenium RC, using Java, development tools eclipse, and JUnit.

 

Development Environment preparation:

1. Install JRE or JDK;

2. Install eclipse;

3. Download The JUnit package;

4. Install Firefox and plug-ins selenium IDE, firebug, and XPath checker;

5. Download selenium RC and decompress it.

 

Related links:

JRE or JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Eclipse: http://www.eclipse.org/

JUnit: http://www.junit.org/

Selenium official address: http://seleniumhq.org/

Firefox: http://www.mozilla.com/

Firebug: https://addons.mozilla.org/en-US/firefox/addon/1843/

XPath Checker: https://addons.mozilla.org/en-US/firefox/addon/1095/

 

 

C # a simple example of developing a selenium test script:

In vsts2010, create testproject and introduce selnium DLLs related to the selenium-dotnet-client-driver-1.0.x Folder: thoughtworks. Selenium. Core. dll, thoughtworks. Selenium. integrationtests. dll, thoughtworks. Selenium. unittests. dll

Insert the following code in unittest1.cs:

Using system; <br/> using system. text; <br/> using system. collections. generic; <br/> using system. LINQ; <br/> using Microsoft. visual Studio. testtools. unittesting; <br/> Using selenium; </P> <p> namespace testproject1 <br/>{< br/> [testclass] <br/> public class unittest1 <br/>{< br/> [testmethod] <br/> Public void testmethod1 () <br/>{< br/> iselenium sel = new defaultselenium ("localhost", 4444, "* iexplore", "http://www.google.com.hk/"); <br/> SEL. start (); <br/> SEL. open ("/"); <br/> SEL. windowmaximize (); <br/> SEL. type ("Q", "Selenium"); <br/> SEL. click ("btng"); <br/>}< br/>}

 

Starting selenium server: Java-jar selenium-server.jar from the command line

Run the test code and write a test script in C # + selenium RC mode.

 

Next, we will take the qtp classic learning test website http://newtours.demoaut.com/index.php as an example to learn how to write a test script for java?selenium RC.

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.