RawText based off location

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
PBMax
Posts: 12
Joined: Mon Apr 02, 2012 7:42 pm

RawText based off location

Post by PBMax » Fri Nov 16, 2018 11:21 pm

I see this post about finding rawtext based on a location. This however doesn't work:

locate-rawtext-in-some-rectangle-t6965.html

What am I missing here?

User avatar
RobinHood42
Posts: 324
Joined: Fri Jan 09, 2015 3:24 pm

Re: RawText based off location

Post by RobinHood42 » Mon Nov 19, 2018 9:02 am

Hi,

I'm afraid that there isn't enough information to help you.

What exactly isn't working? Do you receive any error message? Please describe your test scenario as detailed as possible. Attaching a Ranorex snapshot might also help to understand the structure of your application under test.

Cheers,
Robin

PBMax
Posts: 12
Joined: Mon Apr 02, 2012 7:42 pm

Re: RawText based off location

Post by PBMax » Fri Nov 30, 2018 8:15 pm

I thought the link the the post was enough. I want to find the raw text within a particular rectangle. The issue I'm having is that I have a lot of rawtext objects on the screen and finding an object using col and row is problematic. I can find the object itself but can't get any properties from it. I wanted to write code to find the desired object, get the screen rectangle, create a raw text adapter and get the raw text using that rectangle. This will allow me to get the text from a control I otherwise would not have access to. I may be able to use some OCR to do the same if I knew how to do that.

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

Re: RawText based off location

Post by odklizec » Mon Dec 03, 2018 10:10 am

Hi,

At first, please post a Ranorex snapshot (NOT screenshot) of the problematic element, which includes the rawtexts. It's pretty hard to help you without any clue how the application under test actually looks like. The xpath suggested by Ranorex support should work. If it does not work for you, then you either use it wrong or the rawtexts in your app cannot be located that way? But again, it's impossible to suggest something sensible without seeing, at very least, Ranorex snapshot. 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

PBMax
Posts: 12
Joined: Mon Apr 02, 2012 7:42 pm

Re: RawText based off location

Post by PBMax » Tue Dec 04, 2018 8:04 pm

Thanks robin hood and odklizec. I don't have a problem finding raw text, I have a problem finding the raw text for my specific object. I get all the text on my screen but the column and row values are not reliable. My question is simple. Does the Ranorex API have a mechanism to get rawtext based off a location. Based on the linked post, I thought it did. When trying to implement it, it doesn't work. So regardless of my application, does the API work in this manner?

Here is the link again:

locate-rawtext-in-some-rectangle-t6965.html

Here is the reply:

Post by Support Team » Wed Oct 15, 2014 11:08 am

Hi Boris,

You can use the following RxPath for relative coordinates:

./rawtext[cx()=10 and cy()=50 and width()=40 and height()=10]

For more information about the RxPath please take a look at the following link: RanoreXPath.

Regards,
Markus

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

Re: RawText based off location

Post by odklizec » Tue Dec 04, 2018 8:45 pm

Hi,

The solution provided by Markus should work. If it does not work for you, then it’s maybe not applicable in your specific case? Sadly, it’s hard (impossible) to tell what’s wrong without seeing, at very least, Ranorex snapshot from your app, showing the raw texts in question. If you can’t/don’t want to upload the snapshot here, please contact Ranorex support via their support form and request a remote session with them. There is really nothing anyone here can do or suggest without snapshot.
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

PBMax
Posts: 12
Joined: Mon Apr 02, 2012 7:42 pm

Re: RawText based off location

Post by PBMax » Thu Dec 06, 2018 4:32 pm

Thanks. Thank's what I needed to know if it "should" work. I didn't see anything in the documentation that refers to this functionality so I wasn't sure if it was an old removed feature or something else. I'll see about providing some sample code and a snapshot of that test.

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

Re: RawText based off location

Post by odklizec » Fri Dec 07, 2018 2:35 pm

Hi,

It seems that xpath functions somehow disappeared from new (online) Ranorex user guide. I already informed Ranorex support about this omission...
xpath_examples.png
You do not have the required permissions to view the files attached to this post.
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