--
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+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
--
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
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 a topic in the Google Groups "testng-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/testng-users/nVgH6F-TIBo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
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 a topic in the Google Groups "testng-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/testng-users/nVgH6F-TIBo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
I'm aware of the documented behavior, what I'm concerned about is that the evidence of my tests indicate that testng is not following the described behavior pattern.if you imagine that I have 2 test classes, call them A and B. each has a @BeforeClass, @AfterClass and several test methods. what I am seeing as my tests run is that (assuming they occur in the order A, B) is that the B.BeforeClass is executed before the A.AfterClass. and A.AfterClass may actually be occurring after the first B.TestMethod is occurring. In my case the test cases are built relying on the fact that they can be run in isolation and in any order, meaning that they clean up after themselves. if A cleans up after B is started, it may (and is) affecting the environment in a way that causes test B to fail.
On Wed, Jun 13, 2018 at 9:24 AM akash kansal <akashka...@gmail.com> wrote:
Hi peter,First understand the calling hierarchy of testng.
On Wed, Jun 13, 2018 at 4:31 AM, peter sgouros <psgo...@gmail.com> wrote:
at what point are the @Before and @After class annotated methods (actually and intended?) meant to run?For a variety of reasons I need to run a set of complex test cases sequentially (i.e. parallel=none, thread-count=1) though not in any particular order. In each case, I need to set up a complex environment, run the tests, then tear down the complex environment before moving on to the next test case where I will need to set up a new (but different and potentially conflicting) environment. but my hope and expectation is that the entire test class is executed before proceeding to the next test case. after a fair amount of experimentation and searching it appears to me that the @BeforeClass and @AfterClass methods may be executed at any arbitrary time providing that the time is indeed before or after the test methods within the class in question. as a result, the @AfterClass method may not execute (going by the log file) until potentially several test class executions later. causing my environments to conflictam I incorrect in assuming that the @AfterClass method of one test class should execute before the @BeforeClass method of another test class?how is it, when running in what appears to be be single threaded conditions, the test runner still seems to be intent on running the @AfterClasses in arbitrary order or at arbitrary times?is there a way to configure testng such that each test class run to completion (with all associated @BeforeClass and @AfterClass methods) before proceeding to the next test class?what is occurring now is that (for example) the @AfterClass methods are being invoked not at the end of the test class they are attached to, but at a later time, often in the middle of one of the subsequent test classes. sometimes just after the @BeforeClass method has been invoked for the next class. this is causing issues. as the before and after methods are counterparts. the test methods depend on things created by the @before. is this really the intended operation for this feature?the one viable (but annoying) option I have found is to place the @AfterClass actions into a test method and either set up a dependency chain or priority order which seems to be at odds with general good test practice. has anyone any other viable options?or alternatively setup a testng.xml file that lists each test case a as a separate suite or something similar. what I really want to know is whether the current behavior of the @BeforeClass and @AfterClass annotations is a feature or a bug.cheers
--
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+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
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 a topic in the Google Groups "testng-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/testng-users/nVgH6F-TIBo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to testng-users+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
--Peter Sgouros--
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+unsubscribe@googlegroups.com.
Ram,
Please DONOT hijack threads.
For your query, please post a new query on the forum.
And when you post, don’t forget to include sample code etc., that we can look at.
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/
--
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
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 testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
--
Regards,
Ramniwas Vishwakarma
Cell No. :- 9977050509
--
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.