dataprovider(parallel=true): not able to group the logs of each testcase individually.

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

dataprovider(parallel=true): not able to group the logs of each testcase individually.

Rejish R
Hi,

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

Note: @Factory is not being used here

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: dataprovider(parallel=true): not able to group the logs of each testcase individually.

⇜Krishnan Mahadevan⇝

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]
  2. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]
  3. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <[hidden email]>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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

Re: dataprovider(parallel=true): not able to group the logs of each testcase individually.

Rejish R
Hi,

My comments are in inline. Do let me know, if that looks good.

-Thanks
On Thursday, May 31, 2018 at 8:55:16 AM UTC+5:30, Krishnan Mahadevan wrote:

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]
[REJISH]: 6.14.3 
  1. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]
[REJISH]: I have created a new annotation "TestDescription" where in I am having a field "tags" and passing list of string to it. Based on the tags value, in my data provider, I am filtering data and sending the appropriate data to the test cases.
@TestDescription(ticketId = "100", testName = "Demo test", description = "Demo test", assertions = "jhjgh", testCreator = "")
public class DemoTest extends BaseTest {

@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
@TestDescription(ticketId = "100", testName = "FirstTest", description = "", assertions = "",tags = {"delhi","bangalore"}, testCreator = "")
public void validateFirstTest(Map<String, String> testParam) {
System.out.println("testParam inside validateFirstTest: "+ testParam);
}

@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
@TestDescription(ticketId = "101", testName = "SecondTest", description = "", assertions = "",tags = {"mumbai","bangalore"}, testCreator = "")
public void validateSecondTest(Map<String, String> testParam) {
System.out.println("testParam inside validateSecondTest: "+ testParam);
}
}

 
  1. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

[Rejish]:  If you code see the logs below, they all are merged and not separate for each tests. My requirement is to get these logs separately for each test cases. I am getting all these logs by implementing a listener. 

 

 

Beginning executing Suite DemoSuite

Beginning executing Test:  Demo Tests

Ticket ID:  100

Ticket ID:  100

Ticket ID:  100

Test Name:  regression..DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Assertions:  jhjgh

Description:  Demo test

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Test Creator:  

Assertions:  jhjgh

Additional Notes:  

Description:  Demo test

Query Input:  

Assertions:  jhjgh

Test Creator:  

Description:  Demo test

Additional Notes:  

Test Creator:  

Query Input:  

Additional Notes:  

Query Input:  

Unique ID:  160985857

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}
Unique ID:  129046802

Unique ID:  145678790

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}
testParam inside validateFirstTest: {q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}
Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Test Status final:  Pass

Test Status final:  Pass

Test Status final:  Pass

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.135 s - in TestSuite
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.549 s
[INFO] Finished at: 2018-05-31T11:07:31+05:30
[INFO] Final Memory: 30M/386M
[INFO] ------------------------------------------------------------------------

Process finished with exit code 0 

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/

 

From: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="a0DpJqFuAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...> on behalf of Rejish R <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="a0DpJqFuAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rejis...@...>
Reply-To: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="a0DpJqFuAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="a0DpJqFuAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="a0DpJqFuAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="a0DpJqFuAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@....
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: dataprovider(parallel=true): not able to group the logs of each testcase individually.

⇜Krishnan Mahadevan⇝

Not much can be done by the code snippet you shared.

Please help share a complete example that we can run at our end to see what’s going on.

Without that, it’s going to be hard to even take a guess.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 11:26 AM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

My comments are in inline. Do let me know, if that looks good.

 

-Thanks
On Thursday, May 31, 2018 at 8:55:16 AM UTC+5:30, Krishnan Mahadevan wrote:

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]

[REJISH]: 6.14.3 

  1. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]

[REJISH]: I have created a new annotation "TestDescription" where in I am having a field "tags" and passing list of string to it. Based on the tags value, in my data provider, I am filtering data and sending the appropriate data to the test cases.

@TestDescription(ticketId = "100", testName = "Demo test", description = "Demo test", assertions = "jhjgh", testCreator = "")
public class DemoTest extends BaseTest {

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
   
@TestDescription(ticketId = "100", testName = "FirstTest", description = "", assertions = "",tags = {"delhi","bangalore"}, testCreator = "")
   
public void validateFirstTest(Map<String, String> testParam) {
        System.
out.println("testParam inside validateFirstTest: "+ testParam);
   
}

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
    @TestDescription(ticketId = "101", testName = "SecondTest", description = "", assertions = "",tags = {"mumbai","bangalore"}, testCreator = "")
    public void validateSecondTest(Map<String, String> testParam) {
        System.out.println("testParam inside validateSecondTest: "+ testParam);
    }
}

 

 

  1. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

[Rejish]:  If you code see the logs below, they all are merged and not separate for each tests. My requirement is to get these logs separately for each test cases. I am getting all these logs by implementing a listener. 

 

 

Beginning executing Suite DemoSuite

 

Beginning executing Test:  Demo Tests

 

Ticket ID:  100

 

Ticket ID:  100

 

Ticket ID:  100

 

Test Name:  regression..DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Assertions:  jhjgh

 

Description:  Demo test

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Test Creator:  

 

Assertions:  jhjgh

 

Additional Notes:  

 

Description:  Demo test

 

Query Input:  

 

Assertions:  jhjgh

 

Test Creator:  

 

Description:  Demo test

 

Additional Notes:  

 

Test Creator:  

 

Query Input:  

 

Additional Notes:  

 

Query Input:  

 

Unique ID:  160985857

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Unique ID:  129046802

 

Unique ID:  145678790

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Test Status final:  Pass

 

Test Status final:  Pass

 

Test Status final:  Pass

 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.135 s - in TestSuite

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.549 s

[INFO] Finished at: 2018-05-31T11:07:31+05:30

[INFO] Final Memory: 30M/386M

[INFO] ------------------------------------------------------------------------

 

Process finished with exit code 0 

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/

 

From: <<a href="javascript:" target="_blank">testng...@...> on behalf of Rejish R <<a href="javascript:" target="_blank">rejis...@...>
Reply-To: <<a href="javascript:" target="_blank">testng...@...>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <<a href="javascript:" target="_blank">testng...@...>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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 <a href="javascript:" target="_blank">testng-users...@....
To post to this group, send email to <a href="javascript:" target="_blank">testng...@....
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: dataprovider(parallel=true): not able to group the logs of each testcase individually.

