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

Handling Step Failure and Reporting

1 Answer 167 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jelarg
Top achievements
Rank 1
Jelarg asked on 25 Apr 2012, 04:25 PM
Hi Telerik Team,

I have several question concerning handling test step failure and test results reporting.

I'm running child tests from the parent test using "Test as Step" functionality. I need to handle situation when some of these steps failed (write error message, make screenshot). As I know there is "OnStepFailure" method that should be called when some step failed:
http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/general/execution-extensions.aspx 
But when I used this method in my parent test this method doesn't called at all.
What I should do to handle test step failure when test as step failed (even with ContinueOnFailure option)? Also I'm interesting on how to handle failures from parent test when failed some step inside his child test (Test As Step).

When I'm running tests from TestStudio Express VS plugin generated Visual Studio .trx reports file.
Questions:
1) How to customize such report? How to attach or bind application logs and screenshots to this report? Is TestStudio supported functionality to make and arrange screenshot for each executed test step (for visual representation of whole execution flow) ?
2) How to generate separated *.trx reports for each iteration inside Data Driven Test (not all in one)? Maybe there is method like result.ExportToResultFile(@"C:\", result.TestName); but for VS *.trx reports?
3) Is there is ability to change settings or bind another external data source at the start of test execution?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 30 Apr 2012, 05:24 PM
Hello Jelarg,

The code in the Execution Extensions article is not intended to be used directly in the code-behind file of a test. You must write your own class and create your own DLL totally separate from the coded steps. Once created, copy the DLL into the C:\Program Files (x86)\Telerik\Test Studio\Bin\Plugins folder. You don't need to restart Test Studio for it to be picked up. The next time you execute a test, it will pull in that DLL, look for the extension methods, and call them.

I tested this procedure and OnStepFailure was properly called when a step failed in the parent and the child test.

1. The .trx is a Visual Studio file and not created by the Test Studio VS plugin. If you'd like to alter it further, that requires a custom solution. Here is a basic example on how to convert it to HTML.

A Test Studio test contains a Storyboard that is captured when you originally record the test. Test Studio does not automatically capture an image for each executed test step (only for failed steps). To retrieve an image at a specific point in your test, insert a Capture step.

2. Again, Test Studio has no control of the .trx file generated in Visual Studio. If you wish to divide the contents of the report into separate pieces, that will require a custom solution.

3. The second half of the Execution Extensions article demonstrates using the OnInitializeDataSource method. This is how to bind another data source at the start of test execution.

Regards,
Anthony
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Jelarg
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Share this question
or