Archive

Author Archive

Record test automation scripts with RoutineBot

January 16th, 2010

Starting version 3.0. RoutineBot allows to record test automation scripts. The new function helps to record user actions and then play them back.

Access script recording functionality of RoutineBot with Start/stop recording commend in Tools menu

Access script recording functionality of RoutineBot with Start/stop recording commend in Tools menu

How it works

  • To start or stop recording use “Start/stop recording command” in Tools menu or Control + F12 hot key.

RoutineBot can record scripts in two modes:

  1. Snapshot based recording – combined graphical and mouse position recording mode. In this mode RoutineBot will try to make snapshots of objects at mouse position, but it also will record the relative movement of the mouse, so if during playback the snapshot was not found, your script will continue to play using data about relative mouse movement.
  2. Cursor position based recording – in this mode RoutineBot will record script basing mouse movements and click, without using snapshots.
  • In both modes RoutineBot will record text you type with keyboard;

To choose necessary mode go to the “Environment options” command in Tools menu, then switch to “Macros recording” tag:

Script macros recording properties dialog

Script macros recording properties dialog

  • Snapshot width and height fields determine the size of snapshot rectangle, by default it is 32×32, but you might want to make it smaller, say 16×16, if the interface of your application has smaller features that you need to address during script recording;
  • Normally, when you move your mouse over some element, say button, it’s appearance might change, and in this case taken snapshot will be useless. That’s why RoutineBot use snapshots not exactly in the time of click, but few moments before, for instance, when the mouse pointer was 50 pixels from click point. To specify this value we use “Min mouse moving distance” property.

Examples of script

This is how the script looks like after the recording in Snapshot based mode:

If MouseFocuse(‘0001 110-219 Calculator calc.exe 10.49.16.057.bmp’) = 0 then
begin
MouseMove(110,219);
end; {10:49:16:057}
MouseClick; {10:49:16:121}

{ the general idea is that script is trying to find the snapshot on the script, if it was not found the its moving mouse to certain position and finally do click;}
If MouseFocuse(‘0002 215-253 Calculator calc.exe 10.49.16.727.bmp’) = 0 then
begin
MouseMoveRel(105,34);
end; {10:49:16:727}
MouseClick; {10:49:16:793}

{the same idea is here, but if the snapshot was not found, RoutineBot moves mouse relatively from the previous click point}

Cropping image

Once script was created it is a good idea to test the created script. As all snapshots was taken automatically, you might need to improve some of them:

  • Some snapshots need to be replaced with good one; To take new snapshots go to the “Select test image” tag;
  • Some snapshots need to be cropped;  To crop snapshots use “Show gallery” command in “Project” menu, select there snapshot you need and use “Crop” button.
  • Share/Bookmark

admin Official , ,

Create directory or folder automatically

December 14th, 2009

Latest version of RoutineBot allows to create directories or folders automatically with MakeDir function.

Check commands list for details.

  • Share/Bookmark

admin Official , ,

Browse and click menu commands of tested application

July 11th, 2009

Starting version 1.6 RoutineBot can click on certain menu commands in tested application. The process is now automated to make it easy to find necessary menu name, address to it and click it.

The step-by-step it looks like:

  1. Run RoutineBot and go to the Tools > Menu Browser. As as result you will have a list of all menus avaliable in the system right now sorted by application.

    The menu browser in RoutineBot - select menu item and click it automatically

    The menu browser in RoutineBot - select menu item and click it automatically

  2. Find the menu you need and click OK.
  3. In your script will be added the code like this:

ExecuteMenuItem(‘notepad.exe’,'New’);

This code will click on “New” menu in running notepad.exe.

Known limitations:

  • The function will ExecuteMenuItem will work only with default system menues, if application use some custom designed menu, it will not work;
  • The ExecuteMenuItem command addresses the menu by menu name and application name, so if there are more than two applications with the same .exe name are running, then RoutineBot will execute action for the first application only
  • Share/Bookmark

admin Articles , ,