Rejish R
Hi Krishnan,

I shared my code with you!!

Thanks,
Rejish 

On Thursday, May 31, 2018 at 11:29:28 AM UTC+5:30, Krishnan Mahadevan wrote:

Not much can be done by the code snippet you shared.

Please help share a complete example that we can run at our end to see what’s going on.

Without that, it’s going to be hard to even take a guess.

 

 

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/

 

From: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nusHUgt3AAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...> on behalf of Rejish R <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nusHUgt3AAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rejis...@...>
Reply-To: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nusHUgt3AAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Date: Thursday, May 31, 2018 at 11:26 AM
To: testng-users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="nusHUgt3AAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

My comments are in inline. Do let me know, if that looks good.

 

-Thanks
On Thursday, May 31, 2018 at 8:55:16 AM UTC+5:30, Krishnan Mahadevan wrote:

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]

[REJISH]: 6.14.3 

  1. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]

[REJISH]: I have created a new annotation "TestDescription" where in I am having a field "tags" and passing list of string to it. Based on the tags value, in my data provider, I am filtering data and sending the appropriate data to the test cases.

@TestDescription(ticketId = "100", testName = "Demo test", description = "Demo test", assertions = "jhjgh", testCreator = "")
public class DemoTest extends BaseTest {

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
   
@TestDescription(ticketId = "100", testName = "FirstTest", description = "", assertions = "",tags = {"delhi","bangalore"}, testCreator = "")
   
public void validateFirstTest(Map<String, String> testParam) {
        System.
out.println("testParam inside validateFirstTest: "+ testParam);
   
}

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
    @TestDescription(ticketId = "101", testName = "SecondTest", description = "", assertions = "",tags = {"mumbai","bangalore"}, testCreator = "")
    public void validateSecondTest(Map<String, String> testParam) {
        System.out.println("testParam inside validateSecondTest: "+ testParam);
    }
}

 

 

  1. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

[Rejish]:  If you code see the logs below, they all are merged and not separate for each tests. My requirement is to get these logs separately for each test cases. I am getting all these logs by implementing a listener. 

 

 

Beginning executing Suite DemoSuite

 

Beginning executing Test:  Demo Tests

 

Ticket ID:  100

 

Ticket ID:  100

 

Ticket ID:  100

 

Test Name:  regression..DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Assertions:  jhjgh

 

Description:  Demo test

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Test Creator:  

 

Assertions:  jhjgh

 

Additional Notes:  

 

Description:  Demo test

 

Query Input:  

 

Assertions:  jhjgh

 

Test Creator:  

 

Description:  Demo test

 

Additional Notes:  

 

Test Creator:  

 

Query Input:  

 

Additional Notes:  

 

Query Input:  

 

Unique ID:  160985857

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Unique ID:  129046802

 

Unique ID:  145678790

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Test Status final:  Pass

 

Test Status final:  Pass

 

Test Status final:  Pass

 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.135 s - in TestSuite

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.549 s

[INFO] Finished at: 2018-05-31T11:07:31+05:30

[INFO] Final Memory: 30M/386M

[INFO] ------------------------------------------------------------------------

 

Process finished with exit code 0 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <[hidden email]>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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 testng-users...@googlegroups.com.
To post to this group, send email to [hidden email].
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="nusHUgt3AAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="nusHUgt3AAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@....
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: dataprovider(parallel=true): not able to group the logs of each testcase individually.

⇜Krishnan Mahadevan⇝

Rejish,

I looked at your code and I don’t see any problems with TestNG.

If your confusion is based on the console logging that is done via Reporter.log() in your listener, then please be advised that, that is not a proper way of cross checking the logs with their corresponding test methods.

 

Instead have your com.test.testng.TestListener implement org.testng.ITestListener, have its onFinish(ITestContext) implementation look like below:

 

@Override
public void onFinish(ITestContext context) {
 
for(ITestResult result : context.getPassedTests().getAllResults()) {
    String methodname = result.getMethod().getMethodName();
    List<String> logs = Reporter.getOutput(result);
    System.
err.println("==========================================");
    System.
err.println("Logs for method :" + methodname + "()");
    System.
err.println("==========================================");
    logs.forEach(System.
err::println);
    System.
err.println("\n\n");
  }
}

 

Also don’t forget to flip all Reporter.log(text, true) to Reporter.log(text, false).

 

Run your test code and then check if the output is as per your expectations.

 

If you feel it’s still a problem, please log a bug here : https://github.com/cbeust/testng/issues and attach the sample project along with the expected and actual behavior.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 5:41 PM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi Krishnan,

 

I shared my code with you!!

 

Thanks,

Rejish 

On Thursday, May 31, 2018 at 11:29:28 AM UTC+5:30, Krishnan Mahadevan wrote:

Not much can be done by the code snippet you shared.

Please help share a complete example that we can run at our end to see what’s going on.

Without that, it’s going to be hard to even take a guess.

 

 

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/

 

From: <<a href="javascript:" target="_blank">testng...@...> on behalf of Rejish R <<a href="javascript:" target="_blank">rejis...@...>
Reply-To: <<a href="javascript:" target="_blank">testng...@...>
Date: Thursday, May 31, 2018 at 11:26 AM
To: testng-users <<a href="javascript:" target="_blank">testng...@...>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

My comments are in inline. Do let me know, if that looks good.

 

-Thanks
On Thursday, May 31, 2018 at 8:55:16 AM UTC+5:30, Krishnan Mahadevan wrote:

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]

[REJISH]: 6.14.3 

  1. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]

[REJISH]: I have created a new annotation "TestDescription" where in I am having a field "tags" and passing list of string to it. Based on the tags value, in my data provider, I am filtering data and sending the appropriate data to the test cases.

@TestDescription(ticketId = "100", testName = "Demo test", description = "Demo test", assertions = "jhjgh", testCreator = "")
public class DemoTest extends BaseTest {

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
   
@TestDescription(ticketId = "100", testName = "FirstTest", description = "", assertions = "",tags = {"delhi","bangalore"}, testCreator = "")
   
public void validateFirstTest(Map<String, String> testParam) {
        System.
out.println("testParam inside validateFirstTest: "+ testParam);
   
}

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
    @TestDescription(ticketId = "101", testName = "SecondTest", description = "", assertions = "",tags = {"mumbai","bangalore"}, testCreator = "")
    public void validateSecondTest(Map<String, String> testParam) {
        System.out.println("testParam inside validateSecondTest: "+ testParam);
    }
}

 

 

  1. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

