Forum Discussion
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
Thanks for your suggestion.
def project = messageExchange.modelItem.testStep.testCase.testSuite.project
project.getTestSuiteByName("Test Suite Name").setPropertyValue("propertyName", "Property Value")
I copied into a groovy script test step
I replaced "Test Suite Name" with the name of one of my test suites
I replaced “propertyName” with the name of a property within that test suite.
The entire script now reads as follows:
-----------------------------
def project = messageExchange.modelItem.testStep.testCase.testSuite.project
project.getTestSuiteByName("RetrieveSecretsFromKeyVault").setPropertyValue("Token3", "xxx")
-----------------------------
I get the following error:
groovy.lang.MissingPropertyException:No such property:messageExchange for class: Script5 error at line: 1.
Am I missing something ? TIA for your help!
Related Content
- 12 years ago
Recent Discussions
- 18 days ago