Forum Discussion
4 Replies
- AnandKiranFrequent ContributorI have retrieved the list of teststeps under a Testcase using the below code
def testcase = testRunner.getTestCase();
def steplist = testcase.getTestStepList() ;
String[] list = steplist.name
len = list.length;
log.info len
for(i=0;i{
log.info list
}
Now I want to get the status of each step (whether the Status is OK/ Failed), can anyone suggest me an idea how to go about it.
Regards
Anand - AnandKiranFrequent ContributorI have used the below line to get the status of the Teststep,
def result = testRunner.runTestStepByName( "Input" )
But I dont want to do in this way. I have the follwing Test Steps in my testcase
1. Input
2. Request
3. Status Check - Groovy script to get the status of the above two steps.
If I use 'def result = testRunner.runTestStepByName( "Input" )' in the step 3 it will execute the step 1 again.
Hope I am clear in exlpaining my issue. Please suggest me an idea to overcome this
Note: I dont want to disable the teststeps.
Regards
Anand. - AnandKiranFrequent ContributorHi Ole,
Can you suggest me any idea??? - AnandKiranFrequent ContributorHi,
I found out the way to get the test step Status. hope it might be useful
def list1 = new ArrayList()
def count1 = 0
for( r in testRunner.results )
{
count1++
def item = "TestStep " + r.testStep.name + " finished with status " + r.status + "Time Taken ::" + r.timeTaken + "ms"
list1.add(item)
}
for (values in list1)
log.info "Collected Values are "+ list1