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

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

8 Answers 17 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tommy
Top achievements
Rank 1
Tommy asked on 01 Apr 2015, 10:10 AM
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)

8 Answers, 1 is accepted

Sort by
0
Tommy
Top achievements
Rank 1
answered on 01 Apr 2015, 10:12 AM
comparable problem:
http://feedback.telerik.com/Project/161/Feedback/Details/50955-specific-js-fails-in-firefox-not-ie-or-chrome
0
Ivaylo
Telerik team
answered on 06 Apr 2015, 05:55 AM
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
 
0
Tommy
Top achievements
Rank 1
answered on 08 Apr 2015, 12:43 PM

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.

0
Ivaylo
Telerik team
answered on 10 Apr 2015, 06:11 AM
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
 
0
Tommy
Top achievements
Rank 1
answered on 10 Apr 2015, 07:39 AM

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.

0
Ivaylo
Telerik team
answered on 10 Apr 2015, 12:48 PM
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
 
0
Tommy
Top achievements
Rank 1
answered on 21 Apr 2015, 01:17 PM
I solved this by removing the <string> specifier. Thanks for your help anyway.
0
Ivaylo
Telerik team
answered on 21 Apr 2015, 02:29 PM
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
 
Tags
General Discussions
Asked by
Tommy
Top achievements
Rank 1
Answers by
Tommy
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or