How to get path to UITestActionLog.html from code

南楼画角 提交于 2019-12-02 09:55:17

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.

Kishor Gaur

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";
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!