Solved
Forum Discussion
TesterNo1
10 years agoContributor
Thanks Rao for responding.
Tried isDisabled=testSuite.getTestCaseByName(TestCaseLabel).isDisabled() and see same error
Scenario 1.:When are test cases are enabled manually and script is run ,disabling works.Also,above statement works when all test cases enabled.returns False which is right.
Scenario 2:When test cases are disabled and i use the above statement,it throws error.
cannot invoke isdisabled() on null object.
attached a snapshot.
nmrao
10 years agoCommunity Hero
If you want to just enable all the cases :
testSuite.testCaseList.each { it.disabled = false }
To disable:
testSuite.testCaseList.each { it.disabled = true }
To enable a test case by name:
testSuite.testCases['TestCase 1'].disabled = false //you may change test case name.
To disable:
testSuite.testCases['TestCase 1'].disabled = true //you may change test case name.
Does it help?
EDIT: Was little confusing, after looking into details, then come to know the following:
Are you using Test Case label in your script instead of Test Case name? There is a difference.
log.info testSuite.testCases['TestCase 1'].name log.info testSuite.testCases['TestCase 1'].label
Output:
Wed Dec 09 07:15:07 IST 2015:INFO:TestCase 1 Wed Dec 09 07:15:07 IST 2015:INFO:TestCase 1 (disabled)