Failed to find item 'MyRepo.WebDocumentHash.Text12062014'

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Vic
Posts: 3
Joined: Wed Jun 04, 2014 5:59 pm

Failed to find item 'MyRepo.WebDocumentHash.Text12062014'

Post by Vic » Fri Jun 13, 2014 4:56 pm

Hi,

I am new to Ranorex and C#. I am having the following problem:

In our application, I need to validate a displayed date field. Everyday, when the application is ran, the value of the date field changes.
The day the test is recorded, it works fine. The following day, the execution of the test fails with the message:
"Failed to find item 'MyRepo.WebDocumentHash.Text12062014'.
No element found for path '/dom[@domain='qa4-lexo-util.accovia.com:18180']/?/?/flexobject[@id='bookingApp']//container[@automationname='5 - Confirmation']/form[@type='Form']/container[@automationname='Date d''annulation']/text[@automationname='12/06/2014']' within 1m
.

The [@automationname='12/06/2014'] portion of the Path takes the date of the creation of the path.

Code: Select all

   DateAnnul = repo.WebDocumentHash.Text12062014.TextValue; 
Thanks in advance for your help.

Vic

Ranorex 5.0.3.18203
Windows XP, Service Pack 3
I.E. 7
Attachments
DateToBeValidated.png
DateToBeValidated.png (12.12 KiB) Viewed 743 times

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Failed to find item 'MyRepo.WebDocumentHash.Text12062014'

Post by mzperix » Mon Jun 16, 2014 3:54 pm

Hi Vic,

Just delete the whole attribute that contains the date. Ranorex should be able to identify the element without the @automationname attribute.

The xpath should look like like this:

/dom[@domain='qa4-lexo-util.accovia.com:18180']/?/?/flexobject[@id='bookingApp']//container[@automationname='5 - Confirmation']/form[@type='Form']/container[@automationname='Date d''annulation']/text

In general, it is a good practice to review the generated xpath, and restructure the repository:
- use simple folders for logical structuring
- use rooted folders to gather elements that have the same xpath
- after you got familiar with Ranorex Xpath, use the xpath weight rules to change xpath is generated (like do not use @automationname attribute on the date field)

Best Regards,
Zoltan

Vic
Posts: 3
Joined: Wed Jun 04, 2014 5:59 pm

Re: Failed to find item 'MyRepo.WebDocumentHash.Text12062014'

Post by Vic » Tue Jun 17, 2014 8:51 pm

Many thanks Zoltan. It is working now.