Image button click (FR)
Perfecto Command
Purpose
Identifies a button, based on an image label, and clicks on it.
This function includes an integrated platform-specific OCR customization.
For more information on how to use the visual relations feature, follow the instructions listed in the Visual Relations article.
Parameters
Name | Type | Possible Values | Description |
---|---|---|---|
label | Multimedia | Repository path to image file (png, jpg) | The image that appears on, or related to, the button. |
timeout | Integer |
|
The time, in seconds, to wait for the label to appear. For a dynamic screen, specify the expected waiting time for the label to appear. For example, the page loading time. The timeout contains the system analysis time, for this reason it is recommended to specify at least 20 seconds. |
In addition, the General Visual Analysis common and image parameters are supported
Return Value
None
Exceptions
None
Examples
Java sample
Map<String, Object> params = new HashMap<>();
params.put("label", "PRIVATE:Home-cropped.png");
params.put("threshold", 80);
driver.executeScript("mobile:button-image:click", params);
C# sample
Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("label", "PRIVATE:Home-cropped.png");
pars.Add("threshold", 80);
driver.ExecuteScript("mobile:button-image:click", pars);