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

How can I avoid Failure Information in Logfile

1 Answer 46 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 19 Apr 2013, 04:46 PM
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

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 24 Apr 2013, 03:36 PM
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
Tags
General Discussions
Asked by
Michael
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or