Examples

RoutineBot – Test Automation Tool Review – Technology does not matter?

Nearly a year has passed when I wrote about a tool that in a different way comes to gui test automation. In article titled “iTestBot – new idea in test automation” I was wondering the solution based on the images / screenshots. It is very simple and very illustrative technique, allows you to write easily and especially easy to read your test scripts because of close relation to the visible portion of our applications – the image.
Now, after one year we have new version of iTestBot called RoutineBot and major version 2.0. I will try to check how it fits automation testing process, do some examples and write proper summary.

Introduction
The first and the best information is that RoutineBot does not care about type of application under test ! Images are the clue, so Windows Forms, Flex, SilverLight, HTML, Ajax and many many more, even not invented technologies are covered. Amazing but possible. This tool is the easiest way to follow an user who uses the eye, mouse and keyboard.

Installing
You can download 30 day trial from the RoutineBot website, one click installer will does the rest.

Application to test
Technology does not matter so let’s take my flex example application with very simple but valuable interface: input text field, two buttons, list. Here are two main requirements to test:

  • when user clicks add button, text from textinput should become new list item
  • when user select item of the list and clicks delete item should be deleted

with two conditions:

  • item should be added only when textInput is not empty, if is empty message box with proper info should appear;
  • item on list should be selected before clicking delete button, if no selection is done messagebox should appear

As you can see we also will have to face the pop-ups: flex alerts in this case.

Test It !
First create new project and save it in right place. Then choose scripting language syntax:

  • Pascal
  • JScript
  • Basic

my favorite is Pascal because of my longtime experience with TurboPascal and Delphi.

Next step is to run the browser with specified url, RunApplication function will does it for us:
[cc lang=”pascal”]
function RunApplication : Boolean;
begin
//Run browser with flex application url
ShellExecute(‘C:\Program Files\Internet Explorer\iexplore.exe’,’http://localhost/routinebot/RoutineBotProject/RoutineBotTestProject.html’);
MouseFocuse(‘ApplicationStart.bmp’,10000);
result := true;
end;
[/cc]

While the function of ShellExecute is popular, the function MouseFocuse may seem mysterious. It is the most important action in RoutineBot, in second parametr we provide a sliced screenshot with characteristic detail. Function check if this image is present on the screen then moves the mouse to the center of that slice.
RoutineBot have very cute and simple mechanizm to take snapshot, slice it and save in library folder.

When we already run the browser now have to add some items to the list (first requirment). We want to add multiple items so it is best to create a separate procedure with the parameter, please look at code comments:

[cc lang=”pascal”]
procedure AddItemToList(text: String);
begin
// find input box
MouseFocuse(‘InputTextBox.bmp’,1000);
MouseClick;
// clear text CRTL+a and delete
EnterKeys(‘^a’);
EnterKeys(‘{DELETE}’);
EnterKeys(text);
// find add button
MouseFocuse(‘AddButton.bmp’,1000);
MouseClick;
end;
[/cc]

simple ? All the images and scripts you will find in links section at the end of article. What about alerts, pop-ups etc. ?

[cc lang=”pascal”]
function TestAddingItemWithoutText : Boolean;
begin
AddItemToList(”);
MouseFocuse(‘NoItemTextAlert.bmp’,1000);
MouseFocuse(‘FocusedOkButton.bmp’,1000);

MouseClick;
result := true;
end;
[/cc]

In this case we expect alert with some text and OK button. Do not care about component names, layers etc.

Tips
1. Remember that focused component may looks different, use two different images or focus mouse on component witch not conflicts with our current image.
2. Default value for timeout, second parameter is 10000, change it to 1000 it speed up your robot.
3. In this example I have used MsgBox for reporting problems during script execution. In production environment use log file and OnException handler.

Summary
In my opinion, the tool is interesting, certainly helps often when other methods fail. It can also be completely independent solution for a single product or set of products. Source code editor should be improved and performance issues sometimes take place but tool is constantly developed.
How this kind of accessing components fits your needs ? It is full test automation solution or only supplement for special, problematic occasion ? Please check it and do a comment, I am big on your expertise.

Links
Flex Builder and RoutineBox projects (zip archive)
RoutineBot – Test Automation Tool HomePage
RoutineBot – Automated Testing Tool UserManual

Discussion

7 comments for “RoutineBot – Test Automation Tool Review – Technology does not matter?”

  1. I try to use this tool but i could not understand how to record script and how will be the tset performed and also how the test ends and test result is dislayed?

    Posted by samjhana | January 8, 2010, 6:21 pm
  2. Thanks for comment.

    This is not record and playback tool. You must do screenshot, slice it then write some script manually.

    If you have any questions, please ask !

    best regards
    Marcin Zreda

    Posted by Marcin Zręda | January 8, 2010, 7:15 pm
  3. Thanks Marcin,

    That means, do i have to take the screen shot of each page of the application i am going to test? Then the script will be automatically generated. What is the function of add action button then?

    Posted by samjhana | January 9, 2010, 4:02 am
  4. Hi,

    No 🙂 ! Please take a look on my example, you can download it.
    You take a picture of component that you want to click, enter text etc. RoutineBot finds components by its apperance, then you can click on it.

    best regards
    Martin

    Posted by Marcin Zręda | January 9, 2010, 8:51 am
  5. […] RoutineBot […]

    Posted by Behavior Driven Development in Flex – Where we are? | Test And Try | January 11, 2010, 2:09 pm
  6. […] RoutineBot Test Automation Tool Review – Technology does not Matter Interesting tool that will quickly and easily automate any application, the technology does not matter because we look at the pictures. […]

    Posted by 4 Ways to Automate Flex GUI Testing | Test And Try | January 18, 2010, 12:30 pm
  7. […] Well-known tool, mature and rapidly growing. You can read my article RoutineBot – Test Automation Tool Review – Technology does not matter?“. It allows very quickly create test scripts, and is […]

    Posted by 5 Great Automation Tools Based On Image Recognition | Test And Try | February 1, 2010, 1:13 pm

Post a comment