testNG: How to pass class name externally to testNG xml

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

testNG: How to pass class name externally to testNG xml

sunny sachdeva
HI ,

I have huge list of classes which needs to be run. i am using maven surefire plugin and then build is triggered from Jenkins. I am looking for a way where I can pass some regular expression or keyword from jenkins and all the matching classes as per regular expression could be run.

Not sure but want to ask will bean shell script would work in this case? Would appreciate any help.

Thanks
sunny Sachdeva

--
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: testNG: How to pass class name externally to testNG xml

Krishnan Mahadevan
Yes it should because beanshell script is basically a method selector and since it passes you an instance of ITestNGMethod object, you should be able to query this object to figure out the class name to which it belongs to and then apply your regex logic to it.

You can merely specify the packages part in your xml and you should be good. 

Give it a try and let us know what happens.

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 Wed, Jun 21, 2017 at 9:51 AM, sunny sachdeva <[hidden email]> wrote:
HI ,

I have huge list of classes which needs to be run. i am using maven surefire plugin and then build is triggered from Jenkins. I am looking for a way where I can pass some regular expression or keyword from jenkins and all the matching classes as per regular expression could be run.

Not sure but want to ask will bean shell script would work in this case? Would appreciate any help.

Thanks
sunny Sachdeva

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