Execute proprietary functions
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.
Important: An implicit device ID is supplied to all command scripts that use the device under test (DUT).
The following examples show how to execute a function from within your script:
Copy
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);
Copy
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);