[Rejish]:  If you code see the logs below, they all are merged and not separate for each tests. My requirement is to get these logs separately for each test cases. I am getting all these logs by implementing a listener. 

 

 

Beginning executing Suite DemoSuite

 

Beginning executing Test:  Demo Tests

 

Ticket ID:  100

 

Ticket ID:  100

 

Ticket ID:  100

 

Test Name:  regression..DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Assertions:  jhjgh

 

Description:  Demo test

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Test Creator:  

 

Assertions:  jhjgh

 

Additional Notes:  

 

Description:  Demo test

 

Query Input:  

 

Assertions:  jhjgh

 

Test Creator:  

 

Description:  Demo test

 

Additional Notes:  

 

Test Creator:  

 

Query Input:  

 

Additional Notes:  

 

Query Input:  

 

Unique ID:  160985857

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Unique ID:  129046802

 

Unique ID:  145678790

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Test Status final:  Pass

 

Test Status final:  Pass

 

Test Status final:  Pass

 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.135 s - in TestSuite

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.549 s

[INFO] Finished at: 2018-05-31T11:07:31+05:30

[INFO] Final Memory: 30M/386M

[INFO] ------------------------------------------------------------------------

 

Process finished with exit code 0 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <[hidden email]>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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 <a href="javascript:" target="_blank">testng-users...@....
To post to this group, send email to <a href="javascript:" target="_blank">testng...@....
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: dataprovider(parallel=true): not able to group the logs of each testcase individually.

Rejish R
Hi Krishnan,

I tried your solution, that works for some extent but when I collect all the logs in onFinish(ITestContext), logs are not shown as part of system-out in Test-TestSuite.xml. Any work around for the same.

Thanks,
Rejish

On Thursday, May 31, 2018 at 6:17:32 PM UTC+5:30, Krishnan Mahadevan wrote:

Rejish,

I looked at your code and I don’t see any problems with TestNG.

If your confusion is based on the console logging that is done via Reporter.log() in your listener, then please be advised that, that is not a proper way of cross checking the logs with their corresponding test methods.

 

Instead have your com.test.testng.TestListener implement org.testng.ITestListener, have its onFinish(ITestContext) implementation look like below:

 

@Override
public void onFinish(ITestContext context) {
 
for(ITestResult result : context.getPassedTests().getAllResults()) {
    String methodname = result.getMethod().getMethodName();
    List<String> logs = Reporter.getOutput(result);
    System.
err.println("==========================================");
    System.
err.println("Logs for method :" + methodname + "()");
    System.
err.println("==========================================");
    logs.forEach(System.
err::println);
    System.
err.println("\n\n");
  }
}

 

Also don’t forget to flip all Reporter.log(text, true) to Reporter.log(text, false).

 

Run your test code and then check if the output is as per your expectations.

 

If you feel it’s still a problem, please log a bug here : <a href="https://github.com/cbeust/testng/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkZFwrR886j6_KMGsK-VN4fP6q5g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkZFwrR886j6_KMGsK-VN4fP6q5g&#39;;return true;">https://github.com/cbeust/testng/issues and attach the sample project along with the expected and actual behavior.

 

 

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/

 

From: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="IyVBAVCNAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...> on behalf of Rejish R <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="IyVBAVCNAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rejis...@...>
Reply-To: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="IyVBAVCNAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Date: Thursday, May 31, 2018 at 5:41 PM
To: testng-users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="IyVBAVCNAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi Krishnan,

 

I shared my code with you!!

 

Thanks,

Rejish 

On Thursday, May 31, 2018 at 11:29:28 AM UTC+5:30, Krishnan Mahadevan wrote:

Not much can be done by the code snippet you shared.

Please help share a complete example that we can run at our end to see what’s going on.

Without that, it’s going to be hard to even take a guess.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 11:26 AM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

My comments are in inline. Do let me know, if that looks good.

 

-Thanks
On Thursday, May 31, 2018 at 8:55:16 AM UTC+5:30, Krishnan Mahadevan wrote:

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]

[REJISH]: 6.14.3 

  1. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]

[REJISH]: I have created a new annotation "TestDescription" where in I am having a field "tags" and passing list of string to it. Based on the tags value, in my data provider, I am filtering data and sending the appropriate data to the test cases.

@TestDescription(ticketId = "100", testName = "Demo test", description = "Demo test", assertions = "jhjgh", testCreator = "")
public class DemoTest extends BaseTest {

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
   
@TestDescription(ticketId = "100", testName = "FirstTest", description = "", assertions = "",tags = {"delhi","bangalore"}, testCreator = "")
   
public void validateFirstTest(Map<String, String> testParam) {
        System.
out.println("testParam inside validateFirstTest: "+ testParam);
   
}

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
    @TestDescription(ticketId = "101", testName = "SecondTest", description = "", assertions = "",tags = {"mumbai","bangalore"}, testCreator = "")
    public void validateSecondTest(Map<String, String> testParam) {
        System.out.println("testParam inside validateSecondTest: "+ testParam);
    }
}

 

 

  1. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

[Rejish]:  If you code see the logs below, they all are merged and not separate for each tests. My requirement is to get these logs separately for each test cases. I am getting all these logs by implementing a listener. 

 

 

Beginning executing Suite DemoSuite

 

Beginning executing Test:  Demo Tests

 

Ticket ID:  100

 

Ticket ID:  100

 

Ticket ID:  100

 

Test Name:  regression..DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Assertions:  jhjgh

 

Description:  Demo test

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Test Creator:  

 

Assertions:  jhjgh

 

Additional Notes:  

 

Description:  Demo test

 

Query Input:  

 

Assertions:  jhjgh

 

Test Creator:  

 

Description:  Demo test

 

Additional Notes:  

 

Test Creator:  

 

Query Input:  

 

Additional Notes:  

 

Query Input:  

 

Unique ID:  160985857

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Unique ID:  129046802

 

Unique ID:  145678790

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Test Status final:  Pass

 

Test Status final:  Pass

 

Test Status final:  Pass

 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.135 s - in TestSuite

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.549 s

