Camera image injection
This document provides details about the camera image injection feature of Katalon TestCloud.
Prerequisites
- This keyword is applicable for mobile native app testing.
- You have installed the Katalon TestCloud Keywords plugin. If you have not, visit Katalon Store: Katalon TestCloud keywords.
- Follow this guide to install the plugins: Install plugins online from Katalon Store.
The Camera image injection function supports the following systems and interfaces:
- iOS: 13 or higher.
- The
didFinishPickingMediaWithInfoclass ofUIImagePickerControlleriOS SDK class for capturing an image. See: Apple documentation. - The
AVCapturePhotoiOS SDK class for receiving captured photos fromAVCapturePhotoOutputclass. See: Apple Documentation.
- The
- Android: 9 or higher.
- The
CameraXAPI: CameraX. - The
CameraAPI: Camera. - The
Camera2API: Camera2. - The
ACTION_IMAGE_CAPTUREIntent action: ACTION_IMAGE_CAPTURE.
- The
One limitation of testing with cloud-based mobile devices is the ability to capture images. Camera image injection tackles this issue by simulating the action of taking images through a mobile application.
Some common use cases of camera image injection are:
- Scanning a check for a banking application.
- Scanning a QR code.
- Taking a user profile picture.
- Taking a photo and store in a gallery app.
note
- Video capture and other media types are currently not supported.
- For iOS apps signed with Enterprise Certificates, app resigning (a prerequisite for using the Image Injection tool) is not available.
- This feature might force your Appium to modify and re-sign your APK before installing it. Your application, having security checks in place, detects this modification and shows the error to prevent tampering.
- Suggestion: Ask your developers for a specific "debug" or "QA" build of the application. In this build, the security checks (like signature verification, root detection, and anti-tampering) should be disabled. This allows testing tools to instrument the app without triggering security errors.
To perform image injection, you need to specify the desired capability and prepare the images. Follow these steps:
- In Katalon Studio, click the Profile drop-down and select Reload Plugins to check that the plugin is installed.
- Go to Project Settings > Desired Capabilities > TestCloud.
- In the TestCloud table, add a
katalon:optionsproperty, set Type asDictionary, then click the....
- In the Dictionary Property Builder dialog, add the boolean property
enableImageInjection=true. Then click OK.
- Save the images that are required for image injection in the Data Files/TestCloud folder of your project.
The images must be in PNG, JPG, or JPEG formats, and does not exceed 4.5 MB.
- Add the
CameraImageInjectionExecutor.injectImagekeyword to your test case.
- Configure your TestCloud environment and run the test.