public
void
CanObserveCellContent()
{
var grid = wpfApp.MainWindow.Find.ByName<RadGridView>(
"_searchResults"
);
grid.Rows[0].User.Click(MouseClickType.LeftDoubleClick);
//other steps and assertions
}
The second line simulating the click throws the exception. But if I change the second line to this and comment out the rest of the test:
Assert.AreEqual(
"Test1"
, grid.Rows[0].Cells[0].Text);
11 Answers, 1 is accepted
You really need to pick a specific cell to click on:
RadGridView grid = ActiveApplication.MainWindow.Find.ByName<RadGridView>(
"RadGridView1"
);
grid.Rows[1].Cells[2].User.Click(MouseClickType.LeftDoubleClick);
Cody
the Telerik team
Test Studio Trainings
Thanks for the reply, but the same exception is thrown when I change the code to perform the click on a cell instead of the row. I get the following exception:
ArtOfTest.Common.Exceptions.FindElementException: Unable to find the specified element: Unable to find the element of type: gridviewcell
Any other ideas? Do you need more of my code to look into this?
What I really need is a copy of your WPF application (source code or .exe) so i can reproduce this problem. I am not able to reproduce it using our WPF samples which include a RadGridView.
Kind regards,Cody
the Telerik team
Test Studio Trainings
Thank you for the project. I was able to reproduce the problem with it. I don't know what's going on exactly, possibly a bug in our WPF RadGridView translator. I found I can overcome it by manually fetching a list of all the GridViewRow's like this:
RadGridView grid = ActiveApplication.MainWindow.Find.ByName<RadGridView>(
"_searchResults"
);
IList<GridViewRow> rows = grid.Find.AllByType<GridViewRow>();
rows[0].Cells[2].User.Click(MouseClickType.LeftDoubleClick);
I'm going to file an internal bug to try and get to the bottom of why grid.Rows[0] doesn't work as expected with your simple application. Kind regards,
Cody
the Telerik team
Test Studio Trainings
Thanks! Good to know that I'm not crazy. I'll move forward with the workaround you provided. Thank you!
Brian
Brian
The version of the WPF controls is my only thought. I was prompted to upgrade the project when I loaded your project - see the attached screen shot.
I'd like to look at this problem on your computer via GoToMeeting. Would tomorrow at 11am Central Time work for you?
1. Please join my meeting, Tuesday, August 14, 2012 at 11:00 AM Central Daylight Time.
https://www2.gotomeeting.com/join/139616130
2. Use your microphone and speakers (VoIP) - a headset is recommended. Or, call in using your telephone.
Dial +1 (312) 878-3082
Access Code: 139-616-130
Audio PIN: Shown after joining the meeting
Meeting ID: 139-616-130
GoToMeeting®
Online Meetings Made Easyâ„¢
Cody
the Telerik team
Test Studio Trainings
Just a quick follow up to document the outcome of our meeting.... I can't explain why you're getting the exception. You will work on upgrading the version of the Telerik WPF controls installed on your machine to at least .725 version to match what I'm using since I don't get the error on my machine using the same code.
Greetings,Cody
the Telerik team
Test Studio Trainings
Just following up, do you still need assistance with this problem?
Kind regards,Cody
the Telerik team
Test Studio Trainings