as a part of my project i need to parse the timestamp from a rxlog.data file to determine the start date and time in my script that need to stat with that date and time. for this do i have to use linq to xml method for parsing the timestamp.?
<report>
<activity
user="chanderu"
host="CA630029"
rxversion="5.3.2.23378"
osversion="Windows 7 Service Pack 1 64bit"
runtimeversion="4.0.30319.34209"
procarch="32bit"
language="en-US"
screenresolution="1600x1200"
timestamp="8/12/2015 9:47:05 AM"
the last line shows the timestamp that needs to be parsed in to my script using c# coding.
parse the timestamp from a rxlog.data file using c#
-
- Posts: 1
- Joined: Mon Oct 26, 2015 9:18 pm
Re: parse the timestamp from a rxlog.data file using c#
Hi,
Using XML reader is probably the cleanest way? Something like this should do the trick...
Using XML reader is probably the cleanest way? Something like this should do the trick...
Code: Select all
using System.IO;
using System.Xml;
public string ReadFromXML()
{
XmlDocument doc = new XmlDocument();
doc.Load(@"C:\pathtoreport\report.rxlog.data");
string attrVal = doc.SelectSingleNode(".//activity").Attributes["timestamp"].Value;
return attrVal;
}
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