| View previous topic :: View next topic |
| Author |
Message |
Marcin81
Joined: 06 Mar 2008 Posts: 1
|
Posted: Thu Mar 06, 2008 3:15 pm Post subject: Exports C++ code without the coordinate dependecy. |
|
The recorder has created C++ code after we have played scenario.
But this code often uses coordinate points to take an ElementStruct.
Example:
Code: click into code to enlarge
if ( RxElementFindChildLocation(&controlElement, 12, "Clipboard",
NULL, 142, -10, &element) != TRUE)
return 1;
And generally the code generated by recorder is dependent on coordinate
gui elements.
Example:
Code: click into code to enlarge
if ( RxMouseMoveToControl(control,113, 11, 40) != 0 )
return 1;
RxMouseGetPosition((int*)&point.x, (int*)&point.y);
RxMouseDown(0);
RxMouseMove(point.x+-116, point.y+7, 137);
1. Is it possible for the recorder to not use coordinate points when it
exports to C++ code ?
2. I know I can use the toolbox to inspect the gui elements that the
test application should visit but then the C++ code must be written
manually. I played with trying to use constant ID with the widgets in
one of my tested application but without much luck. Is there a way to
change the code in a tested application so the recorder exports C++
code without the coordinate dependecy? |
|
| Back to top |
|
 |
jasong
Joined: 26 Oct 2007 Posts: 49 Location: Texas
|
Posted: Fri Mar 07, 2008 4:34 pm Post subject: no coordinates for Python either (and other languages) |
|
I post process all my scripts to remove the coordinates and eliminate the mouse movement speed.
The way I view it now, there are two modes I could use the recorded scripts as:
1. Demo/training - in which I want the mouse movement and adjustable speed (perhaps from a variable at the beginning of the script
2. testing - in which I do not want any slowness or movement, I want to complete the tests as fast as possible
a caveat to #2 is that due to our database variances in speed, sometimes certain forms take a while to pop up. In those cases I poll for the form with an optional timeout (optional, because you can set it globally).
Once this is complete, and variables put in place of hard coded values then the scripts are VERY reusable.
Jason |
|
| Back to top |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 343
|
Posted: Fri Mar 07, 2008 4:45 pm Post subject: Re: Exports C++ code without the coordinate dependecy. |
|
| Marcin81 wrote: |
| And generally the code generated by recorder is dependent on coordinate gui elements. |
Generally, the recorder tries to avoid using coordinates alone when computing the position for mouse actions. However, coordinates are usually taken as a hint when searching for controls/elements or they mark an offset inside a control/element to further specify the point to click on an control/element.
When replaying, the recorder first tries to find an element including its recorded coordinates. If not successful, it will try searching again without coordinates. If successful without coordinates only, the generated code will leave out coordinats, too.
Using coordinates alone to find the position of a mouse click is only a fallback.
Currently, the recorder will always first try to use coordinates as hints. The option to disable this behavior is on our feature list.
Regards,
Alex
Ranorex Support Team |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|