I'm trying to save a .txt file with durations of my tests into a specific folder for each of my test cases.
For example:
1. I want to run the test_0001
2. I want to save the duration of it into a .txt file
The code of my test_0001 is something like:
Code: Select all
getStartTime();
DoStuff();
getEndTime();
Code: Select all
System.IO.File.AppendAllText(@"C:\Users\x\Documents\" + TestSuite.CurrentTestContainer.Name + ".txt", Environment.NewLine + "Duration: " + s + Environment.NewLine);
How do I get the current test name that I'm running?
Edit 1:
I noticed that if I run the test from the Test Suite, my code works!
But if run the test directly in the module code, I get the null value for the test name.