Start Image Injection (FR)
Perfecto Command
mobile:image.injection:start
Purpose
Retrieves an image from the repository. Perfecto supplies this image to the specified application when the application tries to retrieve a camera image.
Image injection continues for this application until activating the Stop Image Injection function.
To learn more about image injection, including requirements and limitations, see Image injection overview.
Parameters
|
Name |
Type |
Possible Values |
Default Value |
Description |
|---|---|---|---|---|
|
repositoryFile |
Multimedia |
|
(Required) The full repository path, including directory and file name, where to locate the image.
Example - PRIVATE:dir1/dir2/name.png Click browse and navigate to the file. Supported image formats: JPEG, JPG, PNG, BMP, GIF (GIF is currently only supported on iOS devices) |
|
|
identifier |
String |
|
Identifier (BundleID for iOS or PackageName for Android) of the application. |
|
|
name |
String |
|
Display name of the application |
|
|
resize |
Boolean |
True False |
False |
Resize the injected image as per device and/or application. |
Return Value
None
Exceptions
None
Examples
Java sample
Map<String, Object> params = new HashMap<>();
params.put("repositoryFile", "PUBLIC:CameraInjectionApps/check.jpg");
params.put("identifier", "Victor.RealTimeFilter");
Object res = driver.executeScript("mobile:image.injection:start", params);
C# sample
Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("repositoryFile", "PUBLIC:CameraInjectionApps/check.jpg");
pars.Add("identifier", "Victor.RealTimeFilter");
driver.ExecuteScript("mobile:image.injection:start", pars);