Finding objects#
Commands that find objects in the app. They return AltObjects.
Every command also takes the global options, such as --host and --port.
find#
Finds one or more objects in the current scene.
Parameters
Name |
Required |
Description |
|---|---|---|
value |
Yes (or |
The object name to find. Required unless |
|
No |
Locator strategy to use when matching objects. See Locator Strategies. The default value is: |
|
No |
Match all objects whose name contains this text. Can be used instead of a positional |
|
No |
Return all matching objects instead of just the first. The default value is: |
|
No |
Wait for the object to appear before returning. The default value is: |
|
No |
How long to wait for the object when using |
|
No |
Locator strategy for the camera used to calculate screen coordinates. The default value is: |
|
No |
Camera locator value. If omitted, all cameras in the scene are searched. |
Returns
AltObject when finding a single result, or a list of AltObjects when using
--all.
Examples
# Find by name (default)
alttester find PlayButton
# Find by partial name
alttester find --contains Button --all
# Find by tag
alttester find Player --by TAG
# Find by hierarchy path
alttester find --by PATH //Canvas/MainMenu/PlayButton
# Wait for an object to appear (useful after a scene load)
alttester find LoadingScreen --wait --timeout 30
find-at-coordinates#
Finds the object at specific screen coordinates.
Parameters
Name |
Required |
Description |
|---|---|---|
|
Yes |
X screen coordinate. |
|
Yes |
Y screen coordinate. |
Returns
AltObject at the given screen coordinates.
Examples
alttester find-at-coordinates --x 350 --y 500
get-all-elements#
Gets every object in the current scene.
Parameters
Name |
Required |
Description |
|---|---|---|
|
No |
If set, return only objects that are active in the hierarchy. The default value is: |
Returns
List of all AltObjects in the scene.
Examples
alttester get-all-elements
alttester get-all-elements --enabled-only