How to extract accessible value from an image object

Best practices, code snippets for common functionality, examples, and guidelines.
ninaddande
Posts: 15
Joined: Mon Apr 25, 2016 7:54 pm

How to extract accessible value from an image object

Post by ninaddande » Thu Aug 11, 2016 9:07 pm

Hi Team,

I am spying an object in PDF it is an image of a table and all the data which that table has is part of "Accessible Name" and "Accessible Value". Could you please guide me how to get the data from these accessible fields.

Regards,
Ninad

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: How to extract accessible value from an image object

Post by krstcs » Thu Aug 11, 2016 9:12 pm

Please post a Ranorex Snapshot (not a screenshot) of the element in question. Without that it will be hard to suggest a valid solution.

http://www.ranorex.com/support/user-gui ... files.html
Shortcuts usually aren't...

ninaddande
Posts: 15
Joined: Mon Apr 25, 2016 7:54 pm

Re: How to extract accessible value from an image object

Post by ninaddande » Thu Aug 11, 2016 11:24 pm

Hi,

PFA ranorex snapshot of an element.

Regards,
Ninad
You do not have the required permissions to view the files attached to this post.

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

Re: How to extract accessible value from an image object

Post by odklizec » Fri Aug 12, 2016 7:24 am

Hi,

What you have posted is screenshot, not Ranorex snapshot (exact opposite of what you have been asked). Please read the Ranorex user guide how to create a proper Ranorex snapshot (click on a link in my signature).

Anyway, if the values you are looking for are stored only in "Accessible Name" and "Accessible Value" of the given picture (have you examined the table element above the picture?), then the only way how to get the individual pairs of values from these attributes is to parse them in code (to separate then and eventually validate individual pairs). But I would suggest to first examine the table element.
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

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: How to extract accessible value from an image object

Post by Martin » Fri Aug 12, 2016 7:39 am

Add the picture element that contains the text to repository.

And to get the text from it add the following user code:
Accessible accValue = new Accessible(repo.PDF.PictureElement);
string Data = accValue.Value;
Now you can do what ever you like with the text which will be contained in Data.

It's a quite annoying thing with PDF and you can actually change the settings to capture these text feilds differently. But to be honest they all are sort of messy and s**k.

You could check if the table contains any of the data (the element above the picture) but from my own experience it will not (or atleast it will not contain the desired data).

ninaddande
Posts: 15
Joined: Mon Apr 25, 2016 7:54 pm

Re: How to extract accessible value from an image object

Post by ninaddande » Thu Aug 18, 2016 7:28 pm

Hey Martin,

Thanks for your solutions. It worked for me. Thanks a lot.

Regards,
Ninad