Ripping out testcasename and pass/fail from reports

Ask general questions here.
justletmesignup
Posts: 8
Joined: Fri Jul 03, 2015 8:13 pm

Ripping out testcasename and pass/fail from reports

Post by justletmesignup » Wed Oct 18, 2017 11:04 pm

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

uhmdown
Posts: 54
Joined: Mon Apr 03, 2017 12:00 pm

Re: Ripping out testcasename and pass/fail from reports

Post by uhmdown » Thu Oct 19, 2017 8:43 am

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.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Ripping out testcasename and pass/fail from reports

Post by krstcs » Thu Oct 19, 2017 1:48 pm

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.
Shortcuts usually aren't...