Forum Discussion
Cizo89
10 years agoFrequent Contributor
Hi Leo,
I'll start with your last question - yes, if the TestCase (or TestSuite) doesn't have property called "IP_Address" and you'll use method setPropertyValue(String, String) on it, it will create it and populate it with your specified value.
Back to your problem.
If you have 200 TestCases and want to copy the value from Project property to each TestCase in a TestSuite via a Groovy script, the best way to do this is via TestSuite Setup Script:
Here is an example of a script for Project Setup Script for setting this property to all your TestCases in all our TestSuites:
More info about Setup Scripts can be found here:
http://www.soapui.org/Functional-Testin ... ripts.html
Regards,
Marek
I'll start with your last question - yes, if the TestCase (or TestSuite) doesn't have property called "IP_Address" and you'll use method setPropertyValue(String, String) on it, it will create it and populate it with your specified value.
Back to your problem.
If you have 200 TestCases and want to copy the value from Project property to each TestCase in a TestSuite via a Groovy script, the best way to do this is via TestSuite Setup Script:
for (testCase in testSuite.getTestCaseList()){
testCase.setPropertyValue("IP_Address", testSuite.project.getPropertyValue("IP_Address"))
}
Here is an example of a script for Project Setup Script for setting this property to all your TestCases in all our TestSuites:
for (testSuite in project.getTestSuiteList()){
for (testCase in testSuite.getTestCaseList()){
testCase.setPropertyValue("IP_Address", project.getPropertyValue("IP_Address"))
}
}
More info about Setup Scripts can be found here:
http://www.soapui.org/Functional-Testin ... ripts.html
Regards,
Marek
Related Content
- 4 years agoSuperTester
- 3 years agoCata