Anchor a test to a field rather than screen location? : Automation Tools

Anchor a test to a field rather than screen location?

Ranorex Spy, Recorder, and Studio.

Anchor a test to a field rather than screen location?

Postby Chris Wright » Mon Mar 14, 2011 4:47 pm

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
Chris Wright
 
Posts: 25
Joined: Tue Mar 08, 2011 12:07 pm

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

Postby Ciege » Mon Mar 14, 2011 5:52 pm

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);
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

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

Postby Support Team » Mon Mar 14, 2011 8:51 pm

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 support@ranorex.com)

Michael
Ranorex Team
User avatar
Support Team
Site Admin
 
Posts: 4837
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

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

Postby Chris Wright » Mon Mar 21, 2011 11:05 am

Hi Michael,

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

Regards
Chris
Chris Wright
 
Posts: 25
Joined: Tue Mar 08, 2011 12:07 pm

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

Postby Support Team » Mon Mar 21, 2011 12:24 pm

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
User avatar
Support Team
Site Admin
 
Posts: 4837
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

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

Postby Chris Wright » Mon Mar 21, 2011 5:30 pm

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
Chris Wright
 
Posts: 25
Joined: Tue Mar 08, 2011 12:07 pm

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

Postby Support Team » Tue Mar 22, 2011 10:40 am

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
User avatar
Support Team
Site Admin
 
Posts: 4837
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation Tools

Who is online

Users browsing this forum: No registered users and 1 guest