externalize test group definition

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

externalize test group definition

development
Hi,

I would be interested in externalising the list of tests to execute. 

I already filter out tests using an external file (containing tests to be ignored), using the MethodSelector. Now what I want is to only execute all the tests that are in that file. 



Any suggestions as to where to start?

Best regards,

Baubak


--
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: externalize test group definition

⇜Krishnan Mahadevan⇝

I would suggest that you basically do the following:

 

  1. Make sure you are using TestNG 6.12 (the latest released version at this point)
  2. Build a listener that implements org.testng.IAlterSuiteListener
  3. Now within this listener, you basically add logic which is responsible for reading your external data source (a file in your case) and use that to construct the XmlTest object (which basically represents a <test> tag) and add them to your XmlSuite object (which represents the <suite> tag)
  4. Create a testng suite xml file, which merely contains a reference to the above created listener via the <listeners> tag but has no entries for the <test> tag

 

That should do.

 

For some more details, please refer to my blog post: https://rationaleemotions.wordpress.com/2017/09/29/building-dynamic-testng-suites/

 

 

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 Baubak <[hidden email]>
Reply-To: <[hidden email]>
Date: Wednesday, November 15, 2017 at 3:15 PM
To: testng-users <[hidden email]>
Subject: [testng-users] externalize test group definition

 

Hi,

 

I would be interested in externalising the list of tests to execute. 

 

I already filter out tests using an external file (containing tests to be ignored), using the MethodSelector. Now what I want is to only execute all the tests that are in that file. 

 

 

 

Any suggestions as to where to start?

 

Best regards,

 

Baubak

 

 

--
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: externalize test group definition

development
In reply to this post by development
Thanks a lot Krishnan,

This helps a lot. I managed to get it working. I will post my solution when it is working exactly as I want.

Best regards,

Baubak

On Wednesday, November 15, 2017 at 10:45:15 AM UTC+1, Baubak wrote:
Hi,

I would be interested in externalising the list of tests to execute. 

I already filter out tests using an external file (containing tests to be ignored), using the MethodSelector. Now what I want is to only execute all the tests that are in that file. 



Any suggestions as to where to start?

Best regards,

Baubak


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