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

Parent test is failing even when subtest catches exception

2 Answers 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mario
Top achievements
Rank 1
Mario asked on 26 Nov 2013, 07:34 PM
As the title says, my parent test is failing specifically on a FindElementException that the Subtest is catching.  Am I missing something?
My expected outcome would be for my test to carry on if I'm catching the exception that would otherwise fail the test.

Parent Test
->Execute test "SubTest.tsttest"

SubTest
// Click 'OverridelinkLink'
           try{
           Pages.CertificateError.OverridelinkLink.Click(false);
           }catch(FindException e){
           Log.WriteLine("IE Override Link not found");
           }

StackTrace
Failure Information: 
~~~~~~~~~~~~~~~
Exception thrown executing coded step: '[checkForCertErrorIE] : Click 'OverridelinkLink''.
InnerException:
ArtOfTest.Common.Exceptions.FindElementException: Element Not found!
FindExpression used: 
[id 'Exact' overridelink] AND [tagname 'Exact' a]

2 Answers, 1 is accepted

Sort by
0
Mario
Top achievements
Rank 1
answered on 26 Nov 2013, 07:50 PM
Yikes, this was my fault.  Catching the wrong exception :) 
0
Velin Koychev
Telerik team
answered on 29 Nov 2013, 12:56 PM
Hello Mario,

It is good to hear that you've been able to resolve this issue on your own.

Let me know if you need any additional assistance. 

Regards,
Velin Koychev
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Mario
Top achievements
Rank 1
Answers by
Mario
Top achievements
Rank 1
Velin Koychev
Telerik team
Share this question
or