Quantcast

[testng-dev] Order of execution when @Factory at constructor level

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[testng-dev] Order of execution when @Factory at constructor level

Sandeep Aralihalli
Hi,


I am facing some issues as the order of execution is not correct when there is @Factory at constructor level and there are some tests are present..

I have provided the DataProvider(lazy fashion) as my data gets generated at RUNTIME at my original setup

I have simplified for illustrations and attached .....



Thanks and Regards,
Sandeep

--
You received this message because you are subscribed to the Google Groups "testng-dev" 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 http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.

src.zip (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[testng-dev] Re: Order of execution when @Factory at constructor level

Julien Herr
Hi,

For me, your example looks weird and testng is working as expected: account_list from data, may or may not be initialized before the call of the data provider. The only thing we can say is the data provider will be called before the method which need it.

Someone already asked more or less the same question one day ago: https://github.com/cbeust/testng/issues/883

Regards,
Julien

Le jeudi 19 novembre 2015 13:20:30 UTC+1, Sandeep Aralihalli a écrit :
Hi,


I am facing some issues as the order of execution is not correct when there is @Factory at constructor level and there are some tests are present..

I have provided the DataProvider(lazy fashion) as my data gets generated at RUNTIME at my original setup

I have simplified for illustrations and attached .....



Thanks and Regards,
Sandeep

--
You received this message because you are subscribed to the Google Groups "testng-dev" 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 http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[testng-dev] Re: Order of execution when @Factory at constructor level

Sandeep Aralihalli
Thanks Julien for the effort into looking into the issue reported... 

The issue i am getting is order of execution.


ExpectedResult
----------------------------------------------

b4Class for sun_company3
=================================================================


TEST 1 :Executing forsun_company3 IP : sun_company3 ENTRY 1




TEST 1 :Executing forsun_company3 IP : sun_company3 ENTRY 2


Test 2: sun_company3 IP : sun_company3 ENTRY 1




Test 2: sun_company3 IP : sun_company3 ENTRY 2


Closing sun_company3
=============================================================================

b4Class for sun_company4
=================================================================


TEST 1 :Executing forsun_company4 IP : sun_company4 ENTRY 1




TEST 1 :Executing forsun_company4 IP : sun_company4 ENTRY 2



Test 2: sun_company4 IP : sun_company4 ENTRY 1




Test 2: sun_company4 IP : sun_company4 ENTRY 2




Closing sun_company4
=============================================================================


But the Actual Result i am facing is  :-


b4Class for sun_company3
=================================================================


TEST 1 :Executing forsun_company3 IP : sun_company3 ENTRY 1




TEST 1 :Executing forsun_company3 IP : sun_company3 ENTRY 2




b4Class for sun_company4
=================================================================


TEST 1 :Executing forsun_company4 IP : sun_company4 ENTRY 1




TEST 1 :Executing forsun_company4 IP : sun_company4 ENTRY 2




Test 2: sun_company3 IP : sun_company4 ENTRY 1




Test 2: sun_company3 IP : sun_company4 ENTRY 2




Closing sun_company3
=============================================================================


Test 2: sun_company4 IP : sun_company4 ENTRY 1




Test 2: sun_company4 IP : sun_company4 ENTRY 2




Closing sun_company4
=============================================================================

--
You received this message because you are subscribed to the Google Groups "testng-dev" 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 http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[testng-dev] Re: Order of execution when @Factory at constructor level

Julien Herr
Yes, it is working as expected: the order of tests on different instances should not have side effects.

BTW, you can try the group-by-instances parameter:
http://testng.org/doc/documentation-main.html#dependent-methods

Le lundi 23 novembre 2015 13:06:19 UTC+1, Sandeep Aralihalli a écrit :
Thanks Julien for the effort into looking into the issue reported... 

The issue i am getting is order of execution.


ExpectedResult
----------------------------------------------

b4Class for sun_company3
=================================================================


TEST 1 :Executing forsun_company3 IP : sun_company3 ENTRY 1




TEST 1 :Executing forsun_company3 IP : sun_company3 ENTRY 2


Test 2: sun_company3 IP : sun_company3 ENTRY 1




Test 2: sun_company3 IP : sun_company3 ENTRY 2


Closing sun_company3
=============================================================================

b4Class for sun_company4
=================================================================


TEST 1 :Executing forsun_company4 IP : sun_company4 ENTRY 1




TEST 1 :Executing forsun_company4 IP : sun_company4 ENTRY 2



Test 2: sun_company4 IP : sun_company4 ENTRY 1




Test 2: sun_company4 IP : sun_company4 ENTRY 2




Closing sun_company4
=============================================================================


But the Actual Result i am facing is  :-


b4Class for sun_company3
=================================================================


TEST 1 :Executing forsun_company3 IP : sun_company3 ENTRY 1




TEST 1 :Executing forsun_company3 IP : sun_company3 ENTRY 2




b4Class for sun_company4
=================================================================


TEST 1 :Executing forsun_company4 IP : sun_company4 ENTRY 1




TEST 1 :Executing forsun_company4 IP : sun_company4 ENTRY 2




Test 2: sun_company3 IP : sun_company4 ENTRY 1




Test 2: sun_company3 IP : sun_company4 ENTRY 2




Closing sun_company3
=============================================================================


Test 2: sun_company4 IP : sun_company4 ENTRY 1




Test 2: sun_company4 IP : sun_company4 ENTRY 2




Closing sun_company4
=============================================================================

--
You received this message because you are subscribed to the Google Groups "testng-dev" 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 http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[testng-dev] Re: Order of execution when @Factory at constructor level

Sandeep Aralihalli
But as per the definition, it is not working as expected... 

The factory at constructor is getting fed with two values  : sun_company3 and sun_company4...(from dataProvider)...

So all tests should be completed for value -: sun_company3 and then same tests should be run with sun_company4...

So the beforeClass of sun_company 4 should only execute after the execution of afterClass of sun_company3 which is not happening

--
You received this message because you are subscribed to the Google Groups "testng-dev" 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 http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.
Loading...