Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
17 years ago

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

  • omatzura's avatar
    omatzura
    Super Contributor
    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