Serializ the testresult of a automation Test

2 posts, 0 answers
  1. Mostafa
    Mostafa avatar
    22 posts
    Member since:
    Aug 2012

    Posted 07 Feb 2013 Link to this post


    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);

    }

    }

  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 08 Feb 2013 Link to this post

    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
Back to Top