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

Silverlight application throws error,

3 Answers 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vaibhav
Top achievements
Rank 1
Vaibhav asked on 06 Mar 2014, 02:31 PM
Hi guys,

Here is what i am trying to achieve using Telerik Test Framework. (My app is built in Silverlight 4) 

I have two questions, 

1)  using the framework i am able to log in into my app and get the hold of some of the controls already in the page
does that mean the silverlight app i am trying to automate has "enableSilverlight = true" ?

2) When i click on search button, the app refreshes and gives the result page (which is the grid in silverlight, user control i suppose)
i get the following exception


Exception thrown during the wait for a condition. Error: Unexpected error while waiting on condition. Error: ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
InError set by the client. Client Error:
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessSilverlightCommand(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)
BrowserCommand (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_9849eb3c-9608-402c-995e-11d8b53787d3',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessSilverlightCommand(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')
InnerException: none.

   at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
   at ArtOfTest.WebAii.Silverlight.SilverlightProxy.ExecuteSLCommand(SilverlightCommand cmd)
   at ArtOfTest.WebAii.Silverlight.SilverlightProxy.GetAllVisualTrees()
   at ArtOfTest.WebAii.Silverlight.SilverlightApp.RefreshVisualTrees()
   at ArtOfTest.WebAii.Silverlight.VisualFind.RefreshRoot()
   at ArtOfTest.WebAii.Silverlight.VisualWait.WaitForExistsByFindInfo(VisualFindInfo findInfo)
   at ArtOfTest.Common.WaitAsync._worker_DoWork[T,V](Object waitParam)


Any help in this regard will help me achieve the deadline.
Thanking you in advance.
 

3 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 11 Mar 2014, 12:27 PM
Hello Vaibhav,

Thank you for contacting us.

You need to initialize the settings and manager:

Settings mySettings = new Settings();
mySettings.Web.DefaultBrowser = BrowserType.InternetExplorer;
mySettings.Web.EnableSilverlight = true;
Manager myManager = new Manager(mySettings);
myManager.Start();
myManager.LaunchNewBrowser();
myManager.ActiveBrowser.NavigateTo("URL", false);

Here you set  EnableSilverlight to true.

Could you please send us the test project so we can look at it directly. Is it possible to give us a direct access to the application. This will be the fastest and easiest way to give a solution.

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
Vaibhav
Top achievements
Rank 1
answered on 11 Mar 2014, 03:15 PM
Hi Boyan,

Thanks for the reply, unfortunately i cannot share the public Url on forum, but i ll try to elaborate my problem here.

Basically the app (Silverlight) is built in Silverlight 4.  and i am using Telerik Test Framework Version 2013.2.1327.0

When i hit the url, i get the silverlightApp object correctly, also i can find controls which are there in the main menu etc.
But when i click on some search button for example, which refreshes the page and loads some new controls, that is when
i get the above exception 

Also When i tried using XamlFindExpression, i am getting older controls which were present before clicking the search button,
i tried using app.VisualTree.Refresh(); but that again gives me Error as below.

System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessSilverlightCommand(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)

The more detail given is 

{BrowserCommand (Type:'Silverlight',Info:'NotSet',Action:'NotSet',Target:'ElementId (tagName: 'object',occurrenceIndex: '0')',Data:'{"Method":null,"Property":null,"Reference":{"ObjectName":"$root","Path":"\/opmasterpage:-1:31353106","Properties":[]},"Reference2":null,"Type":4,"Value":"9LQDAX8LgETvZr30\/wIZMvgVw74="}',ClientId:'Client_8fc32969-9c3a-4673-9747-85d57e396c2e',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessSilverlightCommand(BrowserCommand request)
   at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request, IHTMLDocument2 document)')}


Can you please suggest some workaround on it ?


0
Boyan Boev
Telerik team
answered on 14 Mar 2014, 11:41 AM
Hello Vaibhav,

To give you a workaround we definitely need and access to the application so we can reproduce this behavior.

You can send me the link via mail on: boyan "dot" boev "dot" telerik.com

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
Vaibhav
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Vaibhav
Top achievements
Rank 1
Share this question
or