[INFO] Finished at: 2018-05-31T11:07:31+05:30

[INFO] Final Memory: 30M/386M

[INFO] ------------------------------------------------------------------------

 

Process finished with exit code 0 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <[hidden email]>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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 testng-users...@googlegroups.com.
To post to this group, send email to [hidden email].
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 testng-users...@googlegroups.com.
To post to this group, send email to [hidden email].
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="IyVBAVCNAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="IyVBAVCNAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@....
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: dataprovider(parallel=true): not able to group the logs of each testcase individually.

⇜Krishnan Mahadevan⇝
Instead of using sysout you should be using Reporter.log(). That should take care of your issues. 

On Fri 1 Jun, 2018, 11:08 Rejish R, <[hidden email]> wrote:
Hi Krishnan,

I tried your solution, that works for some extent but when I collect all the logs in onFinish(ITestContext), logs are not shown as part of system-out in Test-TestSuite.xml. Any work around for the same.

Thanks,
Rejish

On Thursday, May 31, 2018 at 6:17:32 PM UTC+5:30, Krishnan Mahadevan wrote:

Rejish,

I looked at your code and I don’t see any problems with TestNG.

If your confusion is based on the console logging that is done via Reporter.log() in your listener, then please be advised that, that is not a proper way of cross checking the logs with their corresponding test methods.

 

Instead have your com.test.testng.TestListener implement org.testng.ITestListener, have its onFinish(ITestContext) implementation look like below:

 

@Override
public void onFinish(ITestContext context) {
 
for(ITestResult result : context.getPassedTests().getAllResults()) {
    String methodname = result.getMethod().getMethodName();
    List<String> logs = Reporter.getOutput(result);
    System.
err.println("==========================================");
    System.
err.println("Logs for method :" + methodname + "()");
    System.
err.println("==========================================");
    logs.forEach(System.
err::println);
    System.
err.println("\n\n");
  }
}

 

Also don’t forget to flip all Reporter.log(text, true) to Reporter.log(text, false).

 

Run your test code and then check if the output is as per your expectations.

 

If you feel it’s still a problem, please log a bug here : https://github.com/cbeust/testng/issues and attach the sample project along with the expected and actual behavior.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 5:41 PM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi Krishnan,

 

I shared my code with you!!

 

Thanks,

Rejish 

On Thursday, May 31, 2018 at 11:29:28 AM UTC+5:30, Krishnan Mahadevan wrote:

Not much can be done by the code snippet you shared.

Please help share a complete example that we can run at our end to see what’s going on.

Without that, it’s going to be hard to even take a guess.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 11:26 AM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

My comments are in inline. Do let me know, if that looks good.

 

-Thanks
On Thursday, May 31, 2018 at 8:55:16 AM UTC+5:30, Krishnan Mahadevan wrote:

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]

[REJISH]: 6.14.3 

  1. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]

[REJISH]: I have created a new annotation "TestDescription" where in I am having a field "tags" and passing list of string to it. Based on the tags value, in my data provider, I am filtering data and sending the appropriate data to the test cases.

@TestDescription(ticketId = "100", testName = "Demo test", description = "Demo test", assertions = "jhjgh", testCreator = "")
public class DemoTest extends BaseTest {

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
   
@TestDescription(ticketId = "100", testName = "FirstTest", description = "", assertions = "",tags = {"delhi","bangalore"}, testCreator = "")
   
public void validateFirstTest(Map<String, String> testParam) {
        System.
out.println("testParam inside validateFirstTest: "+ testParam);
   
}

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
    @TestDescription(ticketId = "101", testName = "SecondTest", description = "", assertions = "",tags = {"mumbai","bangalore"}, testCreator = "")
    public void validateSecondTest(Map<String, String> testParam) {
        System.out.println("testParam inside validateSecondTest: "+ testParam);
    }
}

 

 

  1. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

[Rejish]:  If you code see the logs below, they all are merged and not separate for each tests. My requirement is to get these logs separately for each test cases. I am getting all these logs by implementing a listener. 

 

 

Beginning executing Suite DemoSuite

 

Beginning executing Test:  Demo Tests

 

Ticket ID:  100

 

Ticket ID:  100

 

Ticket ID:  100

 

Test Name:  regression..DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Assertions:  jhjgh

 

Description:  Demo test

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Test Creator:  

 

Assertions:  jhjgh

 

Additional Notes:  

 

Description:  Demo test

 

Query Input:  

 

Assertions:  jhjgh

 

Test Creator:  

 

Description:  Demo test

 

Additional Notes:  

 

Test Creator:  

 

Query Input:  

 

Additional Notes:  

 

Query Input:  

 

Unique ID:  160985857

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Unique ID:  129046802

 

Unique ID:  145678790

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Test Status final:  Pass

 

Test Status final:  Pass

 

Test Status final:  Pass

 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.135 s - in TestSuite

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.549 s

[INFO] Finished at: 2018-05-31T11:07:31+05:30

[INFO] Final Memory: 30M/386M

[INFO] ------------------------------------------------------------------------

 

Process finished with exit code 0 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <[hidden email]>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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.

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

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/

--
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: dataprovider(parallel=true): not able to group the logs of each testcase individually.

Rejish R
Reporter.log() is showing the log in console output  but it is not adding to Test-TestSuite.xml. How to get it there 

This is what I have done:
@Override
public void onFinish(ITestContext iTestContext) {
for (ITestResult failedTests : iTestContext.getFailedTests().getAllResults()) {
String methodname = failedTests.getMethod().getMethodName();
List<String> logs = Reporter.getOutput(failedTests);
System.err.println("==========================================");
System.err.println("Logs for method :" + methodname + "()");
System.err.println("==========================================");
for (String log : logs) {
Reporter.log(log, true);
}
/*logs.forEach(System.out::println);
System.out.println("\n\n");*/
}
}


On Fri, Jun 1, 2018 at 11:11 AM ⇜Krishnan Mahadevan⇝ <[hidden email]> wrote:
Instead of using sysout you should be using Reporter.log(). That should take care of your issues. 

On Fri 1 Jun, 2018, 11:08 Rejish R, <[hidden email]> wrote:
Hi Krishnan,

I tried your solution, that works for some extent but when I collect all the logs in onFinish(ITestContext), logs are not shown as part of system-out in Test-TestSuite.xml. Any work around for the same.

