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:
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. |
|
Reasoning |
Boolean |
true, false |
Enable this option to allocate additional AI resources for tasks that require multi-step logical processing, such as counting elements, sorting items, or determining order. This may improve accuracy for commands involving structured analysis or decision-making. Default is false. |
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
JavaScript
await driver.execute('perfecto:ai:user-action', { action: 'Open new order screen!' , reasoning: false });
driver.executeScript("perfecto:ai:user-action", Map.of("action", "Open new order screen!" , "reasoning", false));