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

After Browser Refresh, all actions on SilverlightApp throws error

4 Answers 26 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Yogesh
Top achievements
Rank 1
Yogesh asked on 12 Feb 2014, 08:16 AM
I am doing Silverlight application test automation. All looks fine, but moment I do browser refresh (or if certain button click in app does page refresh) all commands followed by the page refresh ends up in Exception

manager.Start(); // Start the manager
manager.LaunchNewBrowser(); // Launch a new browser instance.
manager.ActiveBrowser.Window.Maximize();
manager.ActiveBrowser.NavigateTo(TestConfigs.BaseUrl);
app = manager.ActiveBrowser.SilverlightApps()[0];
manager.ActiveBrowser.Refresh();
Thread.Sleep(5000);
app.RefreshVisualTrees();    // Here it throws following exception




{"ExecuteCommand failed!\r\nInError set by the client. Client Error:\r\nSystem.NullReferenceException: Object reference not set to an instance of an object.\r\n   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)\r\n   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)\r\n   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessSilverlightCommand(BrowserCommand request)\r\n   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)\r\nBrowserCommand (Type:'Silverlight',Info:'NotSet',Action:'NotSet',Target:'ElementId (tagName: 'object',occurrenceIndex: '0')',Data:'{\"Method\":null,\"Property\":null,\"Reference\":null,\"Reference2\":null,\"Type\":12,\"Value\":null}',ClientId:'Client_079a5f6e-e58f-4682-94c6-ac9a1cf9345b',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.NullReferenceException: Object reference not set to an instance of an object.\r\n   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)\r\n   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)\r\n   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessSilverlightCommand(BrowserCommand request)\r\n   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')\r\nInnerException: none.\r\n"}


Any idea whats going wrong here ?

Regards !

Yogesh

4 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 17 Feb 2014, 09:35 AM
Hi Yogesh,

Thank you for contacting us.

Could you please grant us an access to the page, so we can try to reproduce and debug this issue.

Hope to hear from you soon.

Regards,
Boyan Boev
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Yogesh
Top achievements
Rank 1
answered on 17 Feb 2014, 04:05 PM
Hi,

You can navigate to *link* and load silverlight app and click on language (or just do browser refresh as explicit step) which refreshes the page and then all actions on Silverlight app throws error.

Regards !
0
Yogesh
Top achievements
Rank 1
answered on 17 Feb 2014, 04:07 PM
Admin, could you remove application page link (or put some fake link) after you got it? Thank You
0
Boyan Boev
Telerik team
answered on 18 Feb 2014, 01:43 PM
Hello Yogesh,

This is caused by the EnableHtmlAccess property being disabled at compile-time. EnableHtmlAccess must be enabled for Test Studio to automate against a Silverlight App. This change can be made in the Silverlight app manifest (point 6 in this article). The 'EnableHtmlAccess' parameter needs to be set to true in our app.

I have attached a screenshot to show you our demo SL app.

Please consult this with your developers and let us know the result.

Hope to hear from you soon.

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