firefox invokescript throws serialization error, chrome & IE work just fine

9 posts, 0 answers
  1. Tommy
    Tommy avatar
    7 posts
    Member since:
    Mar 2015

    Posted 01 Apr 2015 Link to this post

    this code throws an serialization error only in FF, this works just fine in chrome/IE
                        result = Actions.InvokeScript<string>("document.activeElement.id");

    error:

    System.Runtime.Serialization.SerializationException: There was an error deserializing the object of type System.String. End element 'root' from namespace '' expected. Found element '__ko__1427881981050' from namespace ''. ---> System.Xml.XmlException: End element 'root' from namespace '' expected. Found element '__ko__1427881981050' from namespace ''.
       at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
       at System.Xml.XmlExceptionHelper.ThrowEndElementExpected(XmlDictionaryReader reader, String localName, String ns)
       at System.Xml.XmlBaseReader.ReadEndElement()
       at System.Xml.XmlBaseReader.ReadElementContentAsString()
       at System.Runtime.Serialization.XmlReaderDelegator.ReadElementContentAsString()
       at System.Runtime.Serialization.Json.JsonStringDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
       at System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
       at System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
       at System.Runtime.Serialization.XmlObjectSerializer.InternalReadObject(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
       at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
       --- End of inner exception stack trace ---
       at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
       at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader)
       at System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(Stream stream)
       at ArtOfTest.WebAii.Core.Actions.InvokeScript[T](String script)
  2. Tommy
    Tommy avatar
    7 posts
    Member since:
    Mar 2015

    Posted 01 Apr 2015 in reply to Tommy Link to this post

    comparable problem:
    http://feedback.telerik.com/Project/161/Feedback/Details/50955-specific-js-fails-in-firefox-not-ie-or-chrome
  3. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 06 Apr 2015 Link to this post

    Hello Tommy,

    I am sorry to hear you are experiencing such a behavior. Using the latest version of the framework I was not able to reproduce this behavior on my machine.
    If you are not using latest version please proceed with upgrade. If you are using latest version please provide a sample test/project that I can execute and reproduce the behavior.

    Regards,
    Ivaylo
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  4. Tommy
    Tommy avatar
    7 posts
    Member since:
    Mar 2015

    Posted 08 Apr 2015 in reply to Ivaylo Link to this post

    In this testing project the expected value stays empty in firefox while it works just fine in chrome and IE.

    But i dont get the serialization error here.

  5. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 10 Apr 2015 Link to this post

    Hello Tommy,

    Thank you for providing me with the project and the sample web page. I would appreciate if you guide me on how to proceed and which test to execute in order to recreate this behavior.

    Looking forward to hearing from you.

    Regards,
    Ivaylo
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  6. Tommy
    Tommy avatar
    7 posts
    Member since:
    Mar 2015

    Posted 10 Apr 2015 in reply to Ivaylo Link to this post

    Run the sample webpage on a webserver. Change the baseurl in the test settings to the url of the sample page.

    The test you need to execute is the main test.

  7. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 10 Apr 2015 Link to this post

    Hello Tommy,

    Thank you for your explanation. I was able to run the test and invoke the script under Firefox without being able to reproduce this behavior on my end. I am using the latest internal version of Test Studio and the latest Firefox browser.

    Regards,
    Ivaylo
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
  8. Tommy
    Tommy avatar
    7 posts
    Member since:
    Mar 2015

    Posted 21 Apr 2015 in reply to Ivaylo Link to this post

    I solved this by removing the <string> specifier. Thanks for your help anyway.
  9. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 21 Apr 2015 Link to this post

    Hello Tommy,

    Thank you for your update. Glad to hear you've fixed this problem.

    Regards,
    Ivaylo
    Telerik
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top