This is a migrated thread and some comments may be shown as answers.

Serializ the testresult of a automation Test

1 Answer 37 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mostafa
Top achievements
Rank 2
Mostafa asked on 07 Feb 2013, 02:10 PM

Hi Telerik Team,

i need to Serializ the testresult of a automation Test. The result is a trx file. I currently use the class Testreult (ArtOfTest.WebAii.Design.Execution.TestResult), but I always get an exception. The innerException is ({"There was an error reflecting property 'Parent'."}).

what should I do
to serialize the result of the test?!!!!

HERE IS MY CODE AND THE TRX-File

 

//Serializing

 

public static ArtOfTest.WebAii.Design.Execution.TestResult GetConfigEnvironment(string strPath)

{

 

XmlSerializer ser = new XmlSerializer(typeof(ArtOfTest.WebAii.Design.Execution.TestResult));

 

using (var settingsFile = System.IO.File.OpenRead(strPath))

{

 

 

return (ArtOfTest.WebAii.Design.Execution.TestResult)ser.Deserialize(settingsFile);

}

}

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 08 Feb 2013, 06:09 PM
Hi Mostafa,

I was able to reproduce the issue and confirm it as a bug. You can track its progress here: Public URL

The problem is that even the TestResult class has "Serializable" attribute that indicates that the class can be serialized, when initializing a new instance of the XmlSerializer class by passing the TestResult class as type argument, the following code throws InvalidOperationException.
XmlSerializer ser = new XmlSerializer(typeof(TestResult));

I have also updated your Telerik points for discovering the issue.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Mostafa
Top achievements
Rank 2
Answers by
Plamen
Telerik team
Share this question
or