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. The application must have been installed with sensor instrumentation.
To use this command, one of the two application identifiers is required. For information on retrieving the application identifier, see Application identifier.
Image injection continues for this application until activating the Stop Image Injection function.
Restriction: Image injection is supported for the front and back cameras of Android devices and the back camera of iOS devices. It is not supported for the front-camera of iOS devices.
Parameters
Name | Type | Possible Values | 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. |
|
identifier | String | Identifier (BundleID for iOS or PackageName for Android) of the application. | |
name | String | Display name of the application |
Return Value
None
Exceptions
None
Examples
Copy
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);
Copy
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);