rdp-cli
How to Test a Windows Desktop Application with an AI Agent over RDP
Testing Windows desktop applications is difficult when the software has no API, SDK, or reliable scripting interface. Many legacy ERP, accounting, warehouse, and internal business applications can only be operated through native windows, buttons, forms, menus, and pop-up dialogs.
So, how do you run automated tests for a Windows desktop application with no API?
A practical solution is to combine an AI agent with a real remote Windows desktop. With rdp-cli, the agent can connect to an existing RDP or VNC session, inspect the live screen, perform GUI actions, and verify the result with a fresh screenshot.
Can an AI Agent Test a Windows Desktop Application?
Yes, as long as the target application is visible and interactive inside the remote desktop session.
The agent follows a simple loop:
- Observe the current screen.
- Identify the target window or control.
- Click, type, scroll, or use a keyboard shortcut.
- Capture a new screenshot.
- Verify that the expected result is visible.
This is useful for legacy Windows applications that were never built for automation.
Why API Testing Alone Is Not Enough
API tests are useful for backend logic, but they do not reproduce every real desktop workflow.
A Windows inventory test may require the agent to:
- Launch the desktop application
- Sign in through a native dialog
- Select a warehouse
- Enter a product SKU
- Confirm a warning pop-up
- Export a report to a local folder
API tests may not detect broken buttons, incorrect input focus, unexpected dialogs, or failed export operations. RDP-based GUI testing fills this gap.
A Practical rdp-cli Testing Workflow
Prepare a dedicated Windows test machine with the application installed, a restricted test account, stable sample data, an accessible RDP endpoint, a consistent screen resolution, and a cleanup procedure.
After connecting, always begin with a screenshot. Do not assume the application is already in the expected state.
.\rdp-cli.exe screenshot --session SESSION --out .\before.png
.\rdp-cli.exe click --session SESSION --desktop --x X --y Y --observation OBSERVATION
.\rdp-cli.exe screenshot --session SESSION --out .\after.png
For text input:
.\rdp-cli.exe type --session SESSION --text "Remote task completed." --observation NEW_OBSERVATION
The observation value matters. Every action should use the latest screen state, not an old screenshot or a hard-coded assumption.
After clicking Save, check for a confirmation message, record ID, or updated status label.
Example: Testing a Legacy Windows App
A useful test case is:
- Open the application.
- Sign in with a test account.
- Create a sample customer record.
- Save the record.
- Search for it again.
- Export it to PDF or a spreadsheet.
- Confirm that the exported file exists.
Capture screenshots before and after each important step. If the expected window does not appear, stop and report the current screen instead of continuing with random clicks.
If RDP drive redirection is enabled, test files and exported reports can be transferred through the session. Remote clipboard support can also transfer controlled text.
When Human Review Is Needed
A human should review or take over before destructive actions, security prompts, unknown errors, one-time approvals, or tests in production-like environments.
rdp-cli supports pausing agent input, letting a human operate the desktop, and handing the session back to the agent.
What This Method Cannot Replace
RDP GUI testing does not replace unit tests, integration tests, or backend API tests. It validates what a user can see and operate on the desktop.
It cannot reliably detect hidden calculation errors, database inconsistencies, performance problems behind the UI, instrumented race conditions, or every possible layout state.
The best approach is to combine AI-powered GUI testing with a traditional automated test suite.
Final Takeaway
If you need to test a Windows desktop application without an API, an AI agent connected through RDP provides a practical automation path. It can operate legacy software through the real interface, capture screenshots for review, transfer controlled test files, and hand control back to a human when necessary.
Observe the screen → perform one action → capture a fresh screenshot → verify the result.
FAQ
Can AI agents test Windows apps without APIs?
Yes. They can interact with the GUI over RDP and validate visible results with fresh screenshots.
Does RDP GUI testing replace API testing?
No. It complements API, integration, and unit tests by checking the real desktop workflow.
Related Guides
- Automate Windows Apps That Do Not Have an API
- How to Let Claude Code Control a Remote Windows Desktop