Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

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

Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

Denish Makwana
The sequence of testng 6.8.8 class and methods:

before_class1
class1_method1
class1_method2
class1_method3
after_class1
before_class2
class2_method1
class2_method2
class2_method3
after_class2
before_class3
class3_method1
class3_method2
class3_method3
after_class3

The sequence of testng 6.14.2 class and methods:

before_class1
class1_method1
before_class2
class2_method1
before_class3
class3_method1
class1_method2
class2_method2
class3_method2
class1_method3
after_class1
class2_method3
after_class2
class3_method3
after_class3

I want output like 6.8.8 in 6.14.2 version..and also explain why this sequence change for new testng.. Need your help to understand this better.

For more information refer attached java file and testng.xml file . Run testng.xml file which I attached to this topic.

--
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.

class1.java (675 bytes) Download Attachment
class2.java (677 bytes) Download Attachment
class3.java (677 bytes) Download Attachment
testng.xml (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

Krishnan Mahadevan

Denish,

 

Lot of things have changed between those versions.

 

TestNG was updated in 6.10 as part of GITHUB-1156 changeset to start respecting the following ordering:

 

Hierarchy on order features (from less important to more important): groupByInstance, preserveOrder, priority, dependsOnGroups, dependsOnMethods

 

In your case, you have specified priority for each of the test methods in each of the test classes.

 

So TestNG is basically picking up @Test methods as below:

 

  1. Priority=0 methods [ class1_method1, class2_method1, class3_method1]. Since there’s a beforeclass included, all the beforeclass methods of all the 3 classes are getting invoked.
  2. Priority=1 methods [ class1_method2, class2_method2, class3_method2]
  3. Priority=2 methods[class1_method3, class2_method3, class3_method3] followed by executing the afterclass methods.

 

So if you need the order to be maintained as is, you would need to get rid of priority in all of your test methods. That would cause TestNG to respect preserve-order=true (which is set by default).

 

Hope that helps!

 

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/

Reply-To: <[hidden email]>
Date: Sunday, April 1, 2018 at 10:39 PM
To: testng-users <[hidden email]>
Subject: [testng-users] Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

 

The sequence of testng 6.8.8 class and methods:

 

before_class1

class1_method1

class1_method2

class1_method3

after_class1

before_class2

class2_method1

class2_method2

class2_method3

after_class2

before_class3

class3_method1

class3_method2

class3_method3

after_class3

 

The sequence of testng 6.14.2 class and methods:

 

before_class1

class1_method1

before_class2

class2_method1

before_class3

class3_method1

class1_method2

class2_method2

class3_method2

class1_method3

after_class1

class2_method3

after_class2

class3_method3

after_class3

 

I want output like 6.8.8 in 6.14.2 version..and also explain why this sequence change for new testng.. Need your help to understand this better.

 

For more information refer attached java file and testng.xml file . Run testng.xml file which I attached to this topic.

--
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.
Reply | Threaded
Open this post in threaded view
|

Re: Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

Denish Makwana
Thank you Krishnan... I would really appreciate if you send one example for this.

On Monday, April 2, 2018 at 8:59:39 AM UTC+5:30, Krishnan Mahadevan wrote:

Denish,

 

Lot of things have changed between those versions.

 

TestNG was updated in 6.10 as part of <a href="https://github.com/cbeust/testng/issues/1156" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues%2F1156\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxofaEr1Ysa-bHp0kO8ZLoPvja6w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues%2F1156\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxofaEr1Ysa-bHp0kO8ZLoPvja6w&#39;;return true;">GITHUB-1156 changeset to start respecting the following ordering:

 

Hierarchy on order features (from less important to more important): groupByInstance, preserveOrder, priority, dependsOnGroups, dependsOnMethods

 

In your case, you have specified priority for each of the test methods in each of the test classes.

 

So TestNG is basically picking up @Test methods as below:

 

  1. Priority=0 methods [ class1_method1, class2_method1, class3_method1]. Since there’s a beforeclass included, all the beforeclass methods of all the 3 classes are getting invoked.
  2. Priority=1 methods [ class1_method2, class2_method2, class3_method2]
  3. Priority=2 methods[class1_method3, class2_method3, class3_method3] followed by executing the afterclass methods.

 

So if you need the order to be maintained as is, you would need to get rid of priority in all of your test methods. That would cause TestNG to respect preserve-order=true (which is set by default).

 

Hope that helps!

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;">http://wakened-cognition.blogspot.com/

My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;">http://rationaleemotions.wordpress.com/

Reply-To: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="UE0-pxrXAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Date: Sunday, April 1, 2018 at 10:39 PM
To: testng-users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="UE0-pxrXAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Subject: [testng-users] Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

 

The sequence of testng 6.8.8 class and methods:

 

before_class1

class1_method1

class1_method2

class1_method3

after_class1

before_class2

class2_method1

class2_method2

class2_method3

after_class2

before_class3

class3_method1

class3_method2

class3_method3

after_class3

 

The sequence of testng 6.14.2 class and methods:

 

before_class1

class1_method1

before_class2

class2_method1

before_class3

class3_method1

class1_method2

class2_method2

class3_method2

class1_method3

after_class1

class2_method3

after_class2

class3_method3

after_class3

 

I want output like 6.8.8 in 6.14.2 version..and also explain why this sequence change for new testng.. Need your help to understand this better.

 

For more information refer attached java file and testng.xml file . Run testng.xml file which I attached to this topic.

--
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
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="UE0-pxrXAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users+unsubscribe@googlegroups.com.
To post to this group, send email to
<a href="javascript:" target="_blank" gdf-obfuscated-mailto="UE0-pxrXAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users@....
Visit this group at
<a href="https://groups.google.com/group/testng-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/testng-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/testng-users&#39;;return true;">https://groups.google.com/group/testng-users.
For more options, visit
<a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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.
Reply | Threaded
Open this post in threaded view
|

Re: Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

Krishnan Mahadevan

What sample are you looking for?

You just need to remove off the “priority” attribute of your @Test annotation.

 

 

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/

Reply-To: <[hidden email]>
Date: Monday, April 2, 2018 at 9:35 PM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

 

Thank you Krishnan... I would really appreciate if you send one example for this.

On Monday, April 2, 2018 at 8:59:39 AM UTC+5:30, Krishnan Mahadevan wrote:

Denish,

 

Lot of things have changed between those versions.

 

TestNG was updated in 6.10 as part of GITHUB-1156 changeset to start respecting the following ordering:

 

Hierarchy on order features (from less important to more important): groupByInstance, preserveOrder, priority, dependsOnGroups, dependsOnMethods

 

In your case, you have specified priority for each of the test methods in each of the test classes.

 

So TestNG is basically picking up @Test methods as below:

 

  1. Priority=0 methods [ class1_method1, class2_method1, class3_method1]. Since there’s a beforeclass included, all the beforeclass methods of all the 3 classes are getting invoked.
  2. Priority=1 methods [ class1_method2, class2_method2, class3_method2]
  3. Priority=2 methods[class1_method3, class2_method3, class3_method3] followed by executing the afterclass methods.

 

So if you need the order to be maintained as is, you would need to get rid of priority in all of your test methods. That would cause TestNG to respect preserve-order=true (which is set by default).

 

Hope that helps!

 

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/

Reply-To: <<a href="javascript:" target="_blank">testng...@...>
Date: Sunday, April 1, 2018 at 10:39 PM
To: testng-users <
<a href="javascript:" target="_blank">testng...@...>
Subject: [testng-users] Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

 

The sequence of testng 6.8.8 class and methods:

 

before_class1

class1_method1

class1_method2

class1_method3

after_class1

before_class2

class2_method1

class2_method2

class2_method3

after_class2

before_class3

class3_method1

class3_method2

class3_method3

after_class3

 

The sequence of testng 6.14.2 class and methods:

 

before_class1

class1_method1

before_class2

class2_method1

before_class3

class3_method1

class1_method2

class2_method2

class3_method2

class1_method3

after_class1

class2_method3

after_class2

class3_method3

after_class3

 

I want output like 6.8.8 in 6.14.2 version..and also explain why this sequence change for new testng.. Need your help to understand this better.

 

For more information refer attached java file and testng.xml file . Run testng.xml file which I attached to this topic.

--
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
<a href="javascript:" target="_blank">testng-users+unsubscribe@....
To post to this group, send email to
<a href="javascript:" target="_blank">testng-users@....
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.

--
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: Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

Denish Makwana
Thank you Krishnan. It's working as expected. 🙂

On Mon 2 Apr, 2018, 11:01 PM Krishnan Mahadevan, <[hidden email]> wrote:

What sample are you looking for?

You just need to remove off the “priority” attribute of your @Test annotation.

 

 

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/

Reply-To: <[hidden email]>
Date: Monday, April 2, 2018 at 9:35 PM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

 

Thank you Krishnan... I would really appreciate if you send one example for this.

On Monday, April 2, 2018 at 8:59:39 AM UTC+5:30, Krishnan Mahadevan wrote:

Denish,

 

Lot of things have changed between those versions.

 

TestNG was updated in 6.10 as part of GITHUB-1156 changeset to start respecting the following ordering:

 

Hierarchy on order features (from less important to more important): groupByInstance, preserveOrder, priority, dependsOnGroups, dependsOnMethods

 

In your case, you have specified priority for each of the test methods in each of the test classes.

 

So TestNG is basically picking up @Test methods as below:

 

  1. Priority=0 methods [ class1_method1, class2_method1, class3_method1]. Since there’s a beforeclass included, all the beforeclass methods of all the 3 classes are getting invoked.
  2. Priority=1 methods [ class1_method2, class2_method2, class3_method2]
  3. Priority=2 methods[class1_method3, class2_method3, class3_method3] followed by executing the afterclass methods.

 

So if you need the order to be maintained as is, you would need to get rid of priority in all of your test methods. That would cause TestNG to respect preserve-order=true (which is set by default).

 

Hope that helps!

 

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/

Reply-To: <[hidden email]>
Date: Sunday, April 1, 2018 at 10:39 PM
To: testng-users <
[hidden email]>
Subject: [testng-users] Getting result in an improper sequence after updating testng from 6.8.8 to 6.14.2

 

The sequence of testng 6.8.8 class and methods:

 

before_class1

class1_method1

class1_method2

class1_method3

after_class1

before_class2

class2_method1

class2_method2

class2_method3

after_class2

before_class3

class3_method1

class3_method2

class3_method3

after_class3

 

The sequence of testng 6.14.2 class and methods:

 

before_class1

class1_method1

before_class2

class2_method1

before_class3

class3_method1

class1_method2

class2_method2

class3_method2

class1_method3

after_class1

class2_method3

after_class2

class3_method3

after_class3

 

I want output like 6.8.8 in 6.14.2 version..and also explain why this sequence change for new testng.. Need your help to understand this better.

 

For more information refer attached java file and testng.xml file . Run testng.xml file which I attached to this topic.

--
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.

--
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/dGnFiWX55ys/unsubscribe.
To unsubscribe from this group and all its topics, 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.