Hello,
I would like to invoke the same Java class multiple times within the same XML test tag.
Let's assume I have three Java class files:
FirstTest.java
SecondTest.java
ThirdTest.java
Each file contains a TestNG method. I would like to invoke the FirstTest.java class file twice within the same TestNG method. However, it only runs the FirstTest.java once and skips the second invocation of FirstTest.java.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Demo">
<test name="Demo test">
<classes>
<class name="Demo.FirstTest"/>
<class name="Demo.SecondTest"/>
<class name="Demo.ThirdTest"/>
<!-- Calling the java class file FirstTest again -->
<class name="Demo.FirstTest"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
Thank you!
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/CANikZLkM06_UHcTBoVL1XmugfSTvYxhqxnvV1U4HuLrZge9U6A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/CAFy_9B-BeYVtsa8zd6hjxBZtx_ka-D0XHBgy-idFao%2BLPaNinA%40mail.gmail.com.
The invocationCount
will not work, as I have to run the tests in the order of the workflow testing requirements. Here is a use case for the workflows that I am testing:
Note that steps 2 and 4 are performing the same action. Step 4 will only come into play if step 3 results in denial.
Following XML test suite skips the fourth invocation below.To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/CANikZLmRc-UH6y7ors%2BnUze4384hPccy0FMC0zxQssafEio5FQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/c1d856b7-b46e-4fbd-a20d-35f5ae26eab1n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/CANikZLn_Jo%3Db90%2BFfi-1Dd8sUv6A4KBfBhKvhmJ%2B1V83_SZLCA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/CAFy_9B8QA-O_Qv58brD7zNw7i28Ki6qfD9ozsVeBOmudXE3F7g%40mail.gmail.com.