Hi
I want to have a step at the end of a test, that saves the test log as a .txt fiel.
I need these to be able to batch process them after a day or 2 of testing for times,...
I believe this can be done in code?
I have no idea where to start and how to do it really. any help would be appreciated.
Regards,
Tom
I want to have a step at the end of a test, that saves the test log as a .txt fiel.
I need these to be able to batch process them after a day or 2 of testing for times,...
I believe this can be done in code?
I have no idea where to start and how to do it really. any help would be appreciated.
Regards,
Tom
5 Answers, 1 is accepted
0
Accepted
Hi tom,
All the best,
Cody
You can do this by overriding the CleanUp method. It won't appear as a test step, but will always run whether the test passes or fails. Here's the starter of the code:
public
override
void
CleanUp()
{
base
.CleanUp();
string
results =
this
.ExecutionContext.TestResult.Message;
}
Cody
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

tom
Top achievements
Rank 1
answered on 13 Oct 2010, 11:36 AM
Hi Cody,
Thks for getting back to me.
This code looks great, but i am unsure of where to put it unless I add a code step?
Could you direct me as to where this code should be placed?
Regards,
Tom
Thks for getting back to me.
This code looks great, but i am unsure of where to put it unless I add a code step?
Could you direct me as to where this code should be placed?
Regards,
Tom
0
Accepted
Hi tom,
Cody
Sure. For QA Edition follow these steps:
- Open your test in the tool
- If your test doesn't have a coded step already, add one by clicking Script Step in the ribbon bar. We won't actually be adding anything to this script step, and in fact will be deleting it soon. The only purpose is get a code behind file generated for that test.
- Click the Class View button
- Scroll down in the code until you see this section:
public
Pages Pages
{
get
{
if
(_pages ==
null
)
{
_pages =
new
Pages(Manager.Current);
}
return
_pages;
}
}
#endregion
- Insert the CleanUp code from my previous post after the #endregion line, but before the next "[CodedStep" line.
- If you added a coded step in Step 2, you can safely delete the entire empty coded step while in Class View.
Cody
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0

tom
Top achievements
Rank 1
answered on 14 Oct 2010, 10:40 AM
Hello Cody,
Thank you so much for your help so far.
I couldn't find the class view button at first...
It's located above the steps, with the other step controls...
this guide shows images and explains how it works: http://www.telerik.com/documents/automated-testing-tools/WebUITestStudioQAEditionQuickStartGuide.pdf?bcsi_scan_60645583C891AE6C=0&bcsi_scan_filename=WebUITestStudioQAEditionQuickStartGuide.pdf Page 38 onwards.
Regards,
Tom
Thank you so much for your help so far.
I couldn't find the class view button at first...
It's located above the steps, with the other step controls...
this guide shows images and explains how it works: http://www.telerik.com/documents/automated-testing-tools/WebUITestStudioQAEditionQuickStartGuide.pdf?bcsi_scan_60645583C891AE6C=0&bcsi_scan_filename=WebUITestStudioQAEditionQuickStartGuide.pdf Page 38 onwards.
Regards,
Tom
0
Hi tom,
Cody
I'm glad you were able find it. I'll pass along that you had trouble locating the Class View button. It means we need to work a little more on our UI.
All the best,Cody
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items