Create testng.xml dynamically and run tests with this temp xml - How is the structure include capabilities ?

85 views
Skip to first unread message

eyal rest

unread,
May 28, 2019, 9:17:29 AM5/28/19
to testng-users
Hi ,

I need to create testng.xml dynamically with code and then run the tests through it,
How can I do it ?

Thanks

⇜Krishnan Mahadevan⇝

unread,
May 29, 2019, 12:12:43 AM5/29/19
to testng...@googlegroups.com
Spend sometime taking a look at this test class within the TestNG codebase: https://github.com/cbeust/testng/blob/master/src/test/java/test/SimpleBaseTest.java 

It has all samples that you would ever need when working with a programmatically created suite xml file.

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 Scribblings @ https://rationaleemotions.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 testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/7da0d6b5-d01b-425c-b8ed-4f780bae198a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

eyal rest

unread,
Jun 3, 2019, 4:10:18 AM6/3/19
to testng-users
Hi ,

I ment How can Ifullt create testng.xml with Java code ?
I want to create it before the tests in order to pass the parameters of the testng.xmlto the tests,

בתאריך יום רביעי, 29 במאי 2019 בשעה 07:12:43 UTC+3, מאת Krishnan Mahadevan:
Spend sometime taking a look at this test class within the TestNG codebase: https://github.com/cbeust/testng/blob/master/src/test/java/test/SimpleBaseTest.java 

It has all samples that you would ever need when working with a programmatically created suite xml file.

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 Scribblings @ https://rationaleemotions.com/


On Tue, May 28, 2019 at 6:47 PM eyal rest <rest...@gmail.com> wrote:
Hi ,

I need to create testng.xml dynamically with code and then run the tests through it,
How can I do it ?

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...@googlegroups.com.

Krishnan Mahadevan

unread,
Jun 3, 2019, 12:40:18 PM6/3/19
to testng...@googlegroups.com

You don’t need to do all of that if all you want is to be able to pass in dynamic values to the parameters that was defined by you in your suite xml.

 

Take a look at this blog of mine to learn how to do it easily : https://rationaleemotions.com/dynamic_parameterization_in_testng/

 

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

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 testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.

Reply all
Reply to author
Forward
0 new messages