Add GUI Test Studio to your testing stack

Connect your AI agent, scripts or pipeline: the MCP server and its tools, two screenshots compared in one call, the command line and the result files.

On this page7
  1. 1Three ways in
  2. 2Connect an AI agent
  3. 3Call the tools from your own code
  4. 4The tools, by what you need
  5. 5Compare two pictures
  6. 6Three setups that work
  7. 7What needs a person

You already have scripts, a pipeline, AI agents or a whole testing factory? Keep them. GUI Test Studio opens its work as tools, so your own solution can use the parts it needs.

Three ways in

MCP, the Model Context Protocol, is an open standard that lets a program use another one's tools.What MCP is in AI explains it in simple words.

Before you startWhat to know
GUI Test Studio is installedThe MCP server and gtr-cli come with it. They run on the computer that uses them.
The computer is signed inOn the free trial or a paid plan, as for the apps.A build machine signs in once with a machine key.
A desktop session, for what uses the screenRecording, clicking, capturing the screen and running a test in a window need a signed-in, unlocked desktop. Comparing two files does not use the screen.

The files your tools can read

FileWhat it is for
JUnit (--junit)The results in your CI tool, with the confirmed requirements of each test.
JSON (--json)Every test, step and result, for your own scripts and dashboards.
Markdown (--summary)A summary for a merge request or a build page.
Artifacts folder (--artifacts)The video, the report and the pictures of each failure.
Coverage filesEach requirement and its state, as JSON, Markdown or CSV.See In your pipeline.
Tests (.GTS), runner tests (.GTR) and plans (.gtsplan)Ordinary files: keep them with your code.

Connect an AI agent

For Claude Desktop, Claude Code, ChatGPT with Codex and VS Code, use the Connect buttons of the prompt window.To set one up yourself, use what it expects below.The path is the usual one: Copy the Connector's Path, in that window, gives yours.

In a terminal
claude mcp add --transport stdio --scope user gui-test-studio -- "C:\Program Files\GUI Test Studio\Runner\gts-mcp.exe"

The server speaks over standard input and output (stdio), so your client starts it and stops it. It takes no argument, no key and no port. Many clients read the last form; if yours names things differently, give it the same command.

Call the tools from your own code

You do not need an AI agent: any program can be an MCP client.This example uses the official MCP SDK for Python, version 2.It compares two pictures, and ends with an error when they differ, so the step of your pipeline fails.

Install the SDK (Python 3.10 or newer)
pip install "mcp>=2.3,<3"
compare.py
# pip install "mcp>=2.3,<3"
import asyncio
from mcp import Client, StdioServerParameters

CONNECTOR = r"C:\Program Files\GUI Test Studio\Runner\gts-mcp.exe"

async def check_total(run_folder):
    async with Client(StdioServerParameters(command=CONNECTOR)) as studio:
        answer = await studio.call_tool("compare_images", {
            "expected": r"C:\baselines\checkout-total.png",
            "actual": run_folder + r"\checkout.png",
            "save_to": run_folder + r"\checkout-total",
        })
    if answer.is_error:
        raise RuntimeError(answer.content[0].text)
    result = answer.structured_content
    if not result["passed"]:
        raise SystemExit(result["summary"])

asyncio.run(check_total(r"C:\runs\1842"))
What comes backWhen
is_errorThe tool could not answer, for instance because an argument is wrong or the computer is not signed in. The text says why.
structured_contentThe answer as data. Read its fields, never the wording of its summary.

The tools, by what you need

Every client gets the same 55 tools. Each one describes its own arguments to the client, so an agent knows how to call it.

You need toTools
Compare two pictures, and save one to compare latercompare_imagessave_screenshot
See the computer and its screenstatusscreenshotread_screen
Record a teststart_recordingpause_recordingresume_recordingundo_last_actiondiscard_recordingfinish_recording
Act while recordingclicktype_textpress_keysscrolldragmove_mousewait
Add checks while recordingverify_textverify_text_absentverify_valueverify_countverify_visualverify_visual_absentcapture_pictureverify_layoutverify_screen
Organise what is recorded, and add other stepsbegin_scenarioend_scenarioadd_markerset_test_infoadd_step
Run tests and read what they hold and foundlist_testsdescribe_testview_recordingrun_testlist_runsget_run_results
Change a saved testedit_testadd_checkadd_actionscapture_baselineaccept_result
Cover other browsers and devicesset_browsers_and_devicesgenerate_browsers_and_devices
Work with requirements and test plansget_test_plansave_test_plandecide_planned_testsimport_requirements
Start from a Figma designimport_figma_design
Report, export and open in the appscreate_bug_reportexport_runner_testget_ci_setupopen_in_studioopen_in_runner

