Handling of Mouse movements through Ranorex?

Ranorex Spy, Recorder, and Studio.
saurabh0308
Posts: 2
Joined: Wed Nov 17, 2010 11:23 pm

Handling of Mouse movements through Ranorex?

Post by saurabh0308 » Wed Nov 17, 2010 11:26 pm

Hi,

We are exploring Ranorex tool for window based application.
We are facing issue due to usage of mouse click function which uses the coordinate specific to the tester system.

Script executed on different systems (environment) fail due to the mouse coordinate values.

We are in urgent need and looking for some suggestions ASAP.

Please respond to this at earliest which help us in designing the general script which can be executed on different environment.

Thanks!

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Handling of Mouse movements through Ranorex?

Post by Ciege » Wed Nov 17, 2010 11:32 pm

Can you post your code you are having problems with?

Mouse movements and clicks in Ranorex should *not* be coordinate based relative to the desktop.

I have lots of code that moves the mouse and clicks on objects through Ranorex that translates just fine from box to box regardless of screen resolution.
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...

saurabh0308
Posts: 2
Joined: Wed Nov 17, 2010 11:23 pm

Re: Handling of Mouse movements through Ranorex?

Post by saurabh0308 » Thu Nov 18, 2010 4:56 am

Issue facing: For action of mouse click, code generates a method which uses screen coordinate......which is dependent on single system and when executing on different boxes gives error.

Sample code1: Below is the action performed on system for opening command prompt on windows and running few commands.

public static void Start()
{
Mouse.DefaultMoveTime = 300;
Keyboard.DefaultKeyPressTime = 100;
Delay.SpeedFactor = 1.0;

Report.Info("Mouse Left Click item 'MenuBarExplorer.ButtonStart' at 25;17.");
repo.MenuBarExplorer.ButtonStart.Click("25;17");
Delay.Milliseconds(490);
Report.Info("Mouse Left Click item 'HostDUALCORE8.HostDUALCORE8' at 97;650.");
repo.HostDUALCORE8.HostDUALCORE8.Click("97;650");
Delay.Milliseconds(1150);
Report.Info("Key sequence 'cmd{Return}'.");
Keyboard.Press("cmd{Return}");
Delay.Milliseconds(1560);
Report.Info("Key sequence 'cd\\{Return}'.");
Keyboard.Press("cd\\{Return}");


Sample code 2: Action perform on application interface

Report.Info("Mouse Left Click item 'HostDUALCORE8.HostDUALCORE8' at 140;366.");
repo.HostDUALCORE8.HostDUALCORE8.Click("140;366", 209);

Please suggest how we can replace this system dependency and using the method which uses page element or id as arguement in click method.

Thanks!

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: Handling of Mouse movements through Ranorex?

Post by artur_gadomski » Thu Nov 18, 2010 8:30 am

Try removing coordinates from Click methods. That should work for StartButton, but I think repo.HostDUALCORE8.HostDUALCORE8 might mean that your application is not recognized.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Handling of Mouse movements through Ranorex?

Post by Support Team » Thu Nov 18, 2010 3:16 pm

Hi,

Instead of using the coordinates you can use locations like "Center, Center left" and so on.
Which errors are reported by Ranorex? Also try to compare the RxPath from both machines if the are the same.

Thanks in advance.

Regards,
Peter
Ranorex Team
.
Image