I have a silverlight 4 webpart in sharepoint 2010. I'm trying to access it with Telerik testing framework. I'm using the following code.
Settings mySettings = new Settings(new Settings.WebSettings(BrowserType.InternetExplorer)); mySettings.Web.EnableSilverlight = true; Manager myManager = new Manager(mySettings);myManager.Start();myManager.LaunchNewBrowser();AddDialogSupport(myManager);Navigate(myManager, "http://qa.psc.lan/sites/arooj/site%20pages/administration.aspx");Thread.Sleep(mySettings.Web.SilverlightConnectTimeout);var slApp = myManager.ActiveBrowser.SilverlightApps()[0]; \\ this is where i get the errormyManager.Dispose();I'm getting the following exception when i execute the Manager.ActiveBrowser.SilverlightApps()[0] line.
ApplicationNotReadyException.
Error checking HTML access on SilverlightApp.
ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [document.getElementsByTagName(\\'object\\')[0].settings.enableHtmlAccess] failed!
Please make the function exists and the call is using the correct prototype signature. Javascript error: Error
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeJsFunction',Target:'ElementId (tagName: '',occurrenceIndex: '-1')',Data:'document.getElementsByTagName(\\'object\\')[0].settings.enableHtmlAccess',ClientId:'Client_da180eb3-8a78-4d51-8186-125cdf273e97',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.InvalidOperationException: Javascript call [document.getElementsByTagName(\\'object\\')[0].settings.enableHtmlAccess] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: Error
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.
Any help would be appreciated.
Thanks.
Best Regards,
Arooj