Answers

Question and Answer:

  Home  Selenium Remote Control

⟩ How to execute the selenium test suite with testNG in XML?

Assume that you have two classes which are having suite of test cases with the below mentioned methods.

class1 or suite 1: the class by name MercTestNgSuite in the package com.src.testng with the methods

1. testLogin1

2. testFindFlights

3. testSelectFlights

4. testFillUserDetails

class1 or suite 2:the class by name MercTestNgSuite2 in the package com.src.testng with the methods

1. testLogin1

2. testFindFlights

3. testSelectFlights

4. testFillUserDetails

5. testVerifyFlightConf

6. testLogout

The two class suites can be executed as mentioned

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite thread-count="5" skipfailedinvocationCounts="false" verbose="1" name="MercPrj" junit="false" parallel="false" annotations="JDK">

<test verbose="2" name="com.src.testng.*" junit="false" annotations="JDK">

<classes>

<class name="com.src.testng.MercTestNgSuite"/>

<methods>

<include name="testLogin1"/>

<include name="testFindFlights"/>

<include name="testSelectFlights"/>

<include name="testFillUserDetails"/>

</methods>

<class name="com.src.testng.MercTestNgSuite2"/>

<methods>

<include name="testLogin1"/>

<include name="testFindFlights"/>

<include name="testSelectFlights"/>

<include name="testFillUserDetails"/>

<include name="testVerifyFlightConf"/>

<include name="testLogout"/>

</methods>

</classes>

</test>

</suite>

 142 views

More Questions for you: