Forum Discussion
Setting the properties in a groovy script (the method I was previously using) was working fine. These properties are at the testSuite level so that I can access then in Different Testcases. My need has changed and some of the properties need to be set externally from the cmd line instead of in an internal groovy script. This is what is not working. When I look at the log file my property "analysisId" is never being set (I am using the commands listed in my original post). Also the double quotes are needed because the payload string for the website needs to have " " around it that is why i have the string being set with ' ' but contains "analysisIdString" inside of it. That works perfectly fine when set from inside a groovy script in soapUI, it only when trying to set the property from a command line that it is not working. I think the problem is trying to call the property and I am calling it wrong.
I am using "
{
"analysisId": ${#TestSuite#analysisId},
"datasetId": ${#TestSuite#datasetId},
"outputPlotting": ${#TestSuite#outputPlotting},
"truthAnalysis": ${#TestSuite#truthAnalysis},
"truthPlotting": ${#TestSuite#truthPlotting},
"useCases": ${#TestSuite#useCases},
"reports": ${#TestSuite#reports},
"makeCombinedReport": ${#TestSuite#makeCombinedReport},
"reportOutputType": ${#TestSuite#reportOutputType},
"outputDir": ${#TestSuite#outputDir}
}
"
to use all of my properties. Many of these are still set in a groovy which works properly but analysisId needs to be set from the command line and the method above has analysisId as null when I use -PanalysisId = ""MyID"' in the cmd line.
Thank you for you help and sorry for the unclear message earlier.
So I've been working on resolving this issue all morning, and I see in my log file I have this:
2017-01-12 11:45:00,615 INFO [SoapUITestCaseRunner] Setting project property [analysisId] to ['Testing_01_12_17_06']
2017-01-12 11:45:00,616 INFO [SoapUITestCaseRunner] Running SoapUI tests in project [GenerateAnalysisAndReport - REST]
2017-01-12 11:45:00,618 INFO [SoapUITestCaseRunner] Running Project [GenerateAnalysisAndReport - REST], runType = SEQUENTIAL
2017-01-12 11:45:00,634 INFO [SoapUITestCaseRunner] Running SoapUI testcase [RunFromScript]
2017-01-12 11:45:00,634 INFO [SoapUITestCaseRunner] running step [setupPropertiesAndRun]
2017-01-12 11:45:01,073 INFO [log] 2
2017-01-12 11:45:01,073 INFO [log]
If you notice in the first line it tells me it is setting the property. But the last line from this snipit of log file should be outputting the value of "analysisId", which you can see is null. I am outputting this value using this methods:
def analysis_ID = testRunner.testCase.testSuite.project.properties["analysisId"].value
log.info(testRunner.testCase.testSuite.getPropertyValue('dataset'))
log.info(analysis_ID)
so even though it just told me that the property analysisId was set it then comes up null. I have no clue what could be causing this.
Related Content
- 8 years ago
- 5 years ago
- 2 years ago
Recent Discussions
- 2 days ago
- 4 days ago