Quantcast

Programmatic vs testng xml

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

Programmatic vs testng xml

sriram krishnan
Hi,
I need some advise on using programmatic way to run the tests vs using testng.xml. 

For large projects that involve multiple test scenarios, I feel programmatic way could help dev avoid dealing with xmls, like creating multiple testng xml.

With wise use of groups and dependency annotation will I be able to get away from using testng xmls or do you advice sticking to testng xmls.

I was thinking of invoking the tests using maven failsafe as 

<include>**/desktop/**/*Test.java</include>
<include>**/mobile-web/**/*Test.java</include>

Thanks,
Sriram 


--
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
|  
Report Content as Inappropriate

Re: Programmatic vs testng xml

⇜Krishnan Mahadevan⇝
Sriram,
Suite XML files are more aimed at establishing some set of constant execution sets. But that doesn't make them static in nature by any standards.
If you resort to leveraging a method selector mechanism via implementing the IMethodSelector interface and then wiring it in (or) you can resort to expressing the method selection mechanism via a BeanShell Script.
Once you have this, you don't need a programmatic way (if your package selection expression is wide enough and covers your entire test code)

So there's no hard and fast recommendation of one approach over the other. IMO you should choose what works for you.
In the case of programmattic way of doing this, I doubt if you would be able to use the surefire plugin because you would have to define a main() method through which you would doing this (or) are you referring to passing in everything as a configuration to the surefire plugin via your pom file (if the latter is true, then you cannot run your tests through an IDE i.e., run more than one test method at the same time)

Hope that helps



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Fri, Feb 3, 2017 at 5:27 AM, sriram krishnan <[hidden email]> wrote:
Hi,
I need some advise on using programmatic way to run the tests vs using testng.xml. 

For large projects that involve multiple test scenarios, I feel programmatic way could help dev avoid dealing with xmls, like creating multiple testng xml.

With wise use of groups and dependency annotation will I be able to get away from using testng xmls or do you advice sticking to testng xmls.

I was thinking of invoking the tests using maven failsafe as 

<include>**/desktop/**/*Test.java</include>
<include>**/mobile-web/**/*Test.java</include>

Thanks,
Sriram 


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