Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Coded UI tests and Infragistics Controls
posted

Hi,

Our application has third party controls like Infragistics and Syncfusion.

Iam working on XamTabControls from Infragistics.

I could learn the wpfCustom and could perform a click on that control,But when I start dragging the image that is present on the hierarchical tab Page it fails.

with the following error :

Test method TestProject10.CodedUITest1.TestMethod2 threw exception: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: TechnologyName:  'UIA' ControlType:  'Image' AutomationId:  'VariableReference_Content' ClassName:  'Uia.Image'  Search may have failed at 'ClientArea' TabList as it may have virtualized children. If the control being searched is descendant of 'ClientArea' TabList then including it as the parent container may solve the problem. ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.

Here is my code :

 

WpfWindow mainWindow = new WpfWindow();

      mainWindow.SearchProperties[

WpfWindow.PropertyNames.Name] = "NextGen Simulation v0.0.0.1";

     

WpfCustom tabViewCustom = new WpfCustom(mainWindow);

      tabViewCustom.SearchProperties[

WpfCustom.PropertyNames.AutomationId] = "TabView";

      tabViewCustom.SearchProperties[

WpfCustom.PropertyNames.ClassName] = "Uia.PaneInstance";

     

WpfTabList clientareatabList = new WpfTabList(tabViewCustom);

      clientareatabList.SearchProperties[

WpfTabList.PropertyNames.AutomationId] = "ClientArea";

      clientareatabList.SearchProperties[

WpfTabList.PropertyNames.ClassName] = "Uia.TabControl";

     

WpfTabPage archestraTabpage = new WpfTabPage(clientareatabList);

      archestraTabpage.SearchProperties[

WpfTabPage.PropertyNames.Name]="ArchestrA.Visualization.ViewApplication.LayoutManagement.DisplayInstance";

     

WpfCustom tabViewCustom1 = new WpfCustom(archestraTabpage);

      tabViewCustom1.SearchProperties[

WpfCustom.PropertyNames.AutomationId] = "TabView";

      tabViewCustom1.SearchProperties[

WpfCustom.PropertyNames.ClassName] = "Uia.TabView";

     

WpfCustom dockCustom = new WpfCustom(tabViewCustom1);

      dockCustom.SearchProperties[

WpfCustom.PropertyNames.AutomationId] = "dockManager";

      dockCustom.SearchProperties[

WpfCustom.PropertyNames.ClassName] = "Uia.XamDockManager";

     

WpfCustom spliPane = new WpfCustom(dockCustom);

      spliPane.SearchProperties[

WpfCustom.PropertyNames.AutomationId] = "Zf202f207e7fe4fabb4e5387bd6c37231";

      spliPane.SearchProperties[

WpfCustom.PropertyNames.ClassName] = "Uia.SplitPane";

     

WpfCustom modelLibrary = new WpfCustom(spliPane);

      modelLibrary.SearchProperties[

WpfCustom.PropertyNames.AutomationId] = "ModelLibrary";

      modelLibrary.SearchProperties[

WpfCustom.PropertyNames.ClassName] = "Uia.ContentPane";

 

     

WpfCustom itemCustom = new WpfCustom(modelLibrary);

      itemCustom.SearchProperties[

WpfCustom.PropertyNames.ClassName] = "Uia.LibraryView";

     

WpfCustom itemCustom1 = new WpfCustom(itemCustom);

      itemCustom1.SearchProperties[

WpfCustom.PropertyNames.ClassName] = "Uia.LibraryView";

     

WpfTabList tabctrltabList = new WpfTabList(itemCustom1);

      tabctrltabList.SearchProperties[

WpfTabList.PropertyNames.AutomationId]="Tabctrl";

      tabctrltabList.SearchProperties[

WpfTabList.PropertyNames.ClassName]="Uia.XamTabControl";

     

WpfTabPage SimSciTabPage = new WpfTabPage(tabctrltabList);

      SimSciTabPage.SearchProperties[

WpfTabList.PropertyNames.ClassName] = "Uia.TabItem";

      SimSciTabPage.SearchProperties[

WpfTabList.PropertyNames.Name] = "SimSci";

     

Mouse.Click(new Point(130, 380));

                 

     

WpfImage Compressorimage = new WpfImage(SimSciTabPage);

 

      Compressorimage.SearchProperties[

WpfTabList.PropertyNames.AutomationId] = "Valve";

      Compressorimage.SearchProperties[

WpfTabList.PropertyNames.ClassName] = "Uia.Image";

     

int x = Compressorimage.BoundingRectangle.Location.X + Compressorimage.BoundingRectangle.Width / 2;

     

int y = Compressorimage.BoundingRectangle.Location.Y + Compressorimage.BoundingRectangle.Height / 2;

 

     

Mouse.Click(new Point(x, y));

      Compressorimage.DrawHighlight();

     

Playback.Wait(500);

     


//It fails here ..

Mouse.StartDragging(Compressorimage, new Point(x, y), MouseButtons.Left, ModifierKeys.None);

 

My query:

Does the infragistics controls like  "XamDataGrid"," XamTabControls","XamDataGrid" support CodedUI Automation ??And to what extent??

 

If not is there a work around to do a drag and drop using Mouse.StartDragging(),Mouse.StopDragging??

 

 

 

 

Parents Reply Children
No Data