Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Currently I have configured Extent report for my test cases. I have several projects under my solution. I am generating the report in "Reports" folder that i created in each project. However I want to know How can I store this in one common project that I have called AutomationCommonObjects. I want to get the "AutomationCommonObjects" path with out hard coding it and store the report in their inside the Reports folder in that project instead.

What I have tried:

Here is my code for the storing in each project's Reports folder

<pre> string path = System.Reflection.Assembly.GetCallingAssembly().CodeBase;
            string actualPath = path.Substring(0, path.LastIndexOf("bin"));
            string projectPath = new Uri(actualPath).LocalPath;

            string reportPath = projectPath + "Reports\\" + DateTime.Now.ToString("MM_dd_yyyy_HH_mm_ss") + ".html";
Posted
Comments
F-ES Sitecore 16-Apr-20 6:04am    
You need to stop thinking in terms of "projects". A project is a concept in your IDE (Visual Studio) that allows it to logically group files. When your code is running there is no such thing as a "project".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900