This is a migrated thread and some comments may be shown as answers.

Force "Fail" Flag During "ELSE"

1 Answer 50 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 23 May 2013, 02:36 PM
Greetings Once Again,

I have a test which is creating data in an environment off a spreadsheet. I want it to always create something successfully, but report to me if an error occurs. I will then report this error to the appropriate people who will fix, then publish the data. If I fail to create the data, it will not save other pieces, causing time consuming fixes, so I put the verification into an IF statement. Therefore, ELSE is synonymous with failure, but it then handles the failure and forges ahead without messing up the remainder of the item creation.

Of course, when it hits this ELSE, all the steps pass which normally would cause it to PASS and, amid 300 data entries, I'd be none-the-wiser. To combat this, I have a bogus verification setup with continue on failure so that the step marks fail. I was wondering if I was missing a feature that was a bit more... graceful.

Alas... in a perfect world, nobody would enter data incorrectly on the spreadsheet! 

Sincerely,
Robert

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 27 May 2013, 08:44 AM
Hi Robert,

One way to fail the test based on condition is to use LogType.Error. This will immediately fail the test and log a message of your choice to the execution log. See this video for a quick demonstration of its usage. The other two options are explained in this article.  

Let me know if you need further assistance on this.

Regards,
Plamen
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Bob
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or