While writing groovy in SOAPUI some times we use context and some times we use TestRunner,
Need help to understand the difference.
The TestRunner is the object that is actually executing the TestCase by cycling through the TestSteps in the TestCase and executing them. It exposes methods related to test execution and the underlying object model (via the testCase property). Common usage scenarios are: using testRunner.
Context holds information about the environment and is required to freely navigate in the mentioned environment. @dmahapatro: context available in groovy scripts in SoapUI is the context of executions of a test case/test suit.
From the documentation:
testRunner - a TestCaseRunner object, which is the entry-point to the soapUI API for accessing project items, results, etc. The testRunner is the object that is actually executing the TestCase by cycling through the TestSteps in the TestCase and executing them. It exposes methods related to test execution and the underlying object model (via the testCase property). Common usage scenarios are:
context - a TestCaseRunContext object holding context-related properties. The main usage for this is to store values that can be used in subsequent TestSteps or related scripts. For example
context.myProperty = "Hello"
will create a property named "myProperty" in the context and assign it the string value "Hello". In a subsequent script, you can access it with
log.info( context.myProperty )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With