Page 1 of 1

Handling of Mouse movements through Ranorex?

Posted: Wed Nov 17, 2010 11:26 pm
by saurabh0308
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!

Re: Handling of Mouse movements through Ranorex?

Posted: Wed Nov 17, 2010 11:32 pm
by Ciege
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.

Re: Handling of Mouse movements through Ranorex?

Posted: Thu Nov 18, 2010 4:56 am
by saurabh0308
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!

Re: Handling of Mouse movements through Ranorex?

Posted: Thu Nov 18, 2010 8:30 am
by artur_gadomski
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.

Re: Handling of Mouse movements through Ranorex?

Posted: Thu Nov 18, 2010 3:16 pm
by Support Team
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