The Simplest Way to Make GitLab CI and Testcomplete Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use GitLab CI and TestComplete to run desktop and web UI tests on every code push. GitLab CI triggers a runner on a Windows machine, and TestComplete runs the test suite and sends back a pass or fail log. This setup catches UI bugs before code reaches production. Still, running GUI tests from a build server takes careful planning. You must manage Windows user sessions, license checks, and test data permissions. How GitLab CI and TestComplete share identities and data The workflow start

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use GitLab CI and TestComplete to run desktop and web UI tests on every code push. GitLab CI triggers a runner on a Windows machine, and TestComplete runs the test suite and sends back a pass or fail log.

This setup catches UI bugs before code reaches production. Still, running GUI tests from a build server takes careful planning. You must manage Windows user sessions, license checks, and test data permissions.

How GitLab CI and TestComplete share identities and data

The workflow starts when a developer pushes code to a branch. GitLab CI reads the pipeline rules and picks a registered Windows runner. This runner must run in an active desktop session so TestComplete can draw windows and click buttons.

The runner logs in to the Windows host using a local or domain account. Next, the runner starts the TestComplete engine and passes the project path. TestComplete checks out a floating license from the license manager on your network.

During the test run, the test script interacts with your target app and test database. When the suite finishes, TestComplete writes a result file to the local disk. The GitLab runner reads this file, uploads the artifacts, and marks the build job as passed or failed.

Common failure modes in UI test pipelines

Many teams hit a wall when they run UI tests on build servers. The most common failure is a locked Windows screen. If the remote desktop session closes or locks, Windows stops drawing the screen. TestComplete then fails because it cannot find buttons or text boxes.

Shared service accounts cause another major risk. Teams often give the Windows runner a single admin login that never changes. Everyone on the team knows this password. When a test fails, developers log in to the runner machine with that same shared account to fix the bug. Soon, you have no audit log of who changed the test machine or viewed sensitive test data.

Overbroad database tokens also create trouble. UI tests often need to seed test rows or check database state after a form submit. Teams often store a master database key in GitLab variables. Any job on that runner can read that key and alter data across all test systems.

GitLab CI Security + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged queries and test actions make audits hard. If a test suite reads real customer emails or card numbers in a staging app, that data ends up in screen captures and test logs. Anyone who can read the GitLab job page can see those files.

Scoping roles and network paths for test runners

You can fix these risks by tightening how the two tools interact. First, dedicate specific Windows runners only to UI test jobs. Tag these runners in GitLab and lock them to main branches or release pipelines. This stops untrusted branches from running arbitrary code on your UI test hosts.

Second, drop shared admin accounts on the test machines. Give the runner service a narrow local role that can only launch the test engine and the target app. Keep developers out of the build host console unless they use an audited login tied to their own identity.

Third, limit database permissions for test scripts. Create a narrow database role that can only read and write specific test tables. Rotate the credentials for this role often. If your staging database holds real phone numbers or national IDs, use data masking so queries rewrite matched fields in results before the app renders them on screen.

Finally, restrict network paths from the test runner. The runner host only needs to reach the GitLab server, the license manager, and the staging app. Block all other outbound and inbound traffic at the firewall level.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Why do TestComplete jobs fail when no one is logged into the runner?

TestComplete needs an active Windows desktop session to render the app UI and move the mouse. You must set up the GitLab runner as an interactive process inside an unlocked user session, not as a background Windows service.

Can I run multiple TestComplete jobs on the same GitLab runner at the same time?

No, a standard Windows desktop session can only support one active GUI test at a time. To run tests in parallel, you need separate virtual machines or a server host that supports multiple independent user sessions.

How should we handle test logs that contain sensitive staging data?

Do not use raw production data in your staging environment. Mask fields like emails and card numbers at the database level so rewrites happen before the UI renders them, and set short expiration times on GitLab job artifacts.

The query runs. The emails stay hidden.