cancel
Showing results for 
Search instead for 
Did you mean: 

Changing teststep status

Super Contributor

Changing teststep status

Hello,
I have a few groovy scripts such as updatePassword, VerifyEmail etc in my testcase. These groovy script call the external groovy script where the methods are defined.

I want to know how can change the status of the groovy script to 'failed' from my external file. So basically if my external 'UpdatePassword' failed i want to be able to change the status of my groovy script to failed.

so in the external can i do something like
if(update statement did not affect any rows in database)
testrunner.getteststepbyname("groovyscriptname").setstatus = failed

Thanks

Ali
1 REPLY 1
Super Contributor

Re: Changing teststep status

Hi Ali,

try to just throw an exception, ie in your external script add

if(update statement did not affect any rows in database)
  throw new Exception( "Failed to update database" )

Hope this helps!

regards,

/Ole
eviware.com
New Here?
Join us and watch the welcome video:
SmartBear + Cucumber
Top Kudoed Authors