The Simplest Way to Make Json Rpc and Testcomplete Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use json rpc and testcomplete together to test web services and user interfaces. TestComplete sends JSON-RPC messages to backend services and checks the returned results. This setup lets one test suite run backend procedures and check frontend screens. Quality engineers can seed test data through an API before clicking a button. They can also verify backend state right after a user action finishes. Yet pairing a desktop test runner with remote procedures creates security and maintenance g

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 json rpc and testcomplete together to test web services and user interfaces. TestComplete sends JSON-RPC messages to backend services and checks the returned results.

This setup lets one test suite run backend procedures and check frontend screens. Quality engineers can seed test data through an API before clicking a button. They can also verify backend state right after a user action finishes. Yet pairing a desktop test runner with remote procedures creates security and maintenance gaps. Test scripts often hold static keys that grant too much power to every runner.

How json rpc and testcomplete share data and permissions

JSON-RPC is a stateless protocol that sends method calls as plain JSON objects. Each request carries a method name, input values, and an identifier for tracking. TestComplete builds these JSON payloads inside its test scripts and sends them over HTTP. The remote server runs the requested method and sends back a result object.

To make this work, the test runner must log in to the remote service. Most teams store an API key or bearer token inside the test project variables. When a test run starts, the runner reads that secret and adds an auth header. The remote server checks the token and runs the procedure under that account role.

Data flows both ways during a single test run. Outbound requests might create a user account or reset a staging database table. Inbound responses return status codes, record IDs, or full customer objects for assertions. If the backend returns real customer rows, those records land in local test logs.

Common failure modes in test runner setups

The biggest risk in this workflow is the shared service account. Teams often create one admin token and paste it into every test machine. If a contractor or build agent runs the suite, they get full admin rights. No one can tell which person or job triggered a destructive remote call.

Broad permissions make this problem much worse. A token meant to read order status might also allow dropping test tables. Because JSON-RPC often uses a single HTTP endpoint for all methods, network rules cannot block specific procedures. Standard firewalls only see traffic going to one path and let everything pass.

JSON Web Tokens (JWT) + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged calls and exposed secrets also hurt engineering teams. When a test fails, TestComplete writes the full request and response to disk. Those logs can hold raw emails, phone numbers, or card numbers from staging data. To fix this, teams must scope service roles to the exact methods needed. They should also tie every test run to an individual user or build identity. Locking down network paths between test runners and backend hosts stops rogue calls early.

How to scope roles and protect test data

Start by splitting your remote procedures into read and write groups. Give your standard test role permission to call only safe read methods. When a test needs to change state, use a separate role with narrow limits. Never let a test runner use a root or full admin key.

Next, clean up the data that comes back from your remote calls. Data masking rewrites matched fields like emails, phone numbers, and card numbers in results. This keeps sensitive values out of your local test reports and build artifacts. Your assertions still pass because the JSON structure stays the same.

Finally, rotate your test credentials often and track every method call. Central logs should show who started the test and which JSON-RPC method ran. Clear audit trails help teams spot broken tests and unauthorized calls right away.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

How does TestComplete send a JSON-RPC request?

TestComplete uses its built-in HTTP request objects within script units to send POST payloads. The script formats the method name and parameters as a JSON string and reads the response.

Why are shared API keys risky for automated UI and API tests?

Shared keys hide which user or build job actually ran a remote method. If a key leaks from a test machine, an attacker gains broad backend permissions.

How can teams keep sensitive data out of TestComplete logs?

Teams can apply data masking to rewrite emails, phone numbers, and card numbers in responses. This prevents real personal data from landing in saved test logs and screenshots.

The query runs. The emails stay hidden.