Change the testng.xml file values during run time using cmd code.

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

Change the testng.xml file values during run time using cmd code.

akash kansal
<test name="Basics">
<parameter name="URL" value=""></parameter>
<parameter name="browserName" value="chrome"></parameter>
<groups>
<run>
<include name="end"></include>--------------------------------------------------Change the value of the name parameter here.
</run>
</groups>
<!-- <packages> <package name="com.magic.testcases"></package> </packages> -->
<classes>
<class name="com.TestClssSecond"></class>
</classes>
</test>

How can i pass the value in this parameter during runtime from cmd

mvn clean test -Dparamname=paramvalue               --------------Not woking for testng.xml

working for pom.xml only.

--
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: Change the testng.xml file values during run time using cmd code.

⇜Krishnan Mahadevan⇝

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 @ http://rationaleemotions.wordpress.com/

On Mon, Jul 16, 2018 at 1:03 PM, akash kansal <[hidden email]> wrote:
<test name="Basics">
<parameter name="URL" value=""></parameter>
<parameter name="browserName" value="chrome"></parameter>
<groups>
<run>
<include name="end"></include>--------------------------------------------------Change the value of the name parameter here.
</run>
</groups>
<!-- <packages> <package name="com.magic.testcases"></package> </packages> -->
<classes>
<class name="com.TestClssSecond"></class>
</classes>
</test>

How can i pass the value in this parameter during runtime from cmd

mvn clean test -Dparamname=paramvalue               --------------Not woking for testng.xml

working for pom.xml only.

--
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: Change the testng.xml file values during run time using cmd code.

akash kansal
Thanks Krishnan Mahadevan . For quick reply as always.

A little bit of search helped me for similar one.

  clean test -Dgroups=groupname

for multiple use comma seprated

  clean test -Dgroups=groupname,groupname2

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