How to run JUnit 4 test cases in parallel using TestNG

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to run JUnit 4 test cases in parallel using TestNG

Vasuki
This post has NOT been accepted by the mailing list yet.
Friends,

I am trying to run the Selenium Webdriver (JUnit 4) test cases in parallel using TestNG. But I failed. Received the below error.

org.testng.TestNGException:
Failure in JUnit mode for class com.**.TestCase: could not create/run JUnit test suite:
Cannot find JUnit method class junit.framework.TestSuite$1.warning

Running the test cases in parallel by generating xml file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite thread-count="4" name="TestCasessuite" parallel="tests">
  <test name="TestCase" junit="true" preserve-order="false">
    <classes>
      <class name="com.test.TestCase"/>
    </classes>
  </test>
  <test name="TestCase1" junit="true" preserve-order="false">
    <classes>
      <class name="com.test.TestCases1"/>
    </classes>
  </test>
</suite>

But for JUnit 3 it is working fine.

Please let me know any solution/suggestion.

Thanks