Disable / Enable Objects (setDisabled)

Yes I know it’s annoying to remember these groovy paths. So here it is plane and simple. Plain? Plane? Hey I script, I doesn’t not speelll gud not!
So again you have options to use the getTestStepByName, getTestSuiteByName which I don’t use for two reason. 1. the getWhateverByName is a look up, not that it causes any lagging but I’d rather go direct. 2. using the testSteps, testSuites is much cleaner, the code string is shorter.

From Groovy Test Step

1. Disable Test Step within the same testSuite “
testRunner.testCase.testSteps["testStepName"].setDisabled(true)

2. Disable Test Case within the same testSuite “
testRunner.testCase.testSuite.testCases["testCaseName"].setDisabled(true)

3. Disable a separate testSuite “
testRunner.testCase.testSuite.project.testSuites["testSuiteName"].setDisabled(true)

4. Disable a separate testCase within another testSuite”
testRunner.testCase.testSuite.project.testSuites["testSuiteName"].testCases[ "testCaseName" ].setDisabled(true)

From testSuite Setup or Teardown Script

1. Disable Test Step within the same testSuite “
testSuite.testCases["testCaseName"].testSteps["testStepName"].setDisabled(true)

2. Disable Test Case within the same testSuite “
testSuite.testCases["testCaseName"].setDisabled(true)

3. Disable a separate testSuite “
testSuite.project.testSuites["testSuiteName"].setDisabled(true)

4. Disable a testCase within another testSuite”
testSuite.project.testSuites[ "testSuiteName" ].testCases[ "testCaseName" ].setDisabled(true)

5. Disable a testStep within another testSuite-testCase”
testSuite.project.testSuites[ "testSuiteName" ].testCases[ "testCaseName" ].testSteps[ "testStepName" ].setDisabled(true)

6. Disable an Assertion in a Test Step”
testRunner.testCase.testSuite.project.testSuites[ "testSuiteName" ].testCases[ "testCaseName" ].testSteps[ "testStepName" ].assertions[ "assertionName" ].disabled = false