Coded UI test builder is unable to Identify Control , so what is the Work around we have to identify that Control. RRS feed

  • Question

  • Hi All,

    I have a grid(Infragistics) Inside the Grid we have 3 Columns out of which 1 Contains Check Boxes entirey and remaining 2 Colums Filled with text.

    when I place the Cursor in any of the cell and Perform (Win + I) action Coded UI test Builder keeps on searching the Control , Never suceeds . At the End we have to Kill that "Coded UI test Builder" Process from the task manager.

    Even when we drag the Cross hair to the cell inside the Grid it keeps on searching , it never succeds

    So What Conclusion I came to is , Coded UI test Builder is failing to Identify the Cells inside the Grid

    My Questions are

    1. What is the Work around for this situation like the above where the Coded UI test Builder fails to Identify the Control.

    My requirement is to Click on the Check Box which is inside the cell of a grid.

    Thanks in advance

    Palaniyappan Vaithiyantahan



    palaniyappan Vaithiyanathan
    Wednesday, November 17, 2010 12:12 PM

All replies

  • Infragistics controls are custom controls, to support these controls you have to write extension for it, so that Coded UI Test builder can recognise it properly.

    Please refer to http://blogs.msdn.com/b/gautamg/archive/2010/01/05/series-on-coded-ui-test-extensibility.aspx  on extensibility

    Aditya Kumar Agrawat (MSFT)
    Thursday, November 18, 2010 5:46 AM
  • Hi Aditya,


    If you are telling for Infragistics Control - u need to write an Extension ,

    My Entire Application is built with Infragistics Control

    I am able to do the necessary actions on almost all the COntrols Except few.

    How is that Possible for the Coded UI to Work on Some Infragistics Control and not on others

    Kindly Suggest me the ways to overcome such Issues


    Palaniyappan Vaithiyanathan



    palaniyappan Vaithiyanathan
    Thursday, November 18, 2010 10:34 AM
  • There is no well defined support statement for Infragistics controls in the current release. It depends upon the complexity and implementation of the control based on the following:

    1. Accessibility : It serves as the necessary requirement for Coded UI Test to work on thick UI applications. Parent/children relationship is also one aspect of it for search/control identification.

    2. Events : Necessary to get the right values/type of action on the control

    So given above and there are many other points because of which you may find different behavior from Coded UI Test for different controls in Infragistics.

    But for your issue, can you try the following ? This is expected to work if parent/children relationships are defined correctly for the control.

    Add grid control to your UIMap manually either by dropping the cross hair or by navigating from its sibling.

    Now Grid.Rows will give you all the rows present in the grid and .Cells for row object can give you the cells.

    Thursday, November 18, 2010 11:24 AM
  • When I try to add it manually to my UIMAP.DESIGNER.CS file by Placing the cursor in Cell and performing (WIN + I) operation , It keeps on searching the Control but never Succeds

    Secondly when I Drag the Cross hair , I get a Blue Highlighter on the Indviduall cell , but that also never succeds in Identifying the Control.

    Atlast I will have to kill that Process in the Task manager

    So Identifying the Control itself is not Suceeded



    Palaniyappan Vaithiyanathan


    palaniyappan Vaithiyanathan
    Thursday, November 18, 2010 11:37 AM
  • When you say Identifying the control you mean the playback/refresh from Coded UI Test builder or the very first time when you have just dropped the cross hair on the cell ?

    If it is latter I suspect whether this grid is a Winforms 1.1 data grid(the conventional winforms data grid). There is a known issue for that kind of data grid.

    Can you locate some other control not the grid and then use navigation to reach out the right control ?

    Thursday, November 18, 2010 12:13 PM
  • When I say Identifying the control , It means that Adding the Control to the UI map by Pressing (WIN + I ) combination by placing the Cursor in the Control

    So when i Place the Cursor and press (WIN + I) it keeps on searching , no result.

    it is the issue with only the Grid

    Coded UI test Builder is able to identify the Grid as a Whole but not the Indiviudal Cells, For me to perform the action on the Individual cell.

    answer to yor first question Dropping the cross hair inside the cell of a grid keeps on searching but it never prodeces any result .

    I am able to locate other Controls like Ultratext box ,ultracombo box i guess the issue is only with Grid

    Hop I have answered all your Questions

    Please let me know if yu need any thing in specific



    Palaniyappan Vaithiyanathan





    palaniyappan Vaithiyanathan
    Thursday, November 18, 2010 12:46 PM
  • Hi all,

    Any resolution for the above mentioned issue.



    Palaniyappan Vaithiyanathan

    palaniyappan Vaithiyanathan
    Monday, November 22, 2010 6:22 AM
  • As suggested in earlier post also you need to use navigation in Coded UI Test builder to add grid to your UI Control map and then you need to write your own custom code to get hold of cells (I am not 100% sure whether it'll be possible or not, as we havent done any testing on Infragistics grids with Visual Studio 2010).

    Locate any nearby control except grid using Coded UI Test builder, use appropriate navigation to reach out the grid, add it to the control map. After this you can write code in UIMap.cs to do actions on cell.

    Monday, November 22, 2010 6:52 AM
  • HI Deepak,

    Thank your  for your support.

    I used the navigation Control in the Coded UI test builder and Identified the Control as a table.

    Can u Help me out in make me understand how to write the Customized code in accessing the cells.

    It would be great if you could explain us with an Example

    I.e If the Control is not Identified in the Windows Application(In my case cells inside Grid) , you add the Control that is Closest to the actual Control(In my case Grid).then How do we write the Customised Coded to access it.

    This gives a Big step Forward in my progress

    Then show us how to Write the Customised Code

    Looking forward for your support


    Palaniyappan Vaithiyanathan



    palaniyappan Vaithiyanathan
    Monday, December 6, 2010 12:28 PM
  • Following is a sample code where you have to copy the reference of your grid in the first line. Then it'll try to look for second row and its second cell's value.

          WinTable dataGridTable = this.UIMap.UIDataGrid_EmbeddedWindow.UIDataGridView3Window.UIDataGridViewTable; //Put the reference to your datagrid table here
          WinRow targettedRow = new WinRow(dataGridTable);
          targettedRow.SearchProperties[WinRow.PropertyNames.RowIndex] = "2"; //It means I am looking for second row in the table
       targettedRow.Find(); //To make sure the search passes for the row
          WinCell targettedCell = targettedRow.Cells[1] as WinCell; //Accessing the second cell of the row
          Console.WriteLine(targettedCell.Value.ToString()); //Printing the value of the 2nd cell of 2nd row

    Please try to use this code from UIMap.cs and let me know if this helps.

    PS: As mentioned earlier also, I am not sure about the accessibility support from the grid where you'll try this code but this code is bare minimum and does not depend on any specific property except .Children and .Parent.

    Monday, December 6, 2010 3:05 PM
  • I am having the same issue being discussed in this thread and tried doing the steps mentioned to get the row and cell references and it doesn't work. When I run the test, VS hangs indefinitely. When I try to inspect a cell in the grid using the crosshair of the test builder, it does the same (indefinitely shows the "Please wait..." progress bar) and I have to kill the process using the task manager.

    Any assistance is greatly appreciated.

    Thursday, February 17, 2011 3:14 PM
  • Hi Ravi

    Are you also using the Infragistics data grid? If yes, I would suggest you to try out the workarounds mentioned in this thread or other threads in this forum. We do not claim support for Infragistics controls due to the poor accessibility support from control side.

    If it is not the case please start up a new thread with details related to your control e.g., type of data grid [class name will help]


    Friday, February 18, 2011 5:58 AM
  • Yes Deepak, Thanks for the prompt reply. The UI is using infragistics data grid. Can you elaborate on what my options would be since there is no in-build support for these controls in VS2010. Should I be looking into creating my own extensions? or pick another tool? or something else?

    Here are the class definitions and the code I am using to parse the row data:



    public class UI_gridSRWindow : WinWindow





    public UI_gridSRWindow(UITestControl searchLimitContainer) :








    Search Criteria



    this.SearchProperties[WinWindow.PropertyNames.ControlName] = "_gridSR";













    public UI_gridSRTable UI_gridSRTable








    if ((this.mUI_gridSRTable == null))




    this.mUI_gridSRTable = new UI_gridSRTable(this);




    return this.mUI_gridSRTable;




    // In the TestMethod region of CodedUItest




    testTbl = this.UIMap.UIServicesWindow1.UIServiceRequestHomePaWindow.UI_gridSRWindow.UI_gridSRTable;

    testTbl.DrawHighlight(); //This step works as expected and highlights the table.

    WinRow myRow = new WinRow(testTbl);



    WinRow.PropertyNames.RowIndex, "2");


    myRow.DrawHighlight(); // The execution does not reach this step.

    Friday, February 18, 2011 3:11 PM
  • If the search has been passing for the table, I would suggest to try out the .Rows property for the row. It'll return all the rows of the grid then you can iterate through the rows.

    Wednesday, February 23, 2011 5:57 PM
  • I have tried that in the following way as you mentioned:

    WinTable testTbl = (WinTable) this.UIMap.UIEpiqServiceWindow1.UIServiceRequestHomePaWindow.UI_gridSRWindow.UI_gridSRTable;           
    UITestControlCollection allRows = new UITestControlCollection();
    allRows = testTbl.Rows;

    The .Rows property invocation results in the following exception:

    ContextSwitchDeadlock was detected
    Message: The CLR has been unable to transition from COM context 0x1aaff8 to COM context 0x1ab220 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.

    Since this is an infragistics grid, is there a way I can dynamically cast the WinTable reference to the Infragistics data grid? I have installed the Infragistics suite on my local machine and have the appropriate references for the same datastructures used in the application. I am trying to do the following but its not working:

    public class SRGrid : UltraGrid
        public SRGrid(Object _testCtrl)

    Friday, February 25, 2011 3:33 PM
  • Requesting response after subscription.

    Wednesday, March 9, 2011 9:13 PM