Page 1 of 1

RawText based off location

Posted: Fri Nov 16, 2018 11:21 pm
by PBMax
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?

Re: RawText based off location

Posted: Mon Nov 19, 2018 9:02 am
by RobinHood42
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

Re: RawText based off location

Posted: Fri Nov 30, 2018 8:15 pm
by PBMax
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.

Re: RawText based off location

Posted: Mon Dec 03, 2018 10:10 am
by odklizec
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.

Re: RawText based off location

Posted: Tue Dec 04, 2018 8:04 pm
by PBMax
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

Re: RawText based off location

Posted: Tue Dec 04, 2018 8:45 pm
by odklizec
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.

Re: RawText based off location

Posted: Thu Dec 06, 2018 4:32 pm
by PBMax
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.

Re: RawText based off location

Posted: Fri Dec 07, 2018 2:35 pm
by odklizec
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