The server also offers 7 ready-made prompts, such as planning the tests of a specification, for the clients that show them.

Compare two pictures

compare_images takes two pictures and gives GUI Test Studio's own answer.It needs no recording and no test, so it adds visual verification to the solution you already have.

What was expected, what was found, and what differs, outlined in red.

What it does

  1. 1

    It finds the expected picture, when it fits inside the other

    This is the Search Phase: a button, for example, is looked for in a whole screenshot. It answers found or not found. When it is not found, the comparison ends there.

  2. 2

    It compares the two

    This is the Verification Phase, with the same rule and the same strictness levels as a test's Visual Assert.

  3. 3

    It asks AI for a second look, only if you want it

    AI Smart Verification is off unless the call asks for it. It is asked only when step 2 found a difference. It says what changed in plain words, and its answer is then the final verdict, as in a test run.

Where the pictures go

Two things decide it: whether the tool asks an AI, and who called the tool.

WhatWhere the pictures go
The tool, with the AI offThe tool calls no AI, and sends the pictures nowhere.
The tool, with the AI onWhen step 2 finds a difference, the two pictures it compared go to the AI chosen under AI in that computer's Preferences, or to OpenAI when none was chosen.This one call asks for it, even when AI Smart Verification is off there.A cloud model needs its key on that computer: with no key, nothing is sent to it.With a local model, one we provide or one you bring, the AI runs where you run it.See Privacy.
The program that called the toolIt receives the answer. When the pictures differ, the answer holds the picture of the differences: the part of the actual picture that was compared, or all of it. A cloud AI assistant that calls the tool receives that picture, even with the AI off.

Its arguments

ArgumentDefaultWhat it is
expectedrequiredThe reference picture. See the four forms below.
actualthe screenThe picture to judge, in the same forms. Left out, it is the screen as it is now.
strictnessstandardrelaxed, standard, strict or exact.
ignore_colorfalseCompares shapes and text, not colours.
ignore_rendering_artifactstrueLeaves out the differences text smoothing makes.
max_changed_pixelsset by the strictnessHow many changed pixels are allowed in one area.
color_sensitivityset by the strictnessThe same Advanced value a Visual Assert has.
change_grouping_sizeset by the strictnessThe same Advanced value a Visual Assert has.
search_sensitivity70How alike a place must be to be found, from 10 to 100.
ai_verificationfalseAsks AI Smart Verification when the pictures differ.
ai_instructionsnoneYour own words for the AI, such as: ignore the date.
minor_differencesthe computer's settingpass or fail: what a minor difference found by the AI does.
namenoneWhat is compared. It is said to the AI and written in the result.
picturestrueWith false, the answer holds words and numbers only, and no picture.
save_tononeA folder for the pictures and the result. Give its full path.

A picture is given in one of four forms:

FormWhat it is
"C:/runs/checkout.png"The full path of a PNG or BMP file.
{"data": "..."}A PNG picture as base64 text.
"screen"The screen as it is now.
{"screen": true, "region": {"x": 0, "y": 0, "width": 400, "height": 300}}One part of the screen.
The sizesWhat happens
The same sizeThe two pictures are compared directly.
The expected picture fits inside the actual oneThe Search Phase finds it first. A picture of one flat colour cannot be searched for: the verdict is error.
Anything elseThe verdict is error, with both sizes. Nothing is ever stretched or cut.

Its answer

VerdictWhat it means
passThe pictures match. It is the only verdict where passed is true.
failThe pictures differ.
not_foundThe expected picture is not in the actual one.
errorThe pictures cannot be compared. The summary says why.
An answer, also written to result.json
{
  "verdict": "fail",
  "passed": false,
  "decidedBy": "verification",
  "summary": "The pictures differ: 37 changed pixels in one area, 8 allowed.",
  "expected": {"from": "file", "path": "C:/baselines/total.png", "width": 320, "height": 80},
  "actual": {"from": "screen", "width": 1920, "height": 1080},
  "search": {"found": true, "place": {"x": 812, "y": 440, "width": 320, "height": 80}},
  "verification": {
    "result": "fail", "strictness": "standard",
    "changedPixels": 37, "allowedChangedPixels": 8,
    "changedArea": {"x": 918, "y": 462, "width": 16, "height": 16},
    "changedPixelsTotal": 61, "slightlyDifferentPixels": 4, "renderingArtifactPixels": 12,
    "regionCount": 1,
    "regions": [{"x": 917, "y": 460, "width": 22, "height": 14, "pixels": 61}]
  },
  "files": {
    "folder": "C:/results/total", "expected": "expected.png", "actual": "actual.png",
    "found": "found.png", "differences": "differences.png", "result": "result.json"
  }
}
FieldWhat it says
decidedByWhat gave the verdict: search (not found), verification, or ai (the AI was asked and answered).
searchWhere the picture was found. It is there only when the Search Phase ran.
verificationThe changed pixels, how many are allowed, how many regions differ and where they are. Every place is in the actual picture's own pixels.
aiOnly when you turned the AI on: whether it was asked, its answer or why there is none, and the model. If it does not answer, the Verification Phase's result stands.
filesOnly with save_to: the folder, and the name of each file in it.

