Automated Web Testing Selenium 2/3

Source: Internet
Author: User
Tags testng

TesNG

TestNG is a testing framework designed to simplify a wide range of test requirements, from unit testing (separated

From testing a class) to integration testing (testing is composed of multiple classes, multiple packages, or even multiple external frameworks ).

Systems, such as servers ).

TestNG is a testing framework designed to simplify a wide range of test requirements, from unit testing

Integration Test

This is the starting point of the TestNG design. It is not only a unit test, but also an integrated test.

 

Run the batch file

@ Echo off

 

Rem test. bat src \ testng. xml https: \// 192.168.0.156

 

Setlocal DisableDelayedExpansion

 

If "% 1%" = ""(

 

Set TESTSUIT = src \ testng. xml

) Else (

Set TESTSUIT = % 1%

)

 

If not "% 2%" = ""(

Attrib-R src \ testng. xml

Rem

Type % TESTSUIT % | C: \ test \ UnxUtils \ usr \ local \ wbin \ sed.exe-e "s/http: \ // localhost \/test.htm/% 2%/g "> test. xml

Rem copy/Y test. xml % TESTSUIT %

) Else (

Copy/Y % TESTSUIT % test. xml

)

Endlocal

 

Rem ==========================================

Setlocal EnableDelayedExpansion

Set JAVA_HOME = % JAVA_HOME %

Rem set PATH = % PATH; % JAVA_HOME % \ bin

Set CLASSPATH =./bin;

 

Set LIBS =

Pushd libs

For/f "delims =" % s in ('dir/B ') do (

Rem echo % s

Set LIBS =! LIBS !;. /Libs/

Set LIBS =! LIBS! % S;

)

Popd

 

Rem echo % LIBS %

Set CLASSPATH =./bin/; % LIBS %

Rem echo % CLASSPATH %

Rem pause

Java-classpath % CLASSPATH % org. testng. TestNG test. xml

Endlocal

Testng

 

<? Xml version = '1. 0' encoding = 'utf-8'?>

<Suite name = "Parallel Tests" verbose = "1" thread-count = "4"

Parallel = "tests">

<Tests>

<Test name = "Windows + IE8 Test">

<Parameters>

<Parameter name = "platform" value = "Windows"/>

<Parameter name = "browser" value = "Internet Explorer"/>

<Parameter name = "version" value = "8"/>

<Parameter name = "url" value = "http: // localhost/test.htm"/>

</Parameters>

<Classes>

<Class name = "logon"/>

</Classes>

</Test>

 

<Test name = "Windows + Firefox4 Test">

<Parameters>

<Parameter name = "platform" value = "Windows"/>

<Parameter name = "browser" value = "Firefox"/>

<Parameter name = "version" value = "4"/>

<Parameter name = "url" value = "http: // localhost/test.htm"/>

</Parameters>

<Classes>

<Class name = "logon"/>

</Classes>

</Test>

 

<Test name = "Windows + Chrome Test">

<Parameters>

<Parameter name = "platform" value = "Windows"/>

<Parameter name = "browser" value = "chrome"/>

<Parameter name = "version" value = "31"/>

<Parameter name = "url" value = "http: // localhost/test.htm"/>

</Parameters>

<Classes>

<Class name = "logon"/>

</Classes>

</Test>

</Tests>

</Suite>

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.