report parsing

Class library usage, coding and language questions.
ggaspari
Posts: 26
Joined: Tue Apr 10, 2012 8:40 am

report parsing

Post by ggaspari » Thu Aug 30, 2012 2:57 pm

Hi guys,
Where can I find a simple sample about xml parsing ?
Basically, I need to pull out just a few items, like testcasename/result but I have no experience with xml so a simple code could help a lot :-)

thank you

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: report parsing

Post by Support Team » Thu Aug 30, 2012 4:35 pm

Hello,

Here is a little code snippet that parses information out from our report file and writes it into the console:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("c:\\PATH\\TO\\YOUR\\FILE\\RanorexLogFile.rxlog"); 
XmlNode reportInfos = xmlDoc.SelectSingleNode("//report/activity/activity/activity");

foreach (XmlAttribute attr in reportInfos.Attributes)
{
  Console.WriteLine(attr.InnerText);
}
I hope this is what you need.

Regards,
Bernhard
Ranorex Support Team
.
Image

ggaspari
Posts: 26
Joined: Tue Apr 10, 2012 8:40 am

Re: report parsing

Post by ggaspari » Fri Aug 31, 2012 3:18 pm

definitely yes!

thank you