Page 1 of 1

Anchor a test to a field rather than screen location?

Posted: Mon Mar 14, 2011 3:47 pm
by Chris Wright
Hi,

I have been creating some auto tests with Ranorex against an application that has several modal windows. Some of the modal windows do not appear consistantly in the same screen location, therefore the auto test then fails as its based on mouse clicks in relation to screen location.

Is it possible to set a mouseclick against a field within the application rather than the screen location?

Regards
Chris

Re: Anchor a test to a field rather than screen location?

Posted: Mon Mar 14, 2011 4:52 pm
by Ciege
Hmm, by default I do not think Ranorex is coordinate based... You may want to share your code so we can see exactly what it is you are doing.

But yes, you can tell Ranorex to click on a certain field.

For example here is code to click on a textbox wherever it may live:

Code: Select all

Ranorex.Text HDtext = RanorexFormName.FindSingle(".//text[@accessiblename='" + TextBoxName + "']", 30000);
HDtext.Click(Location.Center);

Re: Anchor a test to a field rather than screen location?

Posted: Mon Mar 14, 2011 7:51 pm
by Support Team
Ciege is right, Ranorex is *not* coordinate based by default.
The recorder always records the exact click location relative to the *best* element ("field") Ranorex can identify, for example a button or a text box, but the values are not relevant in most cases and this behavior can be turned off.

If there are issues with object recognition the "best" element might be a window or some container control.
If you could post a Ranorex Snapshot (rxsnp) file of your application, we might be able to help you with that issue. (if you do not want to post it in the forum, you can also send it to [email protected])

Michael
Ranorex Team

Re: Anchor a test to a field rather than screen location?

Posted: Mon Mar 21, 2011 10:05 am
by Chris Wright
Hi Michael,

I have a 'rxsln' file for the actual recording but cannot see a 'rxsnp' file??

Regards
Chris

Re: Anchor a test to a field rather than screen location?

Posted: Mon Mar 21, 2011 11:24 am
by Support Team
Hi Chris,
Chris Wright wrote:but cannot see a 'rxsnp' file??
A rxsnp file is a Ranorex Snapshot file. This is not placed at the recording location, but rather you have to create one. Therefore please see following link http://www.ranorex.com/support/user-gui ... files.html

Regards,
Peter
Ranorex Team

Re: Anchor a test to a field rather than screen location?

Posted: Mon Mar 21, 2011 4:30 pm
by Chris Wright
Hi Peter,

Many thanks for your response.

Does creating a snapshot work for an entire recording?? I cannot get this to work at present following the user notes.

Regards
Chris

Re: Anchor a test to a field rather than screen location?

Posted: Tue Mar 22, 2011 9:40 am
by Support Team
Hi,

thus you can't generate snapshot files covering your whole system under test, but only for one application under test, it's only possible to generate a snapshot file covering your whole recording, if your recordinge only interacts with one application. But if there are more than one applications interacting you can send us snapshot files for all of these applications.

Kind regards,
Tobias
Support Team