AI user action (FR)

Perfecto Command

perfecto:ai:user-action

Purpose

Use Perfecto's perfecto:ai:user-action command in Appium, Selenium, or Quantum tests while running tests on real and virtual Perfecto devices.

To learn more about working with AI-powered user actions, see the following resources:

Important: To have this functionality set up in your cloud, contact your Perfecto account representative. A separate license is required to access this feature.

Parameters

Name Type Possible Values Description

Action

String

You can type a command of up to 2000 characters length.

The logical goal when navigating the device screen, such as "Log in as Jill with password 123."

To learn more, see Perform AI-driven user actions.

Return Value

True or False

In case of a successful user action, you will get a Boolean with the value true.

In case of unsuccessful user action (or a policy violation), you will get a Boolean with the value false.

Test failure

The test fails and the action aborts if the action could not be performed.

Exceptions

The following message appears when your cloud does not have the consent to use AI:

Failed to execute command ai-user-action: Unexpected error occurred while processing command 'ai-user-action'. Error message: AI commands are disabled. To use these commands, contact your administrator. Status: Forbidden

Examples

Copy

JavaScript

await driver.execute('perfecto:ai:user-action', { action: 'Open new order screen!' });
Copy
Java
driver.executeScript("perfecto:ai:user-action", Map.of("action", "Open new order screen!"));