Selenium RC Question:
Download Questions PDF

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

Selenium Remote Control Interview Question
Selenium Remote Control Interview Question

Answer:

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>

Download Selenium Remote Control Interview Questions And Answers PDF

Previous QuestionNext Question
How to incude or exclude the selenium rc test cases using xml in TestNG?How to run Selenium IDE test suite with user extensions using Selenium Remote Control?