Solved
Forum Discussion
jonathon
6 years agoContributor
Yes, it's in the test suite setup - however I open to other ideas if better.
Do I replace TestSuite with my test suite's name? If so how do I handles spaces in the test suite name
richie
6 years agoCommunity Hero
Hi jonathon,
If you use ${#TestSuite#property} you don't need use the testsuite's name...this syntax means 'current testsuite level'.
If you use ${TestSuite#property}, you would replace 'TestSuite' with the testsuite's name.
See the following link https://www.soapui.org/scripting-properties/property-expansion.html
Btw. It should handle spaces in testsuite name just fine....you just need to remember to not add the extra # character in there if youre specifying testsuite name rather than testsuite level
By the way, there's a dynamic scripting option to dynamically create java uuid/guids in your payload rather than using a couple of lines of groovy.
nmrao provided me the info to do this (all cred goes to Rao) the value you need to hardcode in your payload is something like ${=java.util.UUID.randomUUID()}...i'm going to a funeral at moment but i'll check on my laptop when i get back.
Nice one,
Rich
If you use ${#TestSuite#property} you don't need use the testsuite's name...this syntax means 'current testsuite level'.
If you use ${TestSuite#property}, you would replace 'TestSuite' with the testsuite's name.
See the following link https://www.soapui.org/scripting-properties/property-expansion.html
Btw. It should handle spaces in testsuite name just fine....you just need to remember to not add the extra # character in there if youre specifying testsuite name rather than testsuite level
By the way, there's a dynamic scripting option to dynamically create java uuid/guids in your payload rather than using a couple of lines of groovy.
nmrao provided me the info to do this (all cred goes to Rao) the value you need to hardcode in your payload is something like ${=java.util.UUID.randomUUID()}...i'm going to a funeral at moment but i'll check on my laptop when i get back.
Nice one,
Rich
- richie6 years agoCommunity Hero
Hi jonathon
yep = the value you need to specify for the GUID is ${=java.util.UUID.randomUUID()}
so for my payload I have a testcase level property setup on the ehctemplateid attribute in my payload as follows:
{ "name" : "TestCaseNumber003", "ehctemplateid" : "${#TestCase#ehctemplateid}", "ehcstatus" : 814250000, "ehcversion" : "1.0", "countersignature" : false }
and I have a testcase property entitled ehctemplateid with a value of ${=java.util.UUID.randomUUID()}
this will dynamically generate the GUID automatically - I just ran the test and the payload in the RAW request is as follows:
{ "name" : "TestCaseNumber003", "ehctemplateid" : "00b188a2-068c-494f-99d1-8faaa7be6303", "ehcstatus" : 814250000, "ehcversion" : "1.0", "countersignature" : false }
nice one
rich