Forum Discussion

eymasar's avatar
eymasar
New Contributor
11 years ago

Get Failed TestStep Name From TestCase

Hi.

So I am trying to run a pack of testsuites from another project through groovy and I have the code and it is working. But the thing is I run this tests case by case not step by step so I only have the names of the testcases. But I need to know which test step has failed when the test case fails and I need to know why it has failed. I have tried a lot of things and search through a lot but I still haven't got the answer. Do you think it is possible? If you can give me an idea I will appreciate it.

 

 

prj = testRunner.testCase.testSuite.project.workspace.getProjectByName(projectName)
prj.setActiveEnvironment(environment)

prj.getTestSuiteList().each { 
 prj.testSuites[tsname].getTestCaseList().each{
 some =	prj.testSuites[tsname].testCases[tcname]

 if( some.disabled ){
  	log.info tcname + "                      : disabled"}
  	else{
  	log.info tcname + "                      : enabled"
result = some.run( null, false ) if(result.status != Status.FAILED ){ res="ok" } else { res ="failed" log.error "failed" if(res=="failed"){ log.info result.reason // this just return me "the testcase failed due to failed test step" ********* }
No RepliesBe the first to reply