How can I avoid Failure Information in Logfile

2 posts, 0 answers
  1. Michael
    Michael avatar
    21 posts
    Member since:
    Apr 2013

    Posted 19 Apr 2013 Link to this post

    I Have in C# Script:

                try
                {
                    ActiveBrowser.WaitForElement(Pages.Deuba_Relaunch_FR_Navigation.Expressions.Productoverview_Article, 3000, false);        
                }
                catch
                {
                    Log.WriteLine( "Productoverview Div Article not found");
                    return false;
                }


    That works, but here i dont want the Failure Information because I have the Log-Information
    Thanks for Help
  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 24 Apr 2013 Link to this post

    Hello Michael,

    I'm not sure how you're using the code you provided. The return value type for the method that represents the coded step is System.Void, which means that it doesn't return a value. This leads me to believe that you are using this code in a method defined in the code behind(outside of a coded step). Can you please provide the complete code you're using?

    In general, when you are using a try/catch block to catch the exception, Test Studio doesn't detect the failure. It executes the code in the catch block, but at the same time it marks the step as passed and there is no Failure Information in the log(see this video).

    It would be best if you can create and provide a sample test(against Google for example), that we can run and reproduce the behavior you're experiencing.

    All the best,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top