Camera image injection
This document provides details about the camera image injection feature of Katalon TestCloud.
Prerequisites
- You have installed the Katalon TestCloud Keywords plugin. If you have not, visit Katalon Store: Katalon TestCloud keywords.
The Camera image injection function supports the following systems and interfaces:
- iOS: 13 or higher.
- The
didFinishPickingMediaWithInfo
class ofUIImagePickerController
iOS SDK class for capturing an image. See: Apple documentation. - The
AVCapturePhoto
iOS SDK class for receiving captured photos fromAVCapturePhotoOutput
class. See: Apple Documentation.
- The
- Android: 9 or higher.
- The
CameraX
API: CameraX. - The
Camera
API: Camera. - The
Camera2
API: Camera2. - The
ACTION_IMAGE_CAPTURE
Intent 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.
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:options
property, 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.injectImage
keyword to your test case. - Configure your TestCloud environment and run the test.