CodedUI and RadGridView can't read row text

8 posts, 0 answers
  1. Peter
    Peter avatar
    1 posts
    Member since:
    Nov 2010

    Posted 05 Jan 2012 Link to this post

    Hey all, forgive me if this in the wrong forum (and please move this thread into the right forum if it is).  I have a question in regards to using CodedUI with RadControls.  In our application we are using RadGridViews all over the place, and I want to drive my CodedUI tests by the data in those rows (example, click on the row that has the text "xxxxxx").  

    What the recorded test is doing now, is finding the RadGridView and then clicking on specific points associate with the RadGridView which represent the row that wants to be clicked.  The way I want to structure my tests (since these rows can change with new builds) is to assign the RadGridView to a WinTable, then by looping through the rows in that WinTable, click on the one that has the text I want to click.  As I said, the WinTable doesn't have the text of the row in it.  It just has the name of the row ("This is a row with Index x"), which is of no use to me, because the index of the row might change as stated above.

    I've attached a screen shot of what my CodedUI Inspector looks like, so you can see all of the property values.  In that screen shot, I would've expect "Value" under "Control Specific" to be the combined strings of the cells in the row.

    Are there any works around this?  Or is there some other function I should be using to view the text inside of the row?
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 10 Jan 2012 Link to this post

    Hello Peter,

    Please find the answer to your question in the support ticket that you have opened about the same topic.

    Greetings,
    Peter
    the Telerik team

    SP1
    of Q3’11 of RadControls for WinForms is available for download (see what's new).
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dave
    Dave avatar
    2 posts
    Member since:
    Aug 2012

    Posted 06 Aug 2012 Link to this post

    Hi, I have a similar issue with RadGridView.  I also have the latest version I believe, RadControls for WinForms Q2 2012 SP1. 
    When I tried to record mouse click on different Cells and they seem to be different Rows based on the codedUI naming conventions, but it failed to find the rows. 

     

    Mouse.Click(uIRow1ColumnTextValueACell, new Point(90, 14));
    Mouse.Click(uIRow2ColumnTextValueCCell, new Point(98, 14));
    Mouse.Click(uIRow3ColumnTextValueACell, new Point(97, 25));
    Mouse.Click(uIRow4ColumnTextValueZCell, new Point(99, 19));


    Also the Cells[0].toString()  always return the high lighted cell no matter what the cell index is.  I can have Cells[1].ToString() and it will return the same string that was selected.  Is this something that the Q3 2011 SP1 addresses but not the Q2 2012 SP1?
  5. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 09 Aug 2012 Link to this post

    Hello Dave, 

    Thank you for writing.

    I would like to clarify what we support from Coded UI tests - we support Basic Record and Playback, but we do not support Rich Property Validation and Intent Aware Actions, because we do not provide (yet) a Coded UI MSAA plug-in for MS Visual Studio that should be developed for this kind of scenario. I am afraid that currently I cannot propose a workaround for this.

    For more information, please read these blog posts about Coded UI Test Extension for 3rd party Windows Forms controls: Blog 1Blog 2

    Luckily, you will be happy to hear that we have plans to implement to support CUIT level 3 and level 4 and we working on that. We hope that we will be able to provide support for the desired functionality in one of our future releases.  

    Do not hesitate to contact us if you have other questions. 

    Regards,
    Peter
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  6. Dave
    Dave avatar
    2 posts
    Member since:
    Aug 2012

    Posted 01 Apr 2013 Link to this post

    Hi,

    I think we have the Q1 2013 telerik that says now it supports level 3 and level 4 for CodedUI.  However, I still couldn't use codedUI to even map the rows, cells, or the "Click here to add new row" bar.  Of course, normal DataGrid I would just map the Grid and then probably can programmatically navigate to the cell I want using row index and cell index.  How come I still cannot use codedUI to find the controls?  When I use the test builder to detect the grid, only the outside RadGridView is found, but within it, I hover the mouse over and not blue rectangle showing up.  So what does level 3 and level 4 really mean?  I've read that page and I thought that would allow unique class creation and can even programmitcally find the controls.  Any reason why I cannot find the controls from codedUI?
  7. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 03 Apr 2013 Link to this post

    Hello Dave, 

    Thank you for writing.

    You should use Microsoft Visual Studio 2010 Premium/Ultimate/Test Professional edition +VS Service Pack 1 +
     VS10SP1-KB2696646 and you should set the EnableCodedUITest property for the controls that you test.

    For example you should be able to spy and recognize the Grid's Cell as a 
    RadGridViewCellTestControl:
    public void RecordedMethod1()
    {
                #region Variable Declarations
                RadGridViewCellTestControl uIRow5ColumnStringColuCell = this.UIRadControlsforWinforWindow.UIForm1Window.UIRadGridViewDemoWindow.UIRow5ColumnStringColuCell;
                RadGridViewCellTestControl uIRow9ColumnRowIndexVaCell = this.UIRadControlsforWinforWindow.UIForm1Window.UIRadGridViewDemoWindow.UIRow9ColumnRowIndexVaCell;
                #endregion
     
                // Click 'Row 5 Column StringColumn Value String 1' cell
                Playback.Wait(10);
                Mouse.Click(uIRow5ColumnStringColuCell, new Point(174, 9));
     
                // Click 'Row 9 Column RowIndex Value 4' cell
                Playback.Wait(10);
                Mouse.Click(uIRow9ColumnRowIndexVaCell, new Point(88, 20));
     }

    With RadGridViewCellTestControl object you can access the following cell properties:
    1. ForeColor
    2. BackColor
    3. Text
    4. Selected
    5. RowIndex
    6. ColumnIndex

    Please, bear in mind that for the time being you can spy and recognize only flat grids.

    I am not sure that CodedUI tests allows navigation to the particular cell - a more advanced solution for testing is the TestComplete product. It supports more advanced features compared to the Visual Studio.

    Should you have any other questions or suggestions, do not hesitate to contact us.

    Regards,
    Peter
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  8. Sakthivel
    Sakthivel avatar
    5 posts
    Member since:
    Jan 2015

    Posted 25 Jun 2015 Link to this post

    We tried to spy the Telerik RadGridView control in Windows Store Application 8.1.  It was not detecting RadGridView Object. So Not able to access RadGridView Control and perform Coded UI Automation.
  9. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 29 Jun 2015 Link to this post

    Hi Sakthivel,

    Thank you for writing.

    This forum concerns Telerik UI for WinForms, while judging by your question about GridView control in Windows Store Application 8.1, it seems you are using some other technology. I would suggest that you address your question to the appropriate forum in order to get adequate response. The list of the forums is available here: http://www.telerik.com/forums.

    If you have having troubles finding the right forum for you, just let me know which product you are using and I will help you find it.

    Regards,
    Peter
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready