This document describes the verified manual workflow for running
RemotingTest_Core.exe with RemotingTest_Rendering_Win32.exe, finding controls
through the automation service, and exiting cleanly.
Build GacUI first:
cd C:\Code\VczhLibraries\GacUI\Test\GacUISrc
& C:\Code\VczhLibraries\GacUI\.github\Scripts\copilotBuild.ps1For HTTP transport:
start C:\Code\VczhLibraries\GacUI\Test\GacUISrc\x64\Debug\RemotingTest_Core.exe /Http /RPT
start C:\Code\VczhLibraries\GacUI\Test\GacUISrc\x64\Debug\RemotingTest_Rendering_Win32.exe /HttpFor named-pipe transport:
start C:\Code\VczhLibraries\GacUI\Test\GacUISrc\x64\Debug\RemotingTest_Core.exe /Pipe /RPT
start C:\Code\VczhLibraries\GacUI\Test\GacUISrc\x64\Debug\RemotingTest_Rendering_Win32.exe /PipeStart the core first. The core console should print either:
> HTTP server created, waiting on: http://localhost:8888/GacUIRemoteProtocolHttp
> Waiting for a renderer ...
> Renderer connected: 2
or:
> Named pipe created, waiting on: GacUIRemoteProtocolNamedPipe
> Waiting for a renderer ...
> Renderer connected: 2
When /RPT is enabled, the core exposes an automation service on port 8888.
Use these endpoints:
http://localhost:8888/Automation/RemotingTest_Core/Controls
http://localhost:8888/Automation/RemotingTest_Core/IO
http://localhost:8888/Automation/RemotingTest_Rendering_Win32/Dom
Controls returns JSON with element text and bounds. Search the JSON for the
visible text you want, then read the nearest enclosing object's bounds object.
The bounds object has x1, y1, x2, and y2 fields. Click the center point:
x = (x1 + x2) / 2
y = (y1 + y2) / 2
If the visible text is inside an elementText label, walk upward to the nearest
enclosing node that has a control field and use that node's bounds. Send input
commands by posting to IO with content type application/json; charset=utf8.
Example:
Invoke-WebRequest `
-UseBasicParsing `
-Method Post `
-Uri http://localhost:8888/Automation/RemotingTest_Core/IO `
-ContentType 'application/json; charset=utf8' `
-SkipHeaderValidation `
-Body '!LeftClick:<x>,<y>'The coordinates are logical GacUI coordinates. Re-read Controls after opening
menus or dialogs, because their bounds are only present after they are visible.
The verified /RPT sequence is:
- Open the File menu.
- Click the first close item:
self.Close() (InvokeInMainThread). - Confirm the
Do you want to exit?dialog withOK. - If the renderer shows a native
ERROR from GacUI Coredialog, click itsOKbutton too. - Confirm both
RemotingTest_CoreandRemotingTest_Rendering_Win32have exited.
Use the automation service to calculate every click point from the current
Controls response:
- Read
Controlsand search for theFilemenu text. - Use the nearest enclosing control bounds and post
!LeftClick:<x>,<y>to open the menu. - Read
Controlsagain and search forself.Close() (InvokeInMainThread). - Use that menu item's enclosing control bounds and post its center point.
- Read
Controlsagain and search for theOKbutton in theDo you want to exit?dialog. - Use that button's enclosing control bounds and post its center point.
$io = 'http://localhost:8888/Automation/RemotingTest_Core/IO'
Invoke-WebRequest -UseBasicParsing -Method Post -Uri $io -ContentType 'application/json; charset=utf8' -SkipHeaderValidation -Body '!LeftClick:<x>,<y>'For /Http /RPT, both processes should exit after the exit dialog OK.
For /Pipe /RPT, RemotingTest_Rendering_Win32 may show a native error dialog
titled ERROR from GacUI Core with the message:
ReadFile failed because the named pipe was closed.
Click OK in that native dialog. The renderer should then close.
If a run is interrupted, stop both processes:
Get-Process RemotingTest_Core,RemotingTest_Rendering_Win32 -ErrorAction SilentlyContinue | Stop-Process -Force