Building Test Cases in Studio

This might seem like a mundane question but I am unable to find sufficient documentation.
When building a Test Case in Studio I am confused as to how I sign off with the Test Case being either completed or failed.

I am checking if elements exist on webpages in each test case and cannot work out the logic behind the case either being failed or completed, do I need the throw stages?
What goes in the ‘…then’ stage?

Use an If activity and use condition: Element Exists = True or False, Then: Leave it empty or log success test will pass if no exception is thrown, Else: Throw activity throws an exception as test case fails automatically

Cheers

Thats incorrect.

You don’t throw an exception if your test case fails validation.

You use one of the Verify activities from the Testing package to check if your test passed.

For example.

This doesn’t throw an error but will make the test as failed.
In this way you can tell the difference between an exception (so an error occurred) and a fail, you can also add multiple verifications and see which ones pass and which ones don’t as they’ll all run. If you throw an exception you’d get a fail as such as the first criteria fails, and then not evaluate any other criteria.

The verify activities can also be set to take screenshots if you want them to be attached to the test case when running in the cloud.

1 Like

Yes got it actually i replied as general logic to handle error but yes in test cases we use Verify Activities which automatically handles the pass and fail.

Thanks!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.