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

Test List - On Fail Reset

3 Answers 72 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jerne
Top achievements
Rank 2
Jerne asked on 18 Jul 2014, 09:49 AM
Hi,

I have a question regarding Test Studio - Test Lists. I am writing tests for an online application and they are written in such a way, that  each test cleans changes made to the app. The problem i am having, is that if one test fails to clean after itself, the others fail as well ( changes made to the app ). 

Is there a way, to make some sort of a "TRAP" in test lists where if ONE TEST FAILS, it executes a few other tests which reset the application before continuing the test list.

Thank you,
Jernej

3 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 22 Jul 2014, 02:35 PM
Hello Jerne,

Yes you might be able to implement this by creating your own test extension DLL and take advantage of OnStepFailure:

/// <summary>
/// Use this function to add functionality when any test step fails
/// </summary>
/// <param name="executionContext">The ExecutionContext the test is running under.</param>
/// <param name="stepResult">Additional details about the step results.</param>
public void OnStepFailure(ExecutionContext executionContext, ArtOfTest.WebAii.Design.AutomationStepResult stepResult)
{
    this.ExecuteTest(this.ExecutionContext.DeploymentDirectory + "\\folder\\cleanuptest.tstest");
}

The other option which does not involve coded solution will be to include as test as step the clean up test before each test in the test list is executed.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Jerne
Top achievements
Rank 2
answered on 23 Jul 2014, 06:22 AM
Thank you for your answer, Ivaylo.

The second option of  seems to be rather time costly if you run more then a few tests in a test list. So i will try with my own DLL extension.

Have a good day,
Jernej
0
Ivaylo
Telerik team
answered on 23 Jul 2014, 07:00 AM
Hello Jernej,

You are most welcome.

It is up to you which solution you will choose.

Have a good day too.

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