depends on attribute for classes

classic Classic list List threaded Threaded
2 messages Options
SPS
Reply | Threaded
Open this post in threaded view
|

depends on attribute for classes

SPS
Hello,

I have two tests A and B in my tesng.xml. I would like to test B only if test A passes. Is there a way to handle this situation?

<suite >
   <test name = "A">
             <class name = "c1">
   </test>

 <test name = "B">
             <class name = "c2">
  </test>


</suite>


Thanks

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: depends on attribute for classes

Krishnan Mahadevan
Sneha,

You can try doing the following :
  1. Make sure you disable parallel execution [ That is critical to your requirement ]
  2. Built a listener which implements org.testng.ITestListener wherein within org.testng.ITestListener#onStart you check for a boolean that indicates failures.
  3. Within org.testng.ITestListener#onFinish you check to see if there are any failed methods and set a boolean variable [ which is what is read by (2) ]




Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Wed, Sep 21, 2016 at 10:09 PM, SPS <[hidden email]> wrote:
Hello,

I have two tests A and B in my tesng.xml. I would like to test B only if test A passes. Is there a way to handle this situation?

<suite >
   <test name = "A">
             <class name = "c1">
   </test>

 <test name = "B">
             <class name = "c2">
  </test>


</suite>


Thanks

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.