Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Feb 24, 2020 18:20

Proprietary Perfecto commands are executed using the AppiumDriver or RemoteWebDriver executeScript(script, params) method.

The script parameter contains the command name, in the following format: mobile:command:subcommand. The list of available functions can be found here.

The params parameter contains the command parameters as a <key,value> map.

Note: There is an implicit device ID supplied to all command scripts that uses the DUT.

The following examples show how to execute a function from within your script:

executeScript in Java
//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();

params.put("content", "PRIVATE:Home-cropped.png");
params.put("threshold", 80);
params.put("imageBounds.needleBound", 30);
driver.executeScript("mobile:image:select", params);
executeScript in C#
//declare the Dictionary for script parameters
Dictionary<String, Object> pars = new Dictionary<String, Object>();

pars.Add("content", "PRIVATE:Home-cropped.png");
pars.Add("threshold", 80);
pars.Add("imageBounds.needleBound", 30);
driver.ExecuteScript("mobile:image:select", pars);