I use Ranorex v4.1.2.16100
I have a WPF datagrid from devexpress (GridControl) and set it as:
AutomationProperties.AutomationId="FilesDataGrid"
Path was tracked with SPY/track button
Code: Select all
/form[@automationid='Swissphone.SolutionKit.Desktop.UI.Views.MainWindow']
/?/?/container[@automationid='DockManager(53661974)']
/container[@automationid='LayoutGroup_LayoutGroup(29760277)']/container[@automationid='LayoutGroup_LayoutGroup(46041549)']/?/?/container[@name='Filing']
/container[@name='PART_Content']//container[@automationid='FilesDataGrid']
Code: Select all
?/?/container[@automationid='DockManager(66273709)']/container[@automationid='LayoutGroup_LayoutGroup(28602718)']
/container[@automationid='LayoutGroup_LayoutGroup(46541742)']/?/?/container[@automationid='c825b634-ec4b-40bd-b4f6-74dd99060cc8' and @name='Filing']
/container[@name='PART_Content']//container[@automationid='FilesDataGrid']
The first action -mouse click- is executed. The next action which is a user code action is also executed - I set a breakpoint inside the method -
Code: Select all
public void ClickFirstGridRow()
{
Delay.Milliseconds(1000);
var firstRow = repo.SwissphoneSolutionKitDesktopUIViews.Modules_Filing.FilesDataGrid.Children[0];
firstRow.Click();
}
1.) In the UI the row is not clicked, the mouse pointer is still over the control of action number one
2.) The test fails because it can not find the item FilesDataGrid.
Thats the error report of the failed test:
Failed to find item
Code: Select all
'Swissphone_SolutionKit_Desktop_Modules_Filing_RanorexTestsRepository.SwissphoneSolutionKitDesktopUIViews.Modules_Filing.FilesDataGrid'.
No element found for path '?/?/container[@automationid='DockManager(53661974)']/container[@automationid='LayoutGroup_LayoutGroup(29760277)']/container[@automationid='LayoutGroup_LayoutGroup(46041549)']/?/?/container[@name='Filing']/container[@name='PART_Content']//container[@automationid='FilesDataGrid']' within 1m.
Show/Hide Stacktrace
at Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException) at Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException) at Swissphone.SolutionKit.Desktop.Modules.Filing.RanorexTests.Swissphone_SolutionKit_Desktop_Modules_Filing_RanorexTestsRepositoryFolders.Modules_FilingFolder.get_FilesDataGrid() in d:\SwionFramework\trunk\Swissphone.SolutionKit.Desktop.Modules.Filing.RanorexTests\Swissphone.SolutionKit.Desktop.Modules.Filing.RanorexTestsRepository.cs:line 845 at Swissphone.SolutionKit.Desktop.Modules.Filing.RanorexTests.DeleteAFile_ShowsAMessageBox.ClickFirstGridRow() in d:\SwionFramework\trunk\Swissphone.SolutionKit.Desktop.Modules.Filing.RanorexTests\DeleteAFile_ShowsAMessageBox.UserCode.cs:line 52 at Swissphone.SolutionKit.Desktop.Modules.Filing.RanorexTests.DeleteAFile_ShowsAMessageBox.Ranorex.Core.Testing.ITestModule.Run() in d:\SwionFramework\trunk\Swissphone.SolutionKit.Desktop.Modules.Filing.RanorexTests\DeleteAFile_ShowsAMessageBox.cs:line 85 at Ranorex.Core.Testing.TestSuiteModule.RunInternal(DataContext parentDataContext)