Page 1 of 1

Ripping out testcasename and pass/fail from reports

Posted: Wed Oct 18, 2017 11:04 pm
by justletmesignup
Hello all,

I noticed a few threads in the past asking similar questions...however I'm still a bit lost on how to do something like this. Basically, I want to ask if it is possible to strip everything else from these Ranorex .rxlog report files and just have it contain:
- Test case name
- Result

I am using this snippet of code from a previous post that's been locked:

Code: Select all

		public void parseResults()
		{
		
			XmlDocument xmlDoc = new XmlDocument();  
			xmlDoc.Load("C:\\Users\\[Path]\\[To]\\[File]\\reportsFile.rxlog");   
			XmlNode reportInfos = xmlDoc.SelectSingleNode("//report/activity/activity/activity");  
  
			foreach (XmlAttribute attr in reportInfos.Attributes)  
			{  
  				Console.WriteLine(attr.InnerText);  
			} 
		}
And reading one of the Ranorex generated report files it keeps failing because an EntityName can't be parsed (at line 22, position 124). Basically it's failing before even the actual meaningful contents of the report is present..

Am I using the wrong reports file entirely? Any help would be appreciated.. I just want to be able to parse the reports and gather 2 pieces of information for each test case run.

I am running on Ranorex 6.2.1 on Windows 10 64bit.

Thanks,

B

Re: Ripping out testcasename and pass/fail from reports

Posted: Thu Oct 19, 2017 8:43 am
by uhmdown
Hi Just,

Your idea is right, but the file you're trying to parse is wrong.
If you open "rxlog" with a text editor like notepad, you'll see that it contains almost no html; just a bunch of javascript; definitely not the data you were looking for.

The file you want to run through your code is the "rxlog.data" file, that's the one that contains all the html.

Re: Ripping out testcasename and pass/fail from reports

Posted: Thu Oct 19, 2017 1:48 pm
by krstcs
Technically, the "*.rxlog" file is an HTML file with javascript to read/parse the data file.

The "*.rxlog.data" file is an XML file.

Otherwise, that is correct.