This is a migrated thread and some comments may be shown as answers.

CodedUI and RadGridView can't read row text

7 Answers 182 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 05 Jan 2012, 05:38 PM
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?

7 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 10 Jan 2012, 03:21 PM
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).
0
Dave
Top achievements
Rank 1
answered on 07 Aug 2012, 12:43 AM
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?
0
Peter
Telerik team
answered on 09 Aug 2012, 01:39 PM
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 >>
0
Dave
Top achievements
Rank 1
answered on 01 Apr 2013, 05:08 PM
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?
0
Peter
Telerik team
answered on 03 Apr 2013, 01:35 PM
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 >>
0
Sakthivel
Top achievements
Rank 1
answered on 25 Jun 2015, 06:37 AM
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.
0
Peter
Telerik team
answered on 29 Jun 2015, 07:37 AM
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
Tags
General Discussions
Asked by
Peter
Top achievements
Rank 1
Answers by
Peter
Telerik team
Dave
Top achievements
Rank 1
Sakthivel
Top achievements
Rank 1
Share this question
or