Force "Fail" Flag During "ELSE"

2 posts, 0 answers
  1. Bob
    Bob avatar
    39 posts
    Member since:
    Apr 2013

    Posted 23 May 2013 Link to this post

    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! 

  2. Plamen
    Plamen avatar
    8 posts

    Posted 27 May 2013 Link to this post

    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.

    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top