Docs Menu
class: WidgetLocator
Specialized locators for querying UMG / Slate 2D User Interfaces. Specter taps directly into the Slate Application router. Extends the base SpecterLocator.
Hierarchy & Queries
Methods for finding child widgets and extracting text.
widget.getChild
Traverses down the UMG Widget Tree to find a specific child widget by its designer name.
const acceptBtn = modal.getChild("AcceptButton", true);Arguments
| Name | Type | Description |
|---|---|---|
| childName | string | The name of the widget in the UMG designer. |
| exact optional | boolean | If true, requires a perfect string match. Default: false (contains match). |
Returns:WidgetLocator
widget.getText
Extracts the text from a UTextBlock or URichTextBlock.
const text = await modal.getChild("TitleText").getText();
expect(text).toBe("Are you sure?");Returns:Promise<string>
widget.checkVisibility
Directly queries the Slate rendering pipeline to verify if the widget was actively drawn to the screen on the last frame.
const isVisible = await modal.checkVisibility();Returns:Promise<boolean>
Input & Navigation
widget.hardwareFocus
Uses an A* spatial heuristic to automatically navigate the UI using simulated analog directional inputs (D-Pad or Joystick) until the widget achieves hardware focus.
const settingsBtn = world.widget("SettingsButton");
await settingsBtn.hardwareFocus();Returns:Promise<void>
widget.click
Clicks the widget. Can use hardware pointer simulation or direct UMG broadcast.
await acceptBtn.click({ strategy: 'hardware' });Arguments
| Name | Type | Description |
|---|---|---|
| options optional | object | { strategy: 'hardware' | 'broadcast', timeout?: number } |
Returns:Promise<void>
widget.hardwareAccept
Simulates pressing the standard 'Accept' button (Enter / Gamepad Face Button Bottom) natively through Slate while this widget is focused.
await acceptBtn.hardwareFocus();
await acceptBtn.hardwareAccept();Returns:Promise<void>