<suite name ="Smoke Suite" >
<parameter name="cloudUsername" value="Demo"/>
<test name ="Smoke Tests" verbose ="2">
<classes>
<class name ="it.org.techtime.cloud.confluence.apps.googlemapsembed.selenium.smoke.test.SmokeTest"/>
</classes>
</test>
</suite>
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/77e2bb0f-b4c4-41b0-bc26-678e1b215894%40googlegroups.com.
Am going to conveniently assume that there are no typos here ?Your suite file has this defined:<parameter name="cloudUsername" value="Demo"/>So you should be passing it as -DcloudUsername=RANDOMBut your post says you are using something else.You can refer to my blog https://rationaleemotions.com/dynamic_parameterization_in_testng/So its not clear what is not working and working here. Please elaborate what works and what doesnt work for you.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 Wed, Jan 29, 2020 at 5:31 AM Gagandeep Singh <singh....@gmail.com> wrote:
--<suite name ="Smoke Suite" >
<parameter name="cloudUsername" value="Demo"/>
<test name ="Smoke Tests" verbose ="2">
<classes>
<class name ="it.org.techtime.cloud.confluence.apps.googlemapsembed.selenium.smoke.test.SmokeTest"/>
</classes>
</test>
</suite>In the above suite file I have declared "cUserName" at the suite level and when I try to override the value through command-line using the following command atlas-mvn test -PseleniumTestsStandalone -DcUserName=RANDOM, the value doesn't changes. Can anyone please explain why? and how I can achieve this without declaring the parameter at test level!TIA
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.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/fb9b0919-0710-4434-bbb0-caadc6bf67a8%40googlegroups.com.
<suite name ="Smoke Suite" >
<parameter name="cloudUsername" value="Demo"/> You CANT override tis value through command line, remove this tag to override the value.
<test name ="Smoke Tests" verbose ="2">
<parameter name="cloudUsername" value="Demo1"/> You CAN override tis value through command line even if its declared
<classes>
<class name ="it.org.techtime.cloud.confluence.apps.googlemapsembed.selenium.smoke.test.SmokeTest"/>
<parameter name="cloudUsername" value="Demo2"/> You CAN override tis value through command line even if its declared</classes>
</test>
</suite>
I looked at the codebase. TestNG reads the parameter values from JVM arguments if and only if it finds no value in the suite xml file.So for your case, you would need to remove the reference of<parameter name="cloudUsername" value="Demo"/>from your suite file and then try again.To ensure that one is able to alter parameters all the time from JVM arguments (irrespective of whether it was defined or not), I have created an issue https://github.com/cbeust/testng/issues/2238 and also raised a PR to fix this.The fix should be available in the next upcoming release of TestNG (viz., 7.2.0)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/
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/fb9b0919-0710-4434-bbb0-caadc6bf67a8%40googlegroups.com.