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

[Solved] Capture Browser

2 Answers 201 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.
Dimitrios Kyteas
Top achievements
Rank 1
Dimitrios Kyteas asked on 04 Jan 2010, 11:28 AM
Is it possible to set the FileNamePrefix dynamically?

For example: I do not wish the snapshots of each test to be saved in separate folders. Instead I want the snapshots from all the tests saved in the same folder (ex. "TestResults\snapshots"), so I set the fileNamePrefix accordingly ("..\..\snapshots\<filename>").
However I want to classify the snapshots further according to the active browser without having to take multiple snapshots that run against specific browsers. Is that possible? (ex. "..\..\snapshots\<getActiveBrowser()>\<filename>" or sth like that).

2 Answers, 1 is accepted

Sort by
0
Missing User
answered on 04 Jan 2010, 06:12 PM
Hello Dimitrios,

In the FileNamePrefix property, you can give the entire file path and it will save the screen shot to where you want it.

To save to a folder by browser type, you can convert the capture step to code, then do something like this:

[CodedStep(@"Capture 'Browser' state.")]
public void WebAiiTest1_CodedStep()
{
     // Capture 'Browser' state.
     Log.CaptureBrowser(ActiveBrowser, "FilePath\\" + ActiveBrowser.BrowserType.ToString() + "\\FileName");
}

Hope that helps.

Sincerely yours,
Nelson Sin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dimitrios Kyteas
Top achievements
Rank 1
answered on 05 Jan 2010, 08:45 AM
This is exactly what I wanted.

Thank you
Tags
General Discussions
Asked by
Dimitrios Kyteas
Top achievements
Rank 1
Answers by
Missing User
Dimitrios Kyteas
Top achievements
Rank 1
Share this question
or