Overriding testNG parameter by Jenkin parameters

41 views
Skip to first unread message

S Kasture

unread,
Dec 2, 2022, 8:59:00 PM12/2/22
to testng-users
StackOverflow Link : https://stackoverflow.com/questions/74622905/overriding-testng-xml-suite-parameter-with-jenkin-parameter-value-through-maven

Trying to override testNG.xml suite parameter with Jenkins parameter value. But values are not getting replaced. Want to replace the testNG parameters with Jenkin parameter. Can someone please guide. Version used TestNG '7.5' and Open JDK '15'

Maven goals : clean compile test -DtestNGXml=${testNGXml} -DenvironmentName=${environmentName} -DenvironmentClientID=${environmentClientID}

TestNG.xml

<suite name="HealthCheck_Suite" parallel="classes" thread-count=“1”> <parameter name="environmentName" value="DEV" /> <parameter name="environmentClientID" value="BE11TEST" /> <test name="iOS_HealthCheck"> <classes> <class name="MobileLoginTest"> <methods> <include name="loginHealthCheckScript" /> </methods> </class> </classes> </test> </suite>

Pom Xml surefire plugin:

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.0.0-M5</version> <configuration> <argLine>-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"</argLine> <suiteXmlFiles> <suiteXmlFile>${testNGXml}</suiteXmlFile> </suiteXmlFiles> </configuration> <dependencies> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>${aspectj.version}</version> <scope>runtime</scope> </dependency> </dependencies> </plugin>```

⇜Krishnan Mahadevan⇝

unread,
Dec 3, 2022, 12:20:44 AM12/3/22
to testng...@googlegroups.com
I have answered your question on stackoverflow. Please check.
Don't forget to accept the answer so that the question gets closed!

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 view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/fba90e7a-b3bb-4703-8615-a70aa9ef2b7en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages