Validation Failed to find item

Ask general questions here.
Peter789
Posts: 2
Joined: Thu Jun 23, 2016 3:21 pm

Validation Failed to find item

Post by Peter789 » Thu Jun 23, 2016 3:51 pm

Hi

I have only started to use Ranorex and have managed to get allot of good automation testing working, but I have run into a problem with one of our screens that I cannot get to Pass validation on any elements.

When Recording the validation it finds the xpath and creates the repository element but when I run the test case it fails to find it. Even stranger is when I run the test case from TeamViewer(remote desktop) it actually passes? But I need it to run and pass with out a remote desktop client attached.

The failure error I get is:
Attribute 'Text' of element for item 'EdgePosTillTestingRepository.Prowin32.BandHeaders.CellColumnHeaderTxTotal' does not
match the specified value (Failed to find item 'EdgePosTillTestingRepository.Prowin32.BandHeaders.CellColumnHeaderTxTotal'.
No element found for path '/form[3]//container[@controlname='ultraExpandableGroupBoxPanel3']//tree
[@automationid='ColScrollRegion: 0, RowScrollRegion: 0']/row[@automationid='Band Headers']/cell[@automationid='[Column
Header] TxTotal']' within 1.5m.).

Module execution was aborted because a validation step has failed. Attribute 'Text' of element for item
'EdgePosTillTestingRepository.Prowin32.BandHeaders.CellColumnHeaderTxTotal' does not match the specified value (Failed to
find item 'EdgePosTillTestingRepository.Prowin32.BandHeaders.CellColumnHeaderTxTotal'. No element found for path '/form
[3]//container[@controlname='ultraExpandableGroupBoxPanel3']//tree[@automationid='ColScrollRegion: 0, RowScrollRegion:
0']/row[@automationid='Band Headers']/cell[@automationid='[Column Header] TxTotal']' within 1.5m.).


The xPath is: /form[3]//container[@controlname='ultraExpandableGroupBoxPanel3']//tree[@automationid='ColScrollRegion: 0, RowScrollRegion: 0']/row[@automationid='Band Headers']/cell[@automationid='[Column Header] TxTotal'

ANy help you could supply for this would be greatly appreciated

Thanks
Peter
Attachments
Failed Validation.rxsnp
(67.5 KiB) Downloaded 35 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3949
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Validation Failed to find item

Post by odklizec » Fri Jun 24, 2016 9:17 am

Hi Peter,

Two things... You can only automate via remote desktop if the Ranorex test is actually installed/started on the remote machine. You cannot automate anything via remote desktop, because remote desktop is just a bunch of very large screenshot displayed in rapid succession. So there is nothing to automate ;) Please follow the user guide chapter describing how to work remotely with Ranorex:
http://www.ranorex.com/support/user-gui ... norex.html

Also, since Ranorex 6 you can use new Remote functionality, which allows you to send tests from your desktop to remote system:
http://www.ranorex.com/support/user-gui ... emote.html

Additionally, I see a problem in your xpath.

Code: Select all

/form[3]//container[@controlname='ultraExpandableGroupBoxPanel3']//tree
[@automationid='ColScrollRegion: 0, RowScrollRegion: 0']/row[@automationid='Band Headers']/cell[@automationid='[Column Header] TxTotal']
The /form[3]cannot be found in the snapshot you posted. My advice, use element index in xpath only if there is absolutely no other way to uniquely identify an element. If there is no unique attribute you can use, try to use element without attributes. Index numbers make the xpaths very fragile in long term testing.

So in your xpath, either remove the index, or replace it with 'controlname' attribute, as suggested in the snapshot.

Code: Select all

/form[@controlname='RecallPanel']//container[@controlname='ultraExpandableGroupBoxPanel3']//tree
[@automationid='ColScrollRegion: 0, RowScrollRegion: 0']/row[@automationid='Band Headers']/cell[@automationid='[Column Header] TxTotal']
Hope this helps?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Peter789
Posts: 2
Joined: Thu Jun 23, 2016 3:21 pm

Re: Validation Failed to find item

Post by Peter789 » Fri Jun 24, 2016 11:37 am

Hi Pavel

Thank you very much for the reply this has worked perfectly and my validations are all working with or without remote desktop connected.

Thanks Again
Peter