Hi,
I'm trying to test our Silverlight application that contains the xamPivotGrid control with coded UI tests. Coded UI testing is a feature introduced in the Microsoft Visual Studio 2010 Feature Pack 2 that allows testers to record actions and then play them back in their web browsers.
For more information about Coded UI tests, please see http://msdn.microsoft.com/en-us/library/gg269472.aspx
When recording an action that starts loading data to the PivotGrid I get the following error:
Unhandled Error in Silverlight Application Object reference not set to an instance of an object. at Infragistics.Controls.Grids.AutomationPeers.PivotCellControlAutomationPeer. SelectedCells_SelectionChanged(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) at Infragistics.Collections.CollectionBase`1.OnNotifyCollectionChanged(NotifyCollectionChangedEventArgs args) at Infragistics.Collections.CollectionBase`1.OnResetItems() at Infragistics.Controls.Grids.PivotSelectedCollectionBase`1.InternalResetItemsSilently() at Infragistics.Controls.Grids.PivotSelectedCollectionBase`1.ResetItems() at Infragistics.Collections.CollectionBase`1.Clear() at Infragistics.Controls.Grids.XamPivotGrid.ArrangeLayout() at Infragistics.Controls.Grids.XamPivotGrid.DataSourceResultChanged(Object sender, AsyncCompletedEventArgs e) at System.EventHandler`1.Invoke(Object sender, TEventArgs e) at Infragistics.Olap.DataSourceBase.OnResultChanged(AsyncCompletedEventArgs args) at Infragistics.Olap.DataSourceBase.RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e) at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e) at System.ComponentModel.BackgroundWorker.<OnRun>b__1(Object state)
Stopping the action recording and trying to generate code for the test yields the following error:
System.NotSupportedException was unhandled Message = GetProperty of "SelectedItemsAsString" is not supported for the following control type: List. If this is a custom Silverlight control, verify that the property is supported for the control. Source = Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight
Do you have any ideas how to get around this and are there any plans on supporting coded UI tests in the future?
After upgrading Infragistics Silverlight assemblies to version 10.3.20103.2098 coded UI tests seem to work fine with the PivotGrid. So, updating to the latest Service Release solved all the issues I had with UI tests.
I assume by error's description you are referring to the GetProperty of "SelectedItemsAsString" is not supported for the following control type: List. If this is a custom Silverlight control, verify that the property is supported for the control. message. This message was generated by the Coded UI Test Builder that is started when a new Coded UI Test is added to a Test project. After further research I concluded that this error message was in fact caused by another Silverlight control and not the PivotGrid.
Hi teemuh,
I tried to reproduce the issue, using the dlls from our latest Service Release, which we delivered few days ago, and I couldn't. Do you still encounter any issues there and if so, what are the exact steps that lead to getting this error? One last thing, if you don't mind, would you please share how you managed to get the error's description.
Thanks,Milana Zhileva
Hi
I saw that this fix is not included in latest SR. Next week we plan new SR and the fix is included in.
By turn selection off I mean to set selection property to None. See code below:
pivotGrid.SelectionSettings.CellSelection = Infragistics.Controls.Grids.PivotSelectionType.None; pivotGrid.SelectionSettings.RowSelection = Infragistics.Controls.Grids.PivotSelectionType.None; pivotGrid.SelectionSettings.ColumnSelection = Infragistics.Controls.Grids.PivotSelectionType.None;
Regards
I'm still experiencing the same NullReferenceException from PivotCellControlAutomationPeer.SelectedCells_SelectionChanged after having upgraded all Infragistics Silverlight controls to version 10.3.20103.2065. In which SR is this bug supposed to be fixed?
What exactly do you mean by turning off selection?
This is a bug in our AutomationPeer. The bug is fixed in latest ServiceRelease, so if you get it, you will be able run your tests without troubles.
To get around it just turn off selection while you record your tests