Forum Discussion
nmrao
Champion Level 3
Little confused with above.
What is your use case?
What is your use case?
depstein
7 years agoNew Contributor
Rao,
Here is a simplified structure of my project:
Project
--SuiteA
----CaseA
------StepA
--SuiteB
----CaseB
------StepB
StepA and StepB are Groovy scripts, and they are located in different test cases inside different test suites within the same project.
With me so far?
I want to call StepB from StepA. I could do it like this:
def stepB = testRunner.testCase.testSuite.project.testSuites['SuiteB'].
testCases['CaseB'].testSteps['StepB']
stepB.run(testRunner, context)
So now I am inside StepB, and I want to get at its own test case (CaseB). If I do it like this:
testRunner.testCase
I will get CaseA instead. Why? because testRunner is the test runner that I passed to it from StepA. Same with context.
So my question is, is there a way for me to get at CaseB (or SuiteB) from inside StepB? Other than attaching it to context before I pass it to the script.
Related Content
- 10 years ago
Recent Discussions
- 5 days ago
- 10 days ago