Thanks,
Rejish

On Thursday, May 31, 2018 at 6:17:32 PM UTC+5:30, Krishnan Mahadevan wrote:

Rejish,

I looked at your code and I don’t see any problems with TestNG.

If your confusion is based on the console logging that is done via Reporter.log() in your listener, then please be advised that, that is not a proper way of cross checking the logs with their corresponding test methods.

 

Instead have your com.test.testng.TestListener implement org.testng.ITestListener, have its onFinish(ITestContext) implementation look like below:

 

@Override
public void onFinish(ITestContext context) {
 
for(ITestResult result : context.getPassedTests().getAllResults()) {
    String methodname = result.getMethod().getMethodName();
    List<String> logs = Reporter.getOutput(result);
    System.
err.println("==========================================");
    System.
err.println("Logs for method :" + methodname + "()");
    System.
err.println("==========================================");
    logs.forEach(System.
err::println);
    System.
err.println("\n\n");
  }
}

 

Also don’t forget to flip all Reporter.log(text, true) to Reporter.log(text, false).

 

Run your test code and then check if the output is as per your expectations.

 

If you feel it’s still a problem, please log a bug here : https://github.com/cbeust/testng/issues and attach the sample project along with the expected and actual behavior.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 5:41 PM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi Krishnan,

 

I shared my code with you!!

 

Thanks,

Rejish 

On Thursday, May 31, 2018 at 11:29:28 AM UTC+5:30, Krishnan Mahadevan wrote:

Not much can be done by the code snippet you shared.

Please help share a complete example that we can run at our end to see what’s going on.

Without that, it’s going to be hard to even take a guess.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 11:26 AM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

My comments are in inline. Do let me know, if that looks good.

 

-Thanks
On Thursday, May 31, 2018 at 8:55:16 AM UTC+5:30, Krishnan Mahadevan wrote:

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]

[REJISH]: 6.14.3 

  1. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]

[REJISH]: I have created a new annotation "TestDescription" where in I am having a field "tags" and passing list of string to it. Based on the tags value, in my data provider, I am filtering data and sending the appropriate data to the test cases.

@TestDescription(ticketId = "100", testName = "Demo test", description = "Demo test", assertions = "jhjgh", testCreator = "")
public class DemoTest extends BaseTest {

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
   
@TestDescription(ticketId = "100", testName = "FirstTest", description = "", assertions = "",tags = {"delhi","bangalore"}, testCreator = "")
   
public void validateFirstTest(Map<String, String> testParam) {
        System.
out.println("testParam inside validateFirstTest: "+ testParam);
   
}

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
    @TestDescription(ticketId = "101", testName = "SecondTest", description = "", assertions = "",tags = {"mumbai","bangalore"}, testCreator = "")
    public void validateSecondTest(Map<String, String> testParam) {
        System.out.println("testParam inside validateSecondTest: "+ testParam);
    }
}

 

 

  1. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

[Rejish]:  If you code see the logs below, they all are merged and not separate for each tests. My requirement is to get these logs separately for each test cases. I am getting all these logs by implementing a listener. 

 

 

Beginning executing Suite DemoSuite

 

Beginning executing Test:  Demo Tests

 

Ticket ID:  100

 

Ticket ID:  100

 

Ticket ID:  100

 

Test Name:  regression..DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Assertions:  jhjgh

 

Description:  Demo test

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Test Creator:  

 

Assertions:  jhjgh

 

Additional Notes:  

 

Description:  Demo test

 

Query Input:  

 

Assertions:  jhjgh

 

Test Creator:  

 

Description:  Demo test

 

Additional Notes:  

 

Test Creator:  

 

Query Input:  

 

Additional Notes:  

 

Query Input:  

 

Unique ID:  160985857

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Unique ID:  129046802

 

Unique ID:  145678790

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Test Status final:  Pass

 

Test Status final:  Pass

 

Test Status final:  Pass

 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.135 s - in TestSuite

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.549 s

[INFO] Finished at: 2018-05-31T11:07:31+05:30

[INFO] Final Memory: 30M/386M

[INFO] ------------------------------------------------------------------------

 

Process finished with exit code 0 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <[hidden email]>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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.

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

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/

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

Re: dataprovider(parallel=true): not able to group the logs of each testcase individually.

⇜Krishnan Mahadevan⇝

I am not quite sure I understand the problem here.

The xml file that you are referring to, is basically a junit compliant report. I don’t think in junit reports the logs are supposed to be included.

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Friday, June 1, 2018 at 12:38 PM
To: <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Reporter.log() is showing the log in console output  but it is not adding to Test-TestSuite.xml. How to get it there 



This is what I have done:

@Override
public void onFinish(ITestContext iTestContext) {
   
for (ITestResult failedTests : iTestContext.getFailedTests().getAllResults()) {
        String methodname = failedTests.getMethod().getMethodName()
;
       
List<String> logs = Reporter.getOutput(failedTests);
       
System.err.println("==========================================");
       
System.err.println("Logs for method :" + methodname + "()");
       
System.err.println("==========================================");
        for
(String log : logs) {
            Reporter.log(log
, true);
       
}
       
/*logs.forEach(System.out::println);
        System.out.println("\n\n");*/
   
}
}



 

On Fri, Jun 1, 2018 at 11:11 AM Krishnan Mahadevan <[hidden email]> wrote:

Instead of using sysout you should be using Reporter.log(). That should take care of your issues. 

On Fri 1 Jun, 2018, 11:08 Rejish R, <[hidden email]> wrote:

Hi Krishnan,

 

I tried your solution, that works for some extent but when I collect all the logs in onFinish(ITestContext), logs are not shown as part of system-out in Test-TestSuite.xml. Any work around for the same.

Thanks,

Rejish

 

On Thursday, May 31, 2018 at 6:17:32 PM UTC+5:30, Krishnan Mahadevan wrote:

Rejish,

I looked at your code and I don’t see any problems with TestNG.

If your confusion is based on the console logging that is done via Reporter.log() in your listener, then please be advised that, that is not a proper way of cross checking the logs with their corresponding test methods.

 

Instead have your com.test.testng.TestListener implement org.testng.ITestListener, have its onFinish(ITestContext) implementation look like below:

 

