How to ignore the title of tested files

Ask general questions here.
anouar2002
Posts: 38
Joined: Thu Feb 27, 2020 2:06 pm

How to ignore the title of tested files

Post by anouar2002 » Thu Aug 04, 2022 7:34 pm

Hello,

I am using Ranorex 10.1.16 for tetsing a desktop application based on winforms.

I am using the image validation to check some data provided in form of excel and pdf by my AUT.

That's means that the application exports a pdf and and excel file and I want to check the content of its using image validation.

The problem that my AUT generates automatically a name for the exported file basing on the date of creation (Example: 'UC-1821_UDC_2022-08-04_16h53m.pdf'). And this name changes in each run of the test. So the path of the existed item and the tested one are always different.

By exporting excel, there is no problem because Ranorex uses the processname as follows: "/form[@processname='EXCEL']//table[@name='Details']/row[@index='140']/cell[@address='I14']"

But exporting pdf uses always the titel in the path as follows:
/form[@title>'validUDC_2022-04-20_23h35m.pdf']/element[@instance='1']/element/element[@instance='1']/element[@instance='1']/element[@instance='0']/element[@instance='1']/element[@class='AVL_AVView']/element[@class='AVL_AVView']/element[@instance='0']

Is there any solution to fix that ?

I am waiting your suggestions

Thanks in advance

csaszi89
Posts: 41
Joined: Mon Jan 17, 2022 12:10 pm

Re: How to ignore the title of tested files

Post by csaszi89 » Fri Aug 05, 2022 11:52 am

Hi,

if you ensure that only one pdf exists at the same time, then you can use RxPath as follows:
/form[@title~'.pdf']/...
Additionally, you can use it like you did in case of excel:
/form[@processname='Acrobat']/...
This case Ranorex will find the first (and hopefully the only one) form which has ".pdf" in its title or which has processname "Acrobat".
As I said, the only limitation it has if more than one pdf form exists at the same time. Then you do not know which instance you need at runtime.

BR,
Gyuri

anouar2002
Posts: 38
Joined: Thu Feb 27, 2020 2:06 pm

Re: How to ignore the title of tested files

Post by anouar2002 » Mon Aug 08, 2022 7:13 am

Hi csaszi89,

Thanks for trying to help and sorry for the late answer.

Your two suggestions are good and can solve the issue but the problem is on modifiying the first part of the path. This is written in grey and cannot be edited as shown in this screenshot:

https://imgur.com/a/2SMOYQN