Forum Discussion
Hi sumeet0420 ,
In your TestSuite you can assign value to context variable by below:
context.setProperty("varName", varValue);
And in your TestCase, you can use the value by below:
log.info context.varName
This will not work as TestSuite context is different from TestCase object.
Test Case Context is an instance of TestCaseRunContext while Test Suite Context is an instance of TestSuiteRunContext.
- nmrao5 years agoChampion Level 3I could not related your response to which reply.
Can you provide more details?
Have you tried the given solution before saying this will not work? - JHunt5 years agoCommunity Hero
When you run the test suite, the contents of the TestSuiteRunContext is put into each TestCaseRunContext (both classes are essentially just LinkedHashMaps).
So it should work as Rao described, but ONLY when the test suite is actually being run. When you run individual test cases or steps, the values won't be passed in (even if you have previously run the test suite or test suite set up script previously). See attached.
For a solution that lets you run single test cases and steps manually, you could use Properties on the test suite instead, as these are more permanent. The downside is that Properties can only be strings.
Related Content
- 3 years agosparrowenclave
Recent Discussions
- 2 days agoruchisingh