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
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).
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?
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 1, Blog 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.
Peter
the Telerik team
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?
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:
- ForeColor
- BackColor
- Text
- Selected
- RowIndex
- 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.
Peter
the Telerik team
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