Contributions
Re: Need to get dynamically set project variables from command line
Hinmrao, The groovy Script - GetCoupns (part of AddCouponsToACard test-case) is setting a project variable ids. The next test-case RemoveCouponsFromACard is supposed to use the project variable ids.This will be usedin the test-stepRemoveCouponsFromACard. Its like, I can only remove coupon number which I had added. This all works good when I execute the testcase via GUI by click on Play button. I can manually see thet the ids is always updated with a new value, each time the AddCouponsToACard test case is run. The issue comes when I execute AddCouponsToACardby using the command linetestrunner.sh testrunner.sh-sExternal_Web_PROD-cAddCouponsToACard-r -a -f/opt/SOAR_Test/work/External_Web_PROD-I/opt/External_SoapUI_Project/External_Web_Prod.xml With this command line execution,theprojectvariable 'ids' is not being set and hence when RemoveCouponsFromACard is run the 'ids' used is not the one which was used byAddCouponsToACard testrunner.sh-sExternal_Web_PROD-cRemoveCouponsFromACard-r -a -f/opt/SOAR_Test/work/External_Web_PROD-I/opt/External_SoapUI_Project/External_Web_Prod.xml I tried adding another step, a groovy script toRemoveCouponsFromACard test-case, to log the project id it will be using. But unfortunatelythe ids logged was not what AddCouponsToACardhad used. def test = context.expand( '$(#Project#ids}' ) log.info = ("Coupon id picked by the RemoveCouponsFromACard Script =" + test -- Thanks, JASJIT SINGH1.8KViews0likes2CommentsNeed to get dynamically set project variables from command line
Hi Guys!! Need you help. I have a step(groovy script) in 1st test case which extracts and sets project variables. testRunner.testCase.testSuite.project.setPropertyValue("ids", result[-7..-1]); With this I can use the vaue of "ids" in the 2ndtestcase by using ${#Project#ids} All this works good and the end testcase runssucessfully using the prject variabel when I execuet the testcases manually. (that isvia GUI, by clicking on the play button). With GUI interface I can manually check that the project variable is updated by checking the Custom Properties tab. The problem comes when I, execuet the 2nd testcase via command line usingtestrunner.sh. So when I run the 2nd testcase using command line it, seems that it can not refer to the project variable. Or the 1st test case was not able to update the project and set the project value. Can someone guide me if I am missing a step here. Please let me know if you need more information.1.8KViews0likes4Comments