Text button click (FR)

Perfecto Command

mobile:button-text:click

Purpose

Identifies a button, based on a text label, and clicks on it.
This function includes an integrated platform-specific OCR customization.

Parameters

Name Type Possible Values Description
label String

The text that searching for to appear on the button.

It is recommended to use the entire string searched for, to ensure that if the OCR misses a few characters, the label will still be found.

interval Integer

The minimum time interval (default = 0), in seconds, for a single analysis.

If the analysis operation takes less than the interval, wait the remaining time before the next analysis operation.

In addition, the General Visual Analysis parameters are supported

Return Value

None

Exceptions

None

Examples

Copy

Java sample

 Map<String, Object> params = new HashMap<>();
params.put("label", "Search");
params.put("threshold", 80);
params.put("ignorecase", "nocase");
driver.executeScript("mobile:button-text:click", params);
Copy

JavaScript sample

var params = {
"label":"STRING",
"threshold":80,
"operation":"single"}
browser.executeScript('mobile:button-text:click', params);
Copy

C# sample

Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("label", "Search");
pars.Add("threshold", 80);
pars.Add("ignorecase", "nocase");
driver.ExecuteScript("mobile:button-text:click", pars);