LocateGUIElement
CUTools
Description
Find specific GUI elements such as buttons, input fields, or labels! LocateGUIElement enables automatic location of UI controls based on various criteria - UI automation without guessing coordinates!
With support for automation IDs, names, classes, and text content, you can identify any interactive element - the foundation for robust and maintainable UI automation!
Why This Tool Stands Out
- Find Elements by ID/name
- Precise Location of controls
- Robust Automation without coordinates
- Screen Coordinates determined
Perfect for:
RPA developers, QA automation engineers, and advanced UI testers. Ideal for robust test automation that keeps working even when the UI changes slightly.
Workflow support; time savings depend on the task
Instead of working with fixed coordinates that break with every UI change, you find elements dynamically - robust tests that last!
JSON Parameters
- parentHandle OPTIONAL (Integer)The parent window. If omitted, the entire desktop is searched.
- automationId OPTIONAL (String)The automation ID of the element (for modern UI frameworks)
- name OPTIONAL (String)The name/label of the element (e.g., "OK", "Username")
- className OPTIONAL (String)The Windows class of the element (e.g., "Button", "Edit")
- controlType OPTIONAL (String)The control type (e.g., "Button", "TextBox", "ComboBox")
- index OPTIONAL (Integer)Index if multiple matching elements exist. Default: 0
Example Call
{
"tool": "LocateGUIElement",
"params": {
"parentHandle": 123456,
"name": "OK",
"controlType": "Button"
}
}
Example Usage
Typical AI Command
- "Find the 'Username' input field in the login form and enter 'admin'."
Return Values
The tool returns an object with the following properties:
- success (Boolean)
True if an element was found - found (Boolean)
Whether a matching element exists - elementHandle (Integer)
Handle of the GUI element found - name (String)
Name/label of the element - controlType (String)
Type of the control - screenX (Integer)
X coordinate on the screen - screenY (Integer)
Y coordinate on the screen - width (Integer)
Width of the element - height (Integer)
Height of the element - error (String, optional)
Error message if the search failed
Related Tools
Download CUTools
Get access to all 17 Computer Use tools for Windows automation.
Download Now