selecting image driven by text

Ask general questions here.
DVDaud
Posts: 4
Joined: Tue Feb 26, 2019 12:40 am

selecting image driven by text

Post by DVDaud » Tue Feb 26, 2019 12:57 am

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
Attachments
Untitled.png
Untitled.png (10.29 KiB) Viewed 152 times

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

Re: selecting image driven by text

Post by odklizec » Tue Feb 26, 2019 12:10 pm

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.
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

DVDaud
Posts: 4
Joined: Tue Feb 26, 2019 12:40 am

Re: selecting image driven by text

Post by DVDaud » Wed Feb 27, 2019 1:59 am

Attached the snapshot and attached a screen shot highlighting the elements of concern.
The attachment Snapshot1.rxsnp is no longer available
The attachment Snapshot1.rxsnp is no longer available
Attachments
Snapshot1.rxsnp
(54.15 KiB) Downloaded 6 times

DVDaud
Posts: 4
Joined: Tue Feb 26, 2019 12:40 am

Re: selecting image driven by text

Post by DVDaud » Wed Feb 27, 2019 2:01 am

Capture3.PNG
Capture3.PNG (18.69 KiB) Viewed 142 times

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

Re: selecting image driven by text

Post by odklizec » Wed Feb 27, 2019 8:56 am

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
Air_technology_limit.png (6.88 KiB) Viewed 136 times
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 ;)
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

DVDaud
Posts: 4
Joined: Tue Feb 26, 2019 12:40 am

Re: selecting image driven by text

Post by DVDaud » Thu Feb 28, 2019 12:04 am

following-sibling::picture worked perfectly, thank you very much.

I will have a browse of those pages too :)

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

Re: selecting image driven by text

Post by odklizec » Thu Feb 28, 2019 8:27 am

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.
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