Solved
Forum Discussion
meinTest
6 years agoOccasional Contributor
Hi Maximus,
you have different issues in your script.
1. you try to set the testStep property. As far as I know you can not do that (it makes no sense because you could also write the value in the same request)
testRunner.testCase.testSteps["Disable"].setPropertyValue('ID', job2)
Therefore use the testCase.setPropertyValue...
2. you try to set the value with the variable 'job2' but job2 is not instantiated and / or is not set in the script you should use job
testRunner.testCase.testSteps["Disable"].setPropertyValue('ID', job2)
Following is a script which should fix your error
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def holder = groovyUtils.getXmlHolder( "getBank#Response" ) for(job in holder.getNodeValues("//*[local-name()='identifier']")){ if (job.contains("70144")){ testRunner.testCase.setPropertyValue('ID', job); testRunner.runTestStepByName("Disable"); }
}
Best regards
meinTest GmbH
SmartBear preferred value-added Service
Provider in the DACH region
- Maximus6 years agoNew Contributor
Hi,
job2 was a typo as I stripped some code from my post before posting and I missed that one, but thank you as stripping out "testSteps["Disable"]" has solved my problem thank you!