@Override
public void onFinish(ITestContext context) {
 
for(ITestResult result : context.getPassedTests().getAllResults()) {
    String methodname = result.getMethod().getMethodName();
    List<String> logs = Reporter.getOutput(result);
    System.
err.println("==========================================");
    System.
err.println("Logs for method :" + methodname + "()");
    System.
err.println("==========================================");
    logs.forEach(System.
err::println);
    System.
err.println("\n\n");
  }
}

 

Also don’t forget to flip all Reporter.log(text, true) to Reporter.log(text, false).

 

Run your test code and then check if the output is as per your expectations.

 

If you feel it’s still a problem, please log a bug here : https://github.com/cbeust/testng/issues and attach the sample project along with the expected and actual behavior.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 5:41 PM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi Krishnan,

 

I shared my code with you!!

 

Thanks,

Rejish 

On Thursday, May 31, 2018 at 11:29:28 AM UTC+5:30, Krishnan Mahadevan wrote:

Not much can be done by the code snippet you shared.

Please help share a complete example that we can run at our end to see what’s going on.

Without that, it’s going to be hard to even take a guess.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 11:26 AM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

My comments are in inline. Do let me know, if that looks good.

 

-Thanks
On Thursday, May 31, 2018 at 8:55:16 AM UTC+5:30, Krishnan Mahadevan wrote:

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]

[REJISH]: 6.14.3 

  1. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]

[REJISH]: I have created a new annotation "TestDescription" where in I am having a field "tags" and passing list of string to it. Based on the tags value, in my data provider, I am filtering data and sending the appropriate data to the test cases.

@TestDescription(ticketId = "100", testName = "Demo test", description = "Demo test", assertions = "jhjgh", testCreator = "")
public class DemoTest extends BaseTest {

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
   
@TestDescription(ticketId = "100", testName = "FirstTest", description = "", assertions = "",tags = {"delhi","bangalore"}, testCreator = "")
   
public void validateFirstTest(Map<String, String> testParam) {
        System.
out.println("testParam inside validateFirstTest: "+ testParam);
   
}

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
    @TestDescription(ticketId = "101", testName = "SecondTest", description = "", assertions = "",tags = {"mumbai","bangalore"}, testCreator = "")
    public void validateSecondTest(Map<String, String> testParam) {
        System.out.println("testParam inside validateSecondTest: "+ testParam);
    }
}

 

 

  1. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

[Rejish]:  If you code see the logs below, they all are merged and not separate for each tests. My requirement is to get these logs separately for each test cases. I am getting all these logs by implementing a listener. 

 

 

Beginning executing Suite DemoSuite

 

Beginning executing Test:  Demo Tests

 

Ticket ID:  100

 

Ticket ID:  100

 

Ticket ID:  100

 

Test Name:  regression..DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Assertions:  jhjgh

 

Description:  Demo test

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Test Creator:  

 

Assertions:  jhjgh

 

Additional Notes:  

 

Description:  Demo test

 

Query Input:  

 

Assertions:  jhjgh

 

Test Creator:  

 

Description:  Demo test

 

Additional Notes:  

 

Test Creator:  

 

Query Input:  

 

Additional Notes:  

 

Query Input:  

 

Unique ID:  160985857

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Unique ID:  129046802

 

Unique ID:  145678790

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Test Status final:  Pass

 

Test Status final:  Pass

 

Test Status final:  Pass

 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.135 s - in TestSuite

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.549 s

[INFO] Finished at: 2018-05-31T11:07:31+05:30

[INFO] Final Memory: 30M/386M

[INFO] ------------------------------------------------------------------------

 

Process finished with exit code 0 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <[hidden email]>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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.

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

--

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/

--
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/85luhy_3u_Q/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.

--
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: dataprovider(parallel=true): not able to group the logs of each testcase individually.

Rejish R
I want the logs to be written to junit report as when we run the tests in Jenkins, it reads junit xml file and shows the failed test cases along with the logs in test result. 

On Saturday, June 2, 2018 at 8:49:50 AM UTC+5:30, Krishnan Mahadevan wrote:

I am not quite sure I understand the problem here.

The xml file that you are referring to, is basically a junit compliant report. I don’t think in junit reports the logs are supposed to be included.

 

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/

 

From: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...> on behalf of Rejish R <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rejis...@...>
Reply-To: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Date: Friday, June 1, 2018 at 12:38 PM
To: <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@...>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Reporter.log() is showing the log in console output  but it is not adding to Test-TestSuite.xml. How to get it there 



This is what I have done:

@Override
public void onFinish(ITestContext iTestContext) {
   
for (ITestResult failedTests : iTestContext.getFailedTests().getAllResults()) {
        String methodname = failedTests.getMethod().getMethodName()
;
       
List<String> logs = Reporter.getOutput(failedTests);
       
System.err.println("==========================================");
       
System.err.println("Logs for method :" + methodname + "()");
       
System.err.println("==========================================");
        for
(String log : logs) {
            Reporter.log(log
, true);
       
}
       
/*logs.forEach(System.out::println);
        System.out.println("\n\n");*/
   
}
}



 

On Fri, Jun 1, 2018 at 11:11 AM Krishnan Mahadevan <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">krishnan.ma...@gmail.com> wrote:

Instead of using sysout you should be using Reporter.log(). That should take care of your issues. 

On Fri 1 Jun, 2018, 11:08 Rejish R, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">rejis...@...> wrote:

Hi Krishnan,

 

I tried your solution, that works for some extent but when I collect all the logs in onFinish(ITestContext), logs are not shown as part of system-out in Test-TestSuite.xml. Any work around for the same.

Thanks,

Rejish

 

On Thursday, May 31, 2018 at 6:17:32 PM UTC+5:30, Krishnan Mahadevan wrote:

Rejish,

I looked at your code and I don’t see any problems with TestNG.

If your confusion is based on the console logging that is done via Reporter.log() in your listener, then please be advised that, that is not a proper way of cross checking the logs with their corresponding test methods.

 

Instead have your com.test.testng.TestListener implement org.testng.ITestListener, have its onFinish(ITestContext) implementation look like below:

 

@Override
public void onFinish(ITestContext context) {
 
for(ITestResult result : context.getPassedTests().getAllResults()) {
    String methodname = result.getMethod().getMethodName();
    List<String> logs = Reporter.getOutput(result);
    System.
err.println("==========================================");
    System.
err.println("Logs for method :" + methodname + "()");
    System.
err.println("==========================================");
    logs.forEach(System.
err::println);
    System.
err.println("\n\n");
  }
}

 

