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 --contains)

The object name to find. Required unless --contains is used.

--by

No

Locator strategy to use when matching objects. See Locator Strategies. The default value is: NAME

--contains

No

Match all objects whose name contains this text. Can be used instead of a positional value.

--all

No

Return all matching objects instead of just the first. The default value is: false

--wait

No

Wait for the object to appear before returning. The default value is: false

--timeout

No

How long to wait for the object when using --wait, in seconds. The default value is: 20

--camera-by

No

Locator strategy for the camera used to calculate screen coordinates. The default value is: NAME

--camera-value

No

Camera locator value. If omitted, all cameras in the scene are searched.

Returns

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

--x

Yes

X screen coordinate.

--y

Yes

Y screen coordinate.

Returns

Examples

alttester find-at-coordinates --x 350 --y 500

get-all-elements#

Gets every object in the current scene.

Parameters

Name

Required

Description

--enabled-only

No

If set, return only objects that are active in the hierarchy. The default value is: false

Returns

Examples

alttester get-all-elements
alttester get-all-elements --enabled-only