Setup Script updates teststep property?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Setup Script updates teststep property?
Hi,
Is it possible to update the test step property from Setup Script? I'm able to update property at test suite level, but not test case , or test step level. Please help. thanks.
Below is the code that i use to update property in test suite.
testSuite.setPropertyValue('myFirstTestSuiteProperty', 'testingProperty')
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi PhilipB:
Please check this http://www.softwaretestinghelp.com/soapui-tutorial-7-properties-in-soapui-groovy-script/ out.
Good luck,
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Kingsmartbear,
the link does not say where the script is used because my script is at "Setup Script" so this "testRunner" is not available at "Setup Script" so is always exception thrown when using it. Thanks.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi PillipB:
Please past following code to you any test case then run it, you should be able to see three custom properties will be generated at three levels which are TestCase, TestSuite and Project :
testRunner.testCase.setPropertyValue( "YourTestCasePropertyName", "ValueForTestCase" )
testRunner.testCase.testSuite.setPropertyValue( "YourTestSuitePropertyName", "ValueForTestSuite" )
testRunner.testCase.testSuite.project.setPropertyValue( "YourProjectPropertyName", "ValueForProject" )
Good luck,
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Kingsmartbear.
Your code works after puting under the TestCase level in Setup Script. For TestSuite and Project level code has exception with testRunner. For now I use Global Property.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, FYI
I had the same problem for test suites, and I just use testSuite in place of testCase:
customProps = testSuite.getPropertyNames();
and it works fine.