Also don’t forget to flip all Reporter.log(text, true) to Reporter.log(text, false).

 

Run your test code and then check if the output is as per your expectations.

 

If you feel it’s still a problem, please log a bug here : <a href="https://github.com/cbeust/testng/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkZFwrR886j6_KMGsK-VN4fP6q5g&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbeust%2Ftestng%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEkZFwrR886j6_KMGsK-VN4fP6q5g&#39;;return true;">https://github.com/cbeust/testng/issues and attach the sample project along with the expected and actual behavior.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 5:41 PM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi Krishnan,

 

I shared my code with you!!

 

Thanks,

Rejish 

On Thursday, May 31, 2018 at 11:29:28 AM UTC+5:30, Krishnan Mahadevan wrote:

Not much can be done by the code snippet you shared.

Please help share a complete example that we can run at our end to see what’s going on.

Without that, it’s going to be hard to even take a guess.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 11:26 AM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

My comments are in inline. Do let me know, if that looks good.

 

-Thanks
On Thursday, May 31, 2018 at 8:55:16 AM UTC+5:30, Krishnan Mahadevan wrote:

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]

[REJISH]: 6.14.3 

  1. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]

[REJISH]: I have created a new annotation "TestDescription" where in I am having a field "tags" and passing list of string to it. Based on the tags value, in my data provider, I am filtering data and sending the appropriate data to the test cases.

@TestDescription(ticketId = "100", testName = "Demo test", description = "Demo test", assertions = "jhjgh", testCreator = "")
public class DemoTest extends BaseTest {

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
   
@TestDescription(ticketId = "100", testName = "FirstTest", description = "", assertions = "",tags = {"delhi","bangalore"}, testCreator = "")
   
public void validateFirstTest(Map<String, String> testParam) {
        System.
out.println("testParam inside validateFirstTest: "+ testParam);
   
}

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
    @TestDescription(ticketId = "101", testName = "SecondTest", description = "", assertions = "",tags = {"mumbai","bangalore"}, testCreator = "")
    public void validateSecondTest(Map<String, String> testParam) {
        System.out.println("testParam inside validateSecondTest: "+ testParam);
    }
}

 

 

  1. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

[Rejish]:  If you code see the logs below, they all are merged and not separate for each tests. My requirement is to get these logs separately for each test cases. I am getting all these logs by implementing a listener. 

 

 

Beginning executing Suite DemoSuite

 

Beginning executing Test:  Demo Tests

 

Ticket ID:  100

 

Ticket ID:  100

 

Ticket ID:  100

 

Test Name:  regression..DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Assertions:  jhjgh

 

Description:  Demo test

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Test Creator:  

 

Assertions:  jhjgh

 

Additional Notes:  

 

Description:  Demo test

 

Query Input:  

 

Assertions:  jhjgh

 

Test Creator:  

 

Description:  Demo test

 

Additional Notes:  

 

Test Creator:  

 

Query Input:  

 

Additional Notes:  

 

Query Input:  

 

Unique ID:  160985857

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Unique ID:  129046802

 

Unique ID:  145678790

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Test Status final:  Pass

 

Test Status final:  Pass

 

Test Status final:  Pass

 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.135 s - in TestSuite

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.549 s

[INFO] Finished at: 2018-05-31T11:07:31+05:30

[INFO] Final Memory: 30M/386M

[INFO] ------------------------------------------------------------------------

 

Process finished with exit code 0 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <[hidden email]>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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 testng-users...@googlegroups.com.
To post to this group, send email to [hidden email].
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 testng-users...@googlegroups.com.
To post to this group, send email to [hidden email].
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 testng-users...@googlegroups.com.
To post to this group, send email to [hidden email].
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@....
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.

--

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/

--
You received this message because you are subscribed to a topic in the Google Groups "testng-users" group.
To unsubscribe from this topic, visit <a href="https://groups.google.com/d/topic/testng-users/85luhy_3u_Q/unsubscribe" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/topic/testng-users/85luhy_3u_Q/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/testng-users/85luhy_3u_Q/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/testng-users/85luhy_3u_Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@....
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="wx_5uMLUAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">testng...@....
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: dataprovider(parallel=true): not able to group the logs of each testcase individually.

⇜Krishnan Mahadevan⇝
Perhaps you can try using https://github.com/RationaleEmotions/junitreport that I built and see if that helps. 

