After Browser Refresh, all actions on SilverlightApp throws error

5 posts, 0 answers
  1. Yogesh
    Yogesh avatar
    11 posts
    Member since:
    Jan 2011

    Posted 12 Feb 2014 Link to this post

    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
  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 17 Feb 2014 Link to this post

    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
  3. Yogesh
    Yogesh avatar
    11 posts
    Member since:
    Jan 2011

    Posted 17 Feb 2014 in reply to Boyan Boev Link to this post

    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 !
  4. Yogesh
    Yogesh avatar
    11 posts
    Member since:
    Jan 2011

    Posted 17 Feb 2014 Link to this post

    Admin, could you remove application page link (or put some fake link) after you got it? Thank You
  5. Boyan Boev
    Admin
    Boyan Boev avatar
    1040 posts

    Posted 18 Feb 2014 Link to this post

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