Inject an image
On an open device, you can inject a still image or an animated GIF to mock the use of the camera. This is helpful for testing application actions, such as focus or image placement, in apps that rely on camera usage, for example barcode readers or banking apps. A more advanced use case could be the simulation of real user interactions in apps that rely on animated content. For example, injecting GIFs can help evaluate the robustness of facial recognition and anti-spoofing mechanisms in liveness checks for banking apps.
Image injection supports uploaded images in JPEG, JPG, PNG, BMP, or GIF (GIF is currently only supported on iOS devices). The file size cannot exceed 150 MB.
On this page:
Requirements
For image injection to work, make sure that:
-
The application to test has been installed with sensor instrumentation enabled
-
The application to test stays in the foreground
-
No other instrumented application is running in the background
Limitations
Animated GIF images are currently only supported on iOS devices.
Instructions
To learn how to inject an image, watch this video or review the instructions following the video. For automated testing, you can use the existing Start Image Injection and Stop Image Injection commands.
To inject an image:
-
On the open device, start the application you want to test and navigate to the relevant screen. Make sure the app stays in the foreground.
-
On the device toolbar, click the image icon
.
-
In the Inject image dialog box, select the location of your image file: Repository (default) or Computer.
-
Depending on your selection in step 2, do the following:
-
Repository: Search for and select the repository file you want to use.
You can search by tag name, if applicable. If a file is associated with tags, a tag symbol appears below the file name, along with the number of tags associated with the file. To view the tag names, move the pointer over the tag icon
.
-
Computer:
-
Click ADD IMAGE.
-
Browse to the file you want to use.
-
Select the file and click Open.
The file loads.
-
-
-
Click INJECT IMAGE.
Perfecto injects the file and your app should reflect the result shortly.
-
Perform the required testing.
-
When done, click the image icon
again and stop the injection.