The files it writes

With save_to, the folder holds expected.png, actual.png, differences.png and result.json.When the Search Phase ran, found.png is the part that was compared.

The files replace the ones of an earlier comparison in that folder, so use one folder per comparison. A folder where they would overwrite one of the two pictures you compare is refused.

Examples

The Python program above compares two files.These are the arguments for three other cases.

Find a small picture in a whole screenshot, then compare it
{
  "expected": "C:/baselines/pay-button.png",
  "actual": "C:/runs/1842/checkout.png",
  "name": "Checkout page, Pay button",
  "save_to": "C:/runs/1842/pay-button"
}

Save a picture first, compare later

save_screenshot saves the screen at its full size.Save a picture before a change, then give that file to compare_images as expected.

ArgumentWhat it is
pathRequired. The full path of a .png file.
regionOnly this part of the screen: x, y, width and height, in the pixels of screenshot.
overwriteAn existing file is replaced only with true.
picturesThe saved picture is also shown to the program that calls the tool.With false, it is saved and not shown.

Three setups that work

Keep your runner, and add visual verification

Your scripts already drive the application.At the moments that matter, save a PNG picture and call compare_images.Your runner keeps its own steps and reports, and fails when passed is false.Keep the reference pictures with your code, and change one only when a person agrees with the new look.

ExampleA shop's checkout

A script buys a product and saves a picture of the order total. It compares it with the reference and keeps the three pictures with the build. A wrong amount fails the build, with its place outlined.

Let your agent create tests, and run them in your pipeline

The agent creates a test with the tools, and a person reviews it on the timeline.From then on gtr-cli runs the saved test at every build.GUI Test Studio's own engine runs it and verifies the application, with no call to an AI model.

  • With GUI Test Studio, create a test for my app C:\Apps\Shop.exe: add a client named Atlas Textiles and verify it is listed.
  • Run the Checkout test and tell me what failed.
  • Export the Checkout test as a runner test, and give me the GitLab job that runs it.
In your pipeline
gtr-cli run tests --countdown 0 --junit results\junit.xml --json results\run.json --artifacts results\artifacts
Either app writes the command and the piece of pipeline for your CI tool.

Every option and a ready-made example per CI tool are in Run tests in your pipeline.

Hold a release to its requirements

Link each requirement to the test that verifies it, then let the pipeline read where each one stands.This command ends with 1 when one failed or has no up-to-date result.See Requirements, test plans and coverage.

Command
gtr-cli coverage tests --json results\coverage.json --fail-on failing,not-run

What needs a person

Some calls change a saved test, or something other people read.Without confirm: true, they write nothing and show what would change.

CallWhat it would change
edit_testadd_checkadd_actionscapture_baselineaccept_resultA saved test
set_browsers_and_devicesgenerate_browsers_and_devicesThe browsers and devices of a saved test, and what was already generated for one of them
decide_planned_testsimport_requirementsA test plan
save_test_planA planned test that a person wrote, or that already has its test. New proposals are saved at once, as proposed.
create_bug_reportJira, when it creates an issue. A PDF or Excel report is written at once.
Always trueWhy
From a plan, an assistant can only create the tests a person approvedPeople decide what is tested. A test made without a plan is the one you asked for.
No tool confirms a requirement linkA person says that the checks verify the requirement, in one of the apps.See Confirm the links an assistant made.
A key or a password is not saved as a test's variableA name that looks like one is refused.Keep it under Variables on the computer, or in your pipeline.See Keys and passwords stay out of the test.

Recording and running use the real mouse, keyboard and screen.Give them a machine or a session of their own, and use a test account and test data.More in Good practices.

Still stuck?Tell us what you were trying to do, and we answer within one working day.

Ask our team