Automate visual testing

Routine Bot software for automation of visual tests

Routine Bot software for automation of visual tests

RoutineBot is a visual test automation software that provides a user with the opportunity to create and execute tests based on image patterns.

Key Benefits of RoutineBot:

  • Allows you to automate visual testing by two methods – manual script design or automatic script recording;
  • Supports Pascal, JavaScript and Basic scripting languages;
  • Can automate a variety of events - mouse events (clicking, moving), keyboard events (entering text), taking screenshots, loading and saving data, downloading files, working with applications and windows;
  • Supports wide range of functions to log events which includes advanced htm log with screenshots of test cases;

How to Test “Hello World” Application with RoutineBot

Manual testing: testing engineer needs to open the application, pass certain parameters and click certain buttons, then make sure that the expected results exist.

With RoutineBot: testing engineer creates image patterns and writes scripts that will click certain buttons, then check if expected results were obtained.

In terms of time and money, manual testing is faster, but it should be considered an expenditure, as you need a testing engineer each time a test is performed. Automated testing should be considered an investment, although you spend more time on designing test script, it can be used in the future.

Example: “Hello World!”

This is the application that we want to test. If you click on the “Say Hello!” button, it should show some text.

Here is the application that we want to test. If click the button the "Hello" test should appear.

Here is the application that we want to test. If click the button the "Hello" test should appear.

We need to take a snapshot of the screen and then crop the image and save it with the button:

Make snapshot of the button you need to click

Make snapshot of the button you need to click

Cropped image will be saved under the “Hello” name:

Crop and save the part of snapshot you need to click

Crop and save the part of snapshot you need to click

Now, we assign the “MouseFocus” event to this image in order to make RoutineBot find the image pattern on the screen and focus in on it:

Assign the "Mouse focuse" action to this image

Assign the "Mouse focus" action to this image

Program My1Prg;
begin
MouseFocuse(‘hello.bmp’,10000); // MouseFocuse event will try to find “hello” image
end.

Then, we need to add the “MouseClick” action, so that RoutineBot does not just focus, but clicks the button:

Add the mouse click event

Add the mouse click event


Program My1Prg;
begin
MouseFocuse('hello.bmp',10000);
MouseClick; // MouseClick event will emulate the mouse click
end.

Now, we need to add the expected pattern:

Adding the text that should appear once we click the button

Adding the text that should appear once we click the button

Program My1Prg;
begin
MouseFocuse('hello.bmp',1000);
MouseClick;
result:=MouseFocuse('check_hello.bmp',1000); // result = 1, if the image "check_hello" was found, =0 if image not found
end.

Now, we will improve our code to add more opportunities to the log event which will help us debug the application. The resulted code is:


Program My1Prg;
begin
MouseFocuse('hello.bmp',1000);
MouseClick;
result:=MouseFocuse('check_hello.bmp',1000);

if result=1 then begin
LogMessage(‘hello word test – passed’); // we are adding message into default log
ShowHint(‘Passed!’); // we are showing hint in the system tray
end
else
begin
LogMessage(‘hello word test – failed’);
ShowHint(‘Failed!’);
LogImageUnderCursor(100,100); // if execution failed we want to know what image was actually under cursor
end;

end.

  • Share/Bookmark