I built this JUnit schema compliant ( I don't know if this will work fine in tandem with the  Jenkins JUnit plugin though ) reporting listener which does capture the system outs as well. 

Give it a whirl and let me know if that helps. 

On Mon 4 Jun, 2018, 10:50 Rejish R, <[hidden email]> wrote:
I want the logs to be written to junit report as when we run the tests in Jenkins, it reads junit xml file and shows the failed test cases along with the logs in test result. 

On Saturday, June 2, 2018 at 8:49:50 AM UTC+5:30, Krishnan Mahadevan wrote:

I am not quite sure I understand the problem here.

The xml file that you are referring to, is basically a junit compliant report. I don’t think in junit reports the logs are supposed to be included.

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Friday, June 1, 2018 at 12:38 PM
To: <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Reporter.log() is showing the log in console output  but it is not adding to Test-TestSuite.xml. How to get it there 



This is what I have done:

@Override
public void onFinish(ITestContext iTestContext) {
   
for (ITestResult failedTests : iTestContext.getFailedTests().getAllResults()) {
        String methodname = failedTests.getMethod().getMethodName()
;
       
List<String> logs = Reporter.getOutput(failedTests);
       
System.err.println("==========================================");
       
System.err.println("Logs for method :" + methodname + "()");
       
System.err.println("==========================================");
        for
(String log : logs) {
            Reporter.log(log
, true);
       
}
       
/*logs.forEach(System.out::println);
        System.out.println("\n\n");*/
   
}
}



 

On Fri, Jun 1, 2018 at 11:11 AM Krishnan Mahadevan <[hidden email]> wrote:

Instead of using sysout you should be using Reporter.log(). That should take care of your issues. 

On Fri 1 Jun, 2018, 11:08 Rejish R, <[hidden email]> wrote:

Hi Krishnan,

 

I tried your solution, that works for some extent but when I collect all the logs in onFinish(ITestContext), logs are not shown as part of system-out in Test-TestSuite.xml. Any work around for the same.

Thanks,

Rejish

 

On Thursday, May 31, 2018 at 6:17:32 PM UTC+5:30, Krishnan Mahadevan wrote:

Rejish,

I looked at your code and I don’t see any problems with TestNG.

If your confusion is based on the console logging that is done via Reporter.log() in your listener, then please be advised that, that is not a proper way of cross checking the logs with their corresponding test methods.

 

Instead have your com.test.testng.TestListener implement org.testng.ITestListener, have its onFinish(ITestContext) implementation look like below:

 

@Override
public void onFinish(ITestContext context) {
 
for(ITestResult result : context.getPassedTests().getAllResults()) {
    String methodname = result.getMethod().getMethodName();
    List<String> logs = Reporter.getOutput(result);
    System.
err.println("==========================================");
    System.
err.println("Logs for method :" + methodname + "()");
    System.
err.println("==========================================");
    logs.forEach(System.
err::println);
    System.
err.println("\n\n");
  }
}

 

Also don’t forget to flip all Reporter.log(text, true) to Reporter.log(text, false).

 

Run your test code and then check if the output is as per your expectations.

 

If you feel it’s still a problem, please log a bug here : https://github.com/cbeust/testng/issues and attach the sample project along with the expected and actual behavior.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 5:41 PM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi Krishnan,

 

I shared my code with you!!

 

Thanks,

Rejish 

On Thursday, May 31, 2018 at 11:29:28 AM UTC+5:30, Krishnan Mahadevan wrote:

Not much can be done by the code snippet you shared.

Please help share a complete example that we can run at our end to see what’s going on.

Without that, it’s going to be hard to even take a guess.

 

 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, May 31, 2018 at 11:26 AM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

My comments are in inline. Do let me know, if that looks good.

 

-Thanks
On Thursday, May 31, 2018 at 8:55:16 AM UTC+5:30, Krishnan Mahadevan wrote:

Can you please help share the following?

 

  1. TestNG version being used [ Please try and use v6.14.3 which is the latest released version as of today]

[REJISH]: 6.14.3 

  1. Sample test code that can be used to reproduce the problem [ Please help keep the sample simple and exclude any 3rd party library dependencies so that it’s easy to run it]

[REJISH]: I have created a new annotation "TestDescription" where in I am having a field "tags" and passing list of string to it. Based on the tags value, in my data provider, I am filtering data and sending the appropriate data to the test cases.

@TestDescription(ticketId = "100", testName = "Demo test", description = "Demo test", assertions = "jhjgh", testCreator = "")
public class DemoTest extends BaseTest {

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
   
@TestDescription(ticketId = "100", testName = "FirstTest", description = "", assertions = "",tags = {"delhi","bangalore"}, testCreator = "")
   
public void validateFirstTest(Map<String, String> testParam) {
        System.
out.println("testParam inside validateFirstTest: "+ testParam);
   
}

   
@Test(dataProvider = "CsvDataProvider", dataProviderClass = CSVDataProvider.class, description = "validating geocode location")
    @TestDescription(ticketId = "101", testName = "SecondTest", description = "", assertions = "",tags = {"mumbai","bangalore"}, testCreator = "")
    public void validateSecondTest(Map<String, String> testParam) {
        System.out.println("testParam inside validateSecondTest: "+ testParam);
    }
}

 

 

  1. What is the expected behavior that you are looking for and what is the actual behavior that you are seeing.

[Rejish]:  If you code see the logs below, they all are merged and not separate for each tests. My requirement is to get these logs separately for each test cases. I am getting all these logs by implementing a listener. 

 

 

Beginning executing Suite DemoSuite

 

Beginning executing Test:  Demo Tests

 

Ticket ID:  100

 

Ticket ID:  100

 

Ticket ID:  100

 

Test Name:  regression..DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Assertions:  jhjgh

 

Description:  Demo test

 

Test Name:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Test Creator:  

 

Assertions:  jhjgh

 

Additional Notes:  

 

Description:  Demo test

 

Query Input:  

 

Assertions:  jhjgh

 

Test Creator:  

 

Description:  Demo test

 

Additional Notes:  

 

Test Creator:  

 

Query Input:  

 

Additional Notes:  

 

Query Input:  

 

Unique ID:  160985857

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

Unique ID:  129046802

 

Unique ID:  145678790

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Executing following method:  regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

testParam inside validateFirstTest: {q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

testParam inside validateFirstTest: {q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=mumbai, at=18.94017,72.83486, maxresults=20, language=en_us, TAG=Mumbai,Bangalore, expectedLUID=axft26bA91Z14T27hsZk8A, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=delhi, at=28.63412,77.21692, maxresults=20, language=en_us, TAG=Delhi, expectedLUID=BIsrRKx1T5MRNVrU3XcfIB, expectedCountryCode=IND}

 

Finished executing following method: regression.DemoTest.validateFirstTest_FirstTest_{q=bengaluru, at=12.96686,77.58743, maxresults=20, language=en_us, TAG=Bangalore, expectedLUID=BkvqobAmSRPVFB7e3HoZpD, expectedCountryCode=IND}

 

Test Status final:  Pass

 

Test Status final:  Pass

 

Test Status final:  Pass

 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.135 s - in TestSuite

[INFO] 

[INFO] Results:

[INFO] 

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.549 s

[INFO] Finished at: 2018-05-31T11:07:31+05:30

[INFO] Final Memory: 30M/386M

[INFO] ------------------------------------------------------------------------

 

Process finished with exit code 0 

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/

 

From: <[hidden email]> on behalf of Rejish R <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, May 30, 2018 at 8:21 PM
To: testng-users <[hidden email]>
Subject: [testng-users] dataprovider(parallel=true): not able to group the logs of each testcase individually.

 

Hi,

 

I am having multiple test methods within a class with each method calling the same data provider(parallel=true) with different conditions for data. Tests are running in parallel successfully. But while collecting the logs with in a listener, observed that the logs are captured one after other that is, it is not grouped. Do we have any option like "group-by-instances" to group them.

 

Note: @Factory is not being used here

 

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.

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

--

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/

--
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/85luhy_3u_Q/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.

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

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/

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