Getting started

As the first step after installing Kantu we suggest that you run some or all of the included demo macros. This will give you a good feeling of what Kantu can do.

Screenshot web automation with Kantu

Kantu Recording

To create your own image macros, click the "tape icon" and the image wizard appears. It helps you to take the screenshots for your macro.

  • Resize the screenshot area to fit your button or text box. In general, a smaller screenshot is better and faster.
  • Select the action to perform on the screenshot: Click or Click+Type (for sending text to input boxes)
  • . For web testing, there is also Find to assert a certain image is on the screen.
  • Click "Add" to record the screenshot and command
  • When you are done with recording, click stop.
  • Save the macro under a new name.
  • Select Play to run your macro.
  • The scroll command allows you to move up and down the screen.
  • You can use the "Comment" box to add a note for later
  • No worries: Wrongly recorded commands can be removed or changed in the editor after recording
Record screenshots step by step


Use the Editor to fine-tune

The Kantu Editor allows you to add and remove recorded commands, and also to easily rename and change images. For this, it has a built-in screenshot tool.



Automating File Downloads

Just trigger the file download like you normally would do, this time using the image wizard. Kantu records it by adding a SET DownloadDirectory... value.


Automating File Uploads

Automating web browser file uploads is very easy with Kantu: Create a click command with the screenshot of the file upload "Browse" button and then select the file you want to upload from the native browser file upload dialog that appears. That is all. Kantu records path of the selected file and then fills it in during replay. Kantu works with all file upload methods that you can find on the web (We tested dozens of websites and it worked with all. If you come across any that does not work, contact us.)



Automating Select Boxes

Automating selected boxes can be sometimes a bit tricky. On the one hand there are modern-style select boxes (Example: Gmail sign-up dialog). These can be automated just like any other element on the page.

The tricky part are only the the “classic” old-style select boxes. You can detect them as you will be unable to create a screenshot of them with the wizard. And sometimes they overlap the recording wizard once open. And in any case, they look old and very “Web 1.0”.


To automate these kind of select boxes you have to use keyboard events: To select an entry from select boxes, please enter {DOWN} to select entries. If you want to select the 3rd entry, then enter {DOWN}{DOWN}{DOWN}. Then send {ENTER}. So the complete sequence looks like


You can also tell Kantu to type the first character of an entry. Example: To select Germany in a typical country list, type "G" and then 3-times down:


Typing “G” will jump to “Gabon” and from there you are only 3 times {DOWN} away from Germany.

Web Scraping/ Data Extraction

The new Kantu Version has full support for data extraction via the API. For more details, please see the visual web scraping page.

Visual Web Scraping with OCR

Looping a macro

In web testing you often need to replay a macromacro more than once. Kantu has a built-in function for that: Enter the desired number of loops in the field and then press Play. Another method to loop a macro is to use the PLAY command provided by the API and call it for example within a FOR...NEXT loop of your favorite scripting language.

Drag & Drop

Drag & Drop support will be available soon. Please contact tech support for access to an internal beta version.

Data-driven testing/automation with CSV files and databases

You can use a CSV file to populate multiple form entries. To do so, use the API to send data to Kantu. A VBS example script that reads from a CSV file and sends the data to Kantu for form filling is in our Kantu API GitHub Repo.

Note that while CSV files (CSV is a comma separated values file) are the most popular way to store and read data, the API allows you to connect Kantu with databases or any other datasource as well.


Adobe Flash testing/automation

Kantu's visual approach is ideally suited for automating and testing Flash applets. To get started, you only need to install the latest Adobe Flash Player. This takes less than one minute, please follow the instructions here.


Command Line Options

You can run Kantu from the command line/batch file:

  • Kantu.exe macro.kmacro => opens Kantu and runs macro.kmacro. Kantu stays open after the macro is completed.
  • Kantu.exe macro.kmacro -ae => opens Kantu, runs macro.kmacro, and then closes Kantu (ae = and exit). This is the recommended syntax if you start Kantu from a task scheduler.
  • Kantueditor.exe macro.kmacro => opens macro.kmacro in the Kantu Editor

Schedule Tasks: If you need to run macros periodically you can use Kantu with the built-in Windows task scheduler. By using Task Scheduler, you can schedule tasks such as uploading a file or filling a form at a defined time. The Task Scheduler takes care of this. It runs in the background, checking if any scheduled task is due. You can schedule a task to run daily, weekly, monthly, or at certain events such as system startup.


Use the Kantu Browser Scripting API [PRO]

For more complex automation, there is the Kantu Browser API. It can be used from any programmig or scripting language. Some VBS and Powershell sample scripts are included. As a start, run them to see what the API can do.

Browser API

Easy to use API, works in any programming or scripting language on Windows

