Hi,
We are testing our Silverlight application with Coded UI tests. After Infragistics version update from 12.2 to 14.1 we have problems with XamDataTree control. With new version we are not able to handle XamDataTree control child controls using FindMatchingContlos function - result collection is always empty. We also are not able to use function GetChildren because it generates exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException was unhandled by user code HResult=-2146233087 Message=An exception occurred when trying to discover information about a Silverlight control. Source=Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight BasicMessage=An exception occurred when trying to discover information about a Silverlight control. StackTrace: at Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight.SilverlightControlManager.SendMessage(ExtensionQueryMessage functionMessage, Int32 responseTimeOut, InvalidateParams param) at Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight.SilverlightControlManager.SendMessage(ExtensionQueryMessage functionMessage, InvalidateParams param) at Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight.SilverlightControlManager.ChildEnumeration(EnumeratorData data, ChildEnumeratorAction action, Int32& newEnumeratorIndex, List`1 elements, InvalidateParams param) at Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight.ChildrenEnumerator..ctor(SilverlightElement element) at Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight.SilverlightTestPlugin.GetChildren(IUITechnologyElement element, Object parsedQueryIdCookie) at Microsoft.VisualStudio.TestTools.UITest.Framework.SwitchingHelper.GetChildrenEnumerator(IUITechnologyElement element, Object parsedQueryIdCookie) at Microsoft.VisualStudio.TestTools.UITest.Framework.UITestService.GetChildren(IUITechnologyElement element, Object parsedQueryIdCookie) at Microsoft.VisualStudio.TestTools.UITesting.UITestControlCollection.FromChildren(UITestControl parentElement) at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetChildrenPrivate() at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<GetChildren>b__17() at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction) at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetChildren() at SimpleCodedUITestForXamTreeAndXamDataTree.UIMap.SelectContact() in d:\TestProjects\Silverlight\SimpleCodedUITestForXamTreeAndXamDataTree\UIMap.cs:line 126 at SimpleCodedUITestForXamTreeAndXamDataTree.CodedUITest1.XamDataTreeTestMethod() in d:\TestProjects\Silverlight\SimpleCodedUITestForXamTreeAndXamDataTree\CodedUITest1.cs:line 33 InnerException: HResult=-2146233088 Message= System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.SlSpyUtility.IsControlItemControl(AutomationPeer peer) at Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.TreeWalkerHelper.GetChildren(SlNativeElement element, Boolean ignorePopup) at Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.ChildrenEnumerator.GetEnumeratorData(Int32 enumeratorCapacity) at Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.SlSpyTechnologyManager.<>c__DisplayClass29.<ProcessData>b__6() at Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.SlSpyTechnologyManager.<>c__DisplayClass2f.<InvokeOnUIThread>b__2e() InnerException:
Do you have some recommendations for us?
Thanks
Hello Polina,
Thank you for your post. I have been looking into your issue and it may occurs because of a lot of changes and modification of the source code of our controls that you want to test using Coded UI. Currently we do not provide official support for this kind of automation tests and it is expected after several versions of our toolsets to appears issues with a functionality which is not maintained. This kind of automation may work well for some of our controls like XamDataGrid but it is still not fully applied for all of the controls.
My suggestion is to submit a product idea at http://ideas.infragistics.com about full support for coded UI Testing with our XAML controls.
Hi Stefan,
Thank you for your answer.
I know that you do not provide official support for Coded UI tests. For example XamtTree control with DataTemplate does not support Coded UI at all. But with XamDataTree it was possible in Infragistics 12.2 version and we hoped that in future versions this feature should be only improved. Now we have about 100 broken tests. And those tests are very important for us.
Also I have noticed that using XamDataTree provides problems with standard Silverlight controls. For example I can't handle Button control if it is located after XamDataTree control. It seems like XamDataTree somehow manages to broke UI automation navigation tree.
Could I ask you to investigate this problem a little bit deeper?
Thanks, Polina
As I said, since version 12.2 the source code has been changed and these changes may made the XamDataTree not to work with CodedUI. As I said we do not provide official support for it and we don't test our controls for CodedUI compatibility. The changes are made for purpose and we cannot undo them because this will break our main functionality. The thing you can do is logging a product idea for official support of CodedUI.
Thanks for your understanding.