Page 1 of 1

selecting image driven by text

Posted: Tue Feb 26, 2019 12:57 am
by DVDaud
Hi,

I am trying to select an image based on what text is sitting next to it, is there anyway to achieve this?

This is what the spy identifies:
Image

Basically I need it to check the serial number which is text based and then if validation passes to click on the + sign which is an image.

It is a dynamic list so the position changes all the time and the + sign is identical so I am trying to figure out if there is a way to select the image based on the text that sits next to it.

Any help would be appreciated.

Thanks

Re: selecting image driven by text

Posted: Tue Feb 26, 2019 12:10 pm
by odklizec
Hi,

Could you please upload a Ranorex snapshot (NOT screenshot) of the problematic element? Screenshot is unfortunately useless for UI evaluation. And without, at very least, Ranorex snapshot, it's impossible to suggest something realiable. Thanks.

Re: selecting image driven by text

Posted: Wed Feb 27, 2019 1:59 am
by DVDaud
Attached the snapshot and attached a screen shot highlighting the elements of concern.
Snapshot1.rxsnp
Capture3.PNG

Re: selecting image driven by text

Posted: Wed Feb 27, 2019 2:01 am
by DVDaud
Capture3.PNG

Re: selecting image driven by text

Posted: Wed Feb 27, 2019 8:56 am
by odklizec
Hi,

Well, this kind of UI does not offer room for an easy connection between UI siblings. In your case, the best you can probably do, is something like this...

Code: Select all

/form[@title~'^Attachments\ Viewer' and @processname='Visage RIS']/text[@accessiblename='10.101900760 : Com...']/following-sibling::picture[][3]
You may want to replace text "10.101900760 : Com..." with variable, to make the xpath dynamic?
On the other hand, your app seems to be uninstrumented Flex Air application and therefore, what we see in the snapshot, is very likely an unoptimized and limited UI representation!
Air_technology_limit.png
I would suggest you to check these pages, related to Flash/Flex apps and how to instrument them...
https://www.ranorex.com/help/latest/int ... x-testing/
https://www.ranorex.com/help/latest/int ... flashflex/
BTW, the link in technology limitation warning dialog, points to an old user guide page. If someone from Ranorex reads this, please check it out ;)

Re: selecting image driven by text

Posted: Thu Feb 28, 2019 12:04 am
by DVDaud
following-sibling::picture worked perfectly, thank you very much.

I will have a browse of those pages too :)

Re: selecting image driven by text

Posted: Thu Feb 28, 2019 8:27 am
by odklizec
Hi,

The problem of the solution I provided is, that if there is different number of pictures between the text and given picture, the xpath may pick wrong element ;) You should definitely inspect the possibility to instrument your app, which may help with better IDs.