rakuAnarchy
15 years agoNew Contributor
Addition of two properties within XML tags
Relatively new to SoapUI; not a Java developer, but experienced with JavaScript;
How can I (or can I) add two properties within an XML tag?
Both properties are set within the scope of the Test Case called 'Batch, Close & Submit'. Ultimately, I'd like to use ${=(int)(Math.rendom()*10)} to dynamically generate a tip amount or be able to dynamically calculate a percentage of the TranAmount instead of the static value I'm trying to use now. Is there a better way to accomplish this?
How can I (or can I) add two properties within an XML tag?
<!--pay:TotalAmount>${=(testRunner.testCase["Properties"].getPropertyValue(TranAmount)+testRunner.testCase["Properties"].getPropertyValue(TipAmount))}</pay:TotalAmount-->yields the following response:
<pay:TotalAmount>${=(context.getTestRunner(testCase["Properties"].getPropertyValue(TranAmount))+context.getTestRunner(testCase["Properties"].getPropertyValue(TipAmount)))}</pay:TotalAmount>
<pay:TotalAmount xmlns:pay="http://ltfinc.net/ltfeb/payment">No such property: Properties for class: com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase
Possible solutions: properties</pay:TotalAmount>
Both properties are set within the scope of the Test Case called 'Batch, Close & Submit'. Ultimately, I'd like to use ${=(int)(Math.rendom()*10)} to dynamically generate a tip amount or be able to dynamically calculate a percentage of the TranAmount instead of the static value I'm trying to use now. Is there a better way to accomplish this?