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
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 start | What to know |
|---|---|
| GUI Test Studio is installed | The MCP server and gtr-cli come with it. They run on the computer that uses them. |
| The computer is signed in | On 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 screen | Recording, 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
| File | What 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 files | Each 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.
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.
pip install "mcp>=2.3,<3"# 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 back | When |
|---|---|
is_error | The tool could not answer, for instance because an argument is wrong or the computer is not signed in. The text says why. |
structured_content | The 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 to | Tools |
|---|---|
| Compare two pictures, and save one to compare later | compare_imagessave_screenshot |
| See the computer and its screen | statusscreenshotread_screen |
| Record a test | start_recordingpause_recordingresume_recordingundo_last_actiondiscard_recordingfinish_recording |
| Act while recording | clicktype_textpress_keysscrolldragmove_mousewait |
| Add checks while recording | verify_textverify_text_absentverify_valueverify_countverify_visualverify_visual_absentcapture_pictureverify_layoutverify_screen |
| Organise what is recorded, and add other steps | begin_scenarioend_scenarioadd_markerset_test_infoadd_step |
| Run tests and read what they hold and found | list_testsdescribe_testview_recordingrun_testlist_runsget_run_results |
| Change a saved test | edit_testadd_checkadd_actionscapture_baselineaccept_result |
| Cover other browsers and devices | set_browsers_and_devicesgenerate_browsers_and_devices |
| Work with requirements and test plans | get_test_plansave_test_plandecide_planned_testsimport_requirements |
| Start from a Figma design | import_figma_design |
| Report, export and open in the apps | create_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 it does
- 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
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
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.
| What | Where the pictures go |
|---|---|
| The tool, with the AI off | The tool calls no AI, and sends the pictures nowhere. |
| The tool, with the AI on | When 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 tool | It 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
| Argument | Default | What it is |
|---|---|---|
| expected | required | The reference picture. See the four forms below. |
| actual | the screen | The picture to judge, in the same forms. Left out, it is the screen as it is now. |
| strictness | standard | relaxed, standard, strict or exact. |
| ignore_color | false | Compares shapes and text, not colours. |
| ignore_ | true | Leaves out the differences text smoothing makes. |
| max_ | set by the strictness | How many changed pixels are allowed in one area. |
| color_ | set by the strictness | The same Advanced value a Visual Assert has. |
| change_ | set by the strictness | The same Advanced value a Visual Assert has. |
| search_ | 70 | How alike a place must be to be found, from 10 to 100. |
| ai_ | false | Asks AI Smart Verification when the pictures differ. |
| ai_ | none | Your own words for the AI, such as: ignore the date. |
| minor_ | the computer's setting | pass or fail: what a minor difference found by the AI does. |
| name | none | What is compared. It is said to the AI and written in the result. |
| pictures | true | With false, the answer holds words and numbers only, and no picture. |
| save_to | none | A folder for the pictures and the result. Give its full path. |
A picture is given in one of four forms:
| Form | What 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 sizes | What happens |
|---|---|
| The same size | The two pictures are compared directly. |
| The expected picture fits inside the actual one | The Search Phase finds it first. A picture of one flat colour cannot be searched for: the verdict is error. |
| Anything else | The verdict is error, with both sizes. Nothing is ever stretched or cut. |
Its answer
| Verdict | What it means |
|---|---|
| pass | The pictures match. It is the only verdict where passed is true. |
| fail | The pictures differ. |
| not_found | The expected picture is not in the actual one. |
| error | The pictures cannot be compared. The summary says why. |
{
"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"
}
}| Field | What it says |
|---|---|
| decidedBy | What gave the verdict: search (not found), verification, or ai (the AI was asked and answered). |
| search | Where the picture was found. It is there only when the Search Phase ran. |
| verification | The changed pixels, how many are allowed, how many regions differ and where they are. Every place is in the actual picture's own pixels. |
| ai | Only 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. |
| files | Only 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.
{
"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.
| Argument | What it is |
|---|---|
| path | Required. The full path of a .png file. |
| region | Only this part of the screen: x, y, width and height, in the pixels of screenshot. |
| overwrite | An existing file is replaced only with true. |
| pictures | The 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.
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.
gtr-cli run tests --countdown 0 --junit results\junit.xml --json results\run.json --artifacts results\artifactsEvery 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.
gtr-cli coverage tests --json results\coverage.json --fail-on failing,not-runWhat 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.
| Call | What it would change |
|---|---|
edit_testadd_checkadd_actionscapture_baselineaccept_result | A saved test |
set_browsers_and_devicesgenerate_browsers_and_devices | The browsers and devices of a saved test, and what was already generated for one of them |
decide_planned_testsimport_requirements | A test plan |
save_test_plan | A planned test that a person wrote, or that already has its test. New proposals are saved at once, as proposed. |
create_bug_report | Jira, when it creates an issue. A PDF or Excel report is written at once. |
| Always true | Why |
|---|---|
| From a plan, an assistant can only create the tests a person approved | People decide what is tested. A test made without a plan is the one you asked for. |
| No tool confirms a requirement link | A 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 variable | A 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