Automation Targets

Desktop Application Automation

GPAL.Application automates desktop programs. GUI applications running outside the browser. Using the same selectors, actions, and units of work as GPAL.Browser.

Same Vocabulary, Different Target

GPAL.Application.Open launches (or attaches to) a desktop application by its executable path, returning the same kind of fluent workflow object that GPAL.Browser does. WithSelector, the action methods (LeftClick, TypeIn, GetGrid, and the rest), CallIfFound/CallIfNotFound, and units of work all work exactly the same way. What changes is what GPAL is looking at: instead of a DOM, it's the Windows UI Automation tree of controls inside the application's windows.

var app = GPAL.Application

.Open("notepad.exe")

.ToGPALObject();

app

.WithSelector(GPAL.Selector.WithAutomationID("15")) // the main edit control

.TypeIn("Hello from GPAL")

.WithSelector(GPAL.Selector.WithName("File")) // a menu item

.LeftClick();

Finding Controls Without CSS

Browser selectors lean on CSS and XPath because that's how HTML documents are structured. Desktop applications have no DOM, so GPAL.Selector offers WithName and WithAutomationID for application controls. WithName matches a control's accessible name (the text a screen reader would announce), and WithAutomationID matches the AutomationId property that many Windows controls expose, which tends to be more stable across UI tweaks than visible text. WithClassName matches the underlying control's class, useful when several controls share a name but differ by type.

TIP

Tools like Windows' Inspect.exe (part of the Windows SDK) or Accessibility Insights let you browse a running application's UI Automation tree to find the Name, AutomationId, and ClassName values to target with WithSelector.

When to Use Application vs Browser

If the thing you're automating is a website, GPAL.Browser is almost always right. Even if it happens to be running inside a desktop wrapper like Electron, the content is still a DOM that CSS selectors can reach. Reach for GPAL.Application when there's no DOM at all: native Windows applications, legacy Win32 programs, or any GUI that exposes its controls only through UI Automation.

WARNING

WithHardware. Simulated OS-level mouse and keyboard input. Works for GPAL.Application selectors the same way it does for GPAL.Browser. See 'Hardware-Level Interaction' for when and why to use it.