Failed to find item during testing

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
HelloWorld
Posts: 4
Joined: Mon Nov 04, 2013 4:34 pm

Failed to find item during testing

Post by HelloWorld » Mon Nov 04, 2013 5:06 pm

I am Ranorex beginner.

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']
Path of the FilesDataGrid in the repository

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']
These are my two actions:

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();
}
the firstRow is never null so the click() should work but....

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)
Why does it not find the item?

HelloWorld
Posts: 4
Joined: Mon Nov 04, 2013 4:34 pm

Re: Failed to find item during testing

Post by HelloWorld » Tue Nov 05, 2013 10:07 am

This same issue I had this morning again:

I clicked on the repository item "edit path" button then this is shown:
Image (Spy 32bit)

See the above image where the FilesDataGrid can not be found

When I start the Spy 64bit I get this image from the running application when I click on the FilesDataGrid:

Image

Why these differences in the result?

Btw. I am running Windows 7 64bit.

HelloWorld
Posts: 4
Joined: Mon Nov 04, 2013 4:34 pm

Re: Failed to find item during testing

Post by HelloWorld » Tue Nov 05, 2013 1:59 pm

SnapShotDevexpressGridControlPathNotFound_User_HelloWorld.rxsnp
Please forget what I wrote before. Take the following information as up to date:

From desktop.exe and spy 64bit
------------------------------
/form[@automationid='Swissphone.SolutionKit.Desktop.UI.Views.MainWindow']/
container[@automationid='BarManager']//
container[@automationid='LayoutGroupInnerWrapper']/?/?/
container[@name='Filing']/
container[@name='PART_Content']//
table[@automationid='FilesDataGrid']

From the run test error report:
-------------------------------
Failed to find item 'Swissphone_SolutionKit_Desktop_Modules_Filing_RanorexTestsRepository.FilesDataGrid1'.
No element found for path

'/form[@automationid='Swissphone.SolutionKit.Desktop.UI.Views.MainWindow']/
container[@automationid='BarManager']//
container[@automationid='LayoutGroupInnerWrapper']/?/?/
container[@name='Filing']/
container[@name='PART_Content']//
table[@automationid='FilesDataGrid']' within 30s.

Why does it not find the repo item although the path is the same as from your SPY tool?

That does not make sense.

I just tried to make a "Highlight Element" on the repo item and there appears a red frame around my GridControl in the UI of my app.
You do not have the required permissions to view the files attached to this post.

HelloWorld
Posts: 4
Joined: Mon Nov 04, 2013 4:34 pm

Re: Failed to find item during testing

Post by HelloWorld » Wed Nov 06, 2013 1:52 pm

I have contacted you now via your contact formular to get personal remote assistance :wink:

basv
Posts: 3
Joined: Wed Dec 04, 2013 9:45 am

Re: Failed to find item during testing

Post by basv » Wed Dec 04, 2013 10:35 am

I have exactly the same issue. What have you done to solve this issue? Any tips?

basv
Posts: 3
Joined: Wed Dec 04, 2013 9:45 am

Re: Failed to find item during testing

Post by basv » Thu Dec 05, 2013 2:48 pm

basv wrote:I have exactly the same issue. What have you done to solve this issue? Any tips?
My issue was that my test suite was located and stored on a network drive. Testing works fine after copying it to my local hard drive.