Page 1 of 1

when I press start, the recorder does not what was recorded

Posted: Thu Jul 03, 2008 8:59 am
by VitoPecile
My problem is that when I press start after recorded sth. the mouse moves anywhere on the screen, but it doesn't do what I recorded before. I changed the "point" entries with the screen positions which were told by the spy-tool, in the .xml file, but the result was even worse.

Is there any opinion how to fix that problem or do i have to work with object ID's?

Vito Pecile

Posted: Fri Jul 04, 2008 8:29 am
by Support Team
Could you please describe the actions you tried to record/replay, what application you automate, and what you mean by "object IDs".

When you change the points in the XML file, be aware that control/element coordinates are relative to the form/control, respectively. However, changing the coordinates might not have an impact as they are only taken as a hint or fallback if other searching mechanisms fail.

Regards,
Alex
Ranorex Support Team

Posted: Mon Jul 07, 2008 7:09 am
by VitoPecile
The Problems which I described only appear when I click on the "start" button of windows(XP) or somewhere in the lower parts of the screen (about 2cm from bottom of screen). The rest normally works well, the only thing is that the record clicks sideways very little buttons, and doesn't "catch" them.

With object ID's I meant to change the "point" entries into "search object by ID" entries, so that the mouse clicks on the object with the right ID, not on a screenposition.

I wanted to change it in the C# file, so I don't work with the XML file.

Thanks for help,

Vito

Posted: Wed Jul 09, 2008 2:14 pm
by Support Team
I tried the same with an english Windows XP, the recorder generated the following code:

Code: Select all

//-----------------------------------------------------------------
Logger.Info("User", "Find form by title '' and class name 'Shell_TrayWnd'.");
//-----------------------------------------------------------------
form = Application.FindForm("", SearchMatchMode.MatchExact, "Shell_TrayWnd", false, (int)(timeScale*5000));
form.Activate();

Logger.Info("User", "Find child by control id '304'.");
control = form.FindControlId(304);
control.Focus();
Logger.Info("User", "Get the accessibility element of the control.");
controlElement = control.Element;

Logger.Info("User", "Find child element in control by Role='PushButton', Name='Start' and Location=(0,0).");
element = controlElement.FindChild(Role.PushButton, "Start", null, new Point(0, 0));
Logger.Info("User", "Click element 1 time(s) with left mouse button at offset=(39,13).");
Mouse.ClickElement(element, MouseButtonType.LeftButton, new Point(39, 13), 1, (int)(timeScale*2328));
Please check the properties of the Start button with RanorexSpy.

The Recorder first searches the Form with the class name 'Shell_TrayWnd' and then the Start button by control id = 304.

You can also try the following code:

Code: Select all

form = Application.FindForm("", SearchMatchMode.MatchExact, "Shell_TrayWnd", false, (int)(timeScale*5000));
form.Activate();

Logger.Info("User", "Find child by control id '304'.");
control = form.FindControlId(304);
control.Focus();
Mouse.ClickControl(control);
Jenö
Ranorex Team