With open you launch Kantu instances, and with play you run the image macro. All commands return detailed status and error information at runtime. Tasks you can use the API for include "if/then" decisions, reading form-filling data from a text file ("data-driven testing") or storing extracted information in a database.

For more details see the API command reference below.


Kantu - FAQs

What if the UI object I am clicking on moves 2 pixels over?

Kantu works like a human. It looks for the image everywhere on the screen. As long as the image is anywhere on the page, it will be found. By default (and for performance reasons) Kantu looks on the visible part of the screen only (= what you see in your browser screen). You can add the SearchImageInWholePage parameter to make it search the whole website.


Will the macro break if there is adaptive layout on the website?

It depends:
(1) If, as in most cases, all the adaptive layout does is to move the buttons/images to a different place, then all works fine. Kantu will find the image anywhere on the screen.
(2) But if a button (or whatever image you look for) drastically changes its size or even disappears, then yes, the macro would be break. Example: If a navigation menu collapses to the ☰ symbol, this will break the script.


What about smart waiting? if I click the "login" button and then it takes 1 to 5 seconds to get to the next page, does this framework have intelligent waits? or does it rely on something like "Thread.Sleep(5000)"?

Kantu supports smart waiting. Essentially it looks for the image non-stop and does not continue until the image is found. Pretty much like a human user. By default it waits up to 10 seconds. You can adjust this timeout to any value, either globally for all macro or for a specific command. For example, you will need to extend this value when waiting for the result of a flight search on Expedia or for a longer file upload to complete. In all cases this is smart waiting, and not a hard-coded delay.


Can I use best practices like the "Page object model"?

... so that if I develop thousands of tests and then someone changes how the "login" screen works, I can simply update 1 object instead of updating 1000s of macros? For this we have the API: You can split your image macros in sub-tasks like "Login" or maybe "Upload Image" and then mix & match those macro with the Playcommand:

  • Kantu.Play ("Login.kmacro")
  • Kantu.Play ("Upload image.kmacro")
  • Kantu.Play ("Logout.kmacro")
The API also allows you to read data from text, CSV files and databases for data-driven testing.


What does "Confidence level" mean?

Another, maybe better name for it is ''similarity score'' (and we will change to that name with the next update). => What it means is the similarity between the input image (e. g. the button image) and the best found match on the website. A score of 1 means perfect match, and a score of, say 0.8, allows for some deviation between the images The image search algorithm scores every possible match with such a score. And if you set the similarity score threshold e. g. to 0.8, but the best possible match found is only 0.78, then Kantu will report this as "image not found" error. On the other hand, if the the best possible match found is 0.83, then all is fine and Kantu will click the button and continue.

Why is this needed? Technically images are rarely rendered exactly the same between two machines. There are artifacts from the JPG compression, browser rendering, screen resolution or the image you are clicking changes a slightly different shade during mouse over. So the goal of the employed pattern matches algorithms that Kantu considers an image "the same" if a human would say it is "the same".

For example, an image that has a similarity score of 0.95 on your regular work PC might have the same score inside a VM on the same PC, but only a similarity score of 0.56 on a Surface Tablet with its High-PPI screen. In other words, a confidence 0.5 is usually a very good and stable default value.


How to create IF THEN ELSE statements with Kantu?

Kantu separates the linear website flow logic (the Kantu screenshot macro) and the programming/scripting logic (via the Scripting API). So for tasks like condidtional statements, use the Scripting Interface. The PLAY command always returns detailed status and error information, and use can use this to base your IF/THEN/ELSE decisions on:

IntegerReturnValue = objKantu.Play ("macro1")
if IntegerReturnValue = 1 then
'Do something
MsgBox "OK!"
'Do something else
IntegerReturnValue = objKantu.Play ("macro2")
end if

This example uses the VBS/Visual Basic syntax, but you can use any programming or scripting language with the Scripting API.


How do I add additional steps to an existing recording?

You can use the Kantu Editor to copy & paste lines between macros: So you would first record macro A, then record the additional steps as macro B, and then copy & paste some or all lines of it into macro A.


Kantu Command Reference

This chapter lists all Kantu macro commands. The compressed Kantu macro ( = .kmacro) files are standard zip files. If you rename *.kmacro to *.zip you can open and edit them in Windows Explorer or any other file manager. Some file managers such as Total Commander are even smart enough to let you open the .kmacro files without renaming the extension first. A Kantu macro consists of a .json file with the macro commands and the corresponding images in .png or .jpg format (.png recommended).


Find the target image and click in the center of it. As any command that takes an image as input, the CLICK commands waits until "timeout" for the image to appear. The default is 12s. You can change the value either globally in the settings dialog or inside the Kantu macro with SET FindImageCommandTimeout (new time). Also, by default all image commands search only on the visible part of the screen for a better performance. You can change this by adding SET SearchImageInWholePage "true" to the macro.

Click & Type

This combines a Click and a Type command into one command. Typically this is used with input boxes. It find the target image, click in the center of it and sends text.

  • {DOWN} and {UP} - Useful to move through values in select boxes
  • {ENTER}
  • {TAB} - Use it to jump between input fields
  • {LEFT} and {RIGHT}
  • {BACK} - Delete pre-filled characters
  • Need other values? Please ask tech support.


Find (assert) the target image is loaded.


Extracts data from the website. The data is returned via the API interface.

Navigate (URL)

Loads a website. Kantu does not "wait" for a website to be loaded. The "waiting" is implicitly done by the image recognition of the FIND or CLICK commands.


This commands takes a screenshot of the website and saves it to file. The options are "full" (whole page) or "partial" (visible part).


This commands scroll the page up or down.

Why is this useful? By default, the image recognition of Kantu operates on the visible part of the screen, so by scrolling up or down you can reach other parts of the website.

You can change image search area with the SearchImageInWholePage parameter. It is set to false by default (ie. only the visible part of the page is used).If you want to set it so the image detection use the whole page during

SET (internal Variable)...

This commands sets internal values for the Kantu replay engine. Values set inside a macro override global values. For example, if the global replay speed is set to "Slow", a SET ReplaySpeedMode = FAST will overrite the value for the macro itself, but not change the global setting. Do not confuse this command with the API command setVariable.

  • ReplaySpeedMode - Fast. Medium or Slow. This overrides the global settings for the specific macro
  • DeleteAllCookies - Removes all cookies. Note that some cookie types are only really gone after a browser restart (you can automate this via the Kantu API)
  • DownloadDirectory (string) : The path where the downloaded files should be stored during a record/replay. It overrides the global value set in the app settings.
  • FindImageCommandTimeout (int) : Timeout, in ms, to use for every IMAGE commands during a replay. It overrides the global value set in the app settings.
  • SearchImageInWholePage (bool): It is set to false by default (ie. only the visible part of the page is used). If set to "true" the whole website is used for the the image detection. This applies to all image related commands (CLICK, CLICKTYPE, EXTRACT, FIND).

Use SET to tell Kantu to search the whole page.

The screenshot shows the SET command dropdown box inside the Kantu Editor.


Waits x milliseconds. It is not required to use Wait with the image commands.

Kantu API Reference [PRO]

This chapter lists all commands that are available from the Kantu scriting interface (API).

Example code/scripts for using the API from C#, Java, Python, Powershell, VB6, VBS and VB.NET are available in the Kantu Kantu API GitHub Repo.

objKantu = CreateObject ("Kantu")

Example objKantu = CreateObject ("Kantu").

Connects to the Kantu Browser API. The API is technically designed as a COM object, so it works with any programming or scripting language on Windows. They all support talking to COM objects. Now you can access all commands via the “objKantu” object just created: intReturncode = objKantu.CommandName


Syntax: iret =

  • open(true) - Opens the Kantu browser.
  • open(false) - connects to an existing, already open instance.

For experts: You can modify the default timout that the API waits for Kantu to launch by using objKantu.Open(true/false,

objKantu.echo (“Text”)

Displays a text string on the Kantu GUI. Try it :)

objKantu.setVariable (“VariableName", Value)

Set values in your programming language and Kantu uses them in the kmacro macros, for example {FirstName}. This command is for the custom variables (= variables that you create). It should not be confused with the SET command inside the Kantu macro, which is designed to set the built-in variables like ReplaySpeedMode, DeleteAllCookies, DownloadDirectory, FindImageCommandTimeout or SearchImageInWholePage.

Variables are only parsed in the “Value” field of a command. So you can not use them (yet= to replace/change for example parts of the URL in the “OPEN” command or change the images or other values. Meanwhile, contact tech support for some workarounds.


The most important command - it plays the .kmacro macro. The return value (integer) and the GetLastError function provide detailed error information if something goes wrong. Play and all other commands have a default timeout. T his timeout protects the calling macro from waiting forever in case of a browser crash or frozen website. Of course, it might also catch a macro that simply runs to long. But you can overwrite the default timeout by adding your own time like this:

objKantu..Play ("macro.kmacro", 600)

In this case the Kantu API will wait 10 minutes (600 sec) before triggering a timeout error.

String = objKantu.getLastError()

Returns the error text

String = objKantu.GetExtractImageData()

Returns the extracted information as string


Closes the Kantu Browser.

More Commands

These commands are for expert use and typically used if you need a deeper integration between your application and Kantu.

i = objKantu.searchImage(image, 0.38)

Runs an image search on the currently open browser window.


And if your question is not answered here,...

...please contact us. We love to hear from you!

Follow a9t9 on Twitter
Contact Us
Download Kantu Freeware
Get Copyfish for Chrome
Subscribe to the a9t9 automation software newsletter . We'll send you updates on new releases that we're working on.