How to get path to UITestActionLog.html from code
Asked Answered
M

2

0

Each test case saves results to a separate UITestActionLog.html file. But in the end of each test case I'd like to move that .html to a different folder and rename it.

Is it possible to do so in, say, [TestCleanup()]? If yes, then how can I programmatically get .html report location?

Milker answered 30/10, 2013 at 12:17 Comment(0)
H
1

The TestContext class contains several fields with "directory" in their names. These can be used to access the various directories associated with running the tests.

As well as managing the files as asked by your question the TestContext class has an AddResultFile method. The Microsoft documentation on this mehod is not clear, but it seems that the files are saved for failing tests and discarded for passing tests.

Hipparch answered 30/10, 2013 at 12:30 Comment(1)
Thanks a lot! TestContext.TestResultsDirectory points to UITestActionLog.html folderMilker
N
-1

To get the directory in which the UITestActionLog file will be located, use the TestContext.TestResultsDirectory Property. You can use below code to get the full path:

string fullPath = TestContext.TestResultsDirectory +"\" +"UITestActionLog.html";
Nexus answered 28/10, 2015 at 14:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.