Showing results for 
Search instead for 
Did you mean: 

Failing a teststep using context class


Failing a teststep using context class

I am using pro version and I want to fail a teststep which has a script assertion.


I am aware that I can use function to fail a teststep in groovy but testRunner class doesn't have scope in script assertion. Only context,log and messageExchange classes has scope over there.


Please share is you have any idea about it.





Community Manager

Re: Failing a teststep using context class

Hi Varun,


You can enable the Fail TestCase on Error option to fail the entire test case when your assertion fails. Please read the following article to learn more about this option:

Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Script Wanted
Let's start July with new challenges!

Create a script to change request body before sending it to the server for the TechCorner tag!

Scripts created in June:
- A script to generate a request body based on data from Datasource
- A script to go through all response nodes and check the value of the required field
- A Dispatching script to get responses based on the values in Request Body
- A script to add a new tag and assign it to all TestCases in a TestSuite
Top Kudoed Authors