Can I add MODULE GROUP name while writing to text file?
I am using the following code to generate and load content to text file.
public System.DateTime startTime()
{
timeBefore = System.DateTime.Now;
Report.Info("Content Generation Started on "+timeBefore+".");
return timeBefore;
}
public void endTime()
{
System.DateTime timeAfter = System.DateTime.Now;
TimeSpan duration = timeAfter- timeBefore; //Time taken to generate content
string s = duration.Minutes.ToString()+" Minutes:"+duration.Seconds.ToString()+" Seconds."+duration.Milliseconds.ToString()+" Milliseconds"; //convert to minutes, seconds and milliseconds
Report.Log(ReportLevel.Info,"Time taken to Generate Content:"+ duration.Minutes.ToString()+" Minutes:"+duration.Seconds.ToString()+" Seconds."+duration.Milliseconds.ToString()+" Milliseconds");
System.IO.File.AppendAllText(@"C:\Users\###\Documents\test.txt","TestCase:"+TestCase.Current.Name+" -- Time taken to Generate Content: "+s+ Environment.NewLine); //Append test case name, time
}
I want to include MODULEGROUP name after test case while writing to text file.
I tried "string moduleGroup = TestSuiteModuleGroup.Current.Name;" but it is getting module name rather than MODULE GROUP name.
Calculate time between steps in a recording
Re: Calculate time between steps in a recording
Hi,
I believe you can obtain the name of current testmodulegroup by this code:
PS: please next time, create a new topic instead of reopening an old and not completely related topic. Thanks! 
I believe you can obtain the name of current testmodulegroup by this code:
Code: Select all
Ranorex.Core.Reporting.TestReport.CurrentTestModuleGroupActivity.ModuleGroupName

Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Calculate time between steps in a recording
Thanks odklizec, It helped and I am able to get moduleGroupName in text file.
This thread is related to time between steps, so I thought it is related to calculating time between module groups.
This thread is related to time between steps, so I thought it is related to calculating time between module groups.