Forum Discussion
- jsheph01Contributor
This will update a test suite property from a groovy step. This must be run as a groovy step and not a groovy assertion as you do not have access to test runner.
def project = testRunner.testCase.testSuite.project project.getTestSuiteByName("Test Suite Name").setPropertyValue("propertyName", "Property Value")
- nmraoChampion Level 3Thumb rule is to be able to execute each and every testcase independent.
Not sure of your use case, but better avoid dependency the way currently you have if at possible.- richieCommunity Hero
I remember you saying before that testRunner isn't available in a script assertion - the Groovy Step snippet you provided is as follows:
def project = testRunner.testCase.testSuite.project project.getTestSuiteByName("Test Suite Name").setPropertyValue("propertyName", "Property Value")
if I wanted this in a script assertion - would the following work?
def project = messageExchange.modelItem.testStep.testCase.testSuite.project project.getTestSuiteByName("Test Suite Name").setPropertyValue("propertyName", "Property Value")
UPDATE TO TICKET: - I confirmed the above does work in a script assertion, so I was going to delete this post - but there's no facility to delete my message - so nmrao - no need to answer the question fella - cheers.
Thanks man,
rich
Related Content
- 12 years ago
Recent Discussions
- 8 minutes ago
- 16 days ago