Photo and video simulation
UFT Mobile's photo and video simulation lets you simulate the capturing of images and videos.
About photo and video simulation
Using UFT Mobile's photo and video simulation, you specify the image or video to use instead of the actual output of the camera. You can then use these images or videos to test your app.
When you perform simulation of a photo, UFT Mobile replaces the camera output with the selected file, when you tap the Take a picture button on the device. When you perform simulation of a video, UFT Mobile replaces the camera output with the selected file, when you end the video recording session on the device.
If you are recording test code, you will notice two steps: a file upload step and a simulation step.
To use photo and video simulation, make sure that you have a remote view of a device and that the Control Panel is open.
Note: Photo and video simulation is supported only for packaged iOS and Android apps.
Activate simulation mode.
- For a photo, click the photo simulation button .
- For a video, click the video simulation button .
The Simulate Photo or Simulate Video dialog box opens.
In the Simulate dialog box, provide a file, one at a time, in one of the following ways:
- Paste in the URL of the image or video file.
- Browse for a file on a local or network machine.
- Drag and drop a file (not supported for UFT).
- Click the uploaded image to select it. A green checkmark indicates this is the image to be used for simulation.
You can prepare all image and video files for your test at once. See Guidelines for photo and video simulation for information on the valid file types and sizes. If you have uploaded multiple files, click the photo or video simulation button and select the file to use the next time your device takes a picture or video.
Tip: If you do not change your selection, the test will continue to use the same photo or video each time you take a picture or record a video.
- Click OK to activate camera simulation. When simulation mode is active, the simulation button in the Control Panel is displayed within a blue frame.
- On your device, navigate to the screen in the app from where you will be taking a picture or video.
- Click the camera button to take a picture, or click the Start Recording button, proceed with your recording session and click Stop.
- Repeat the above steps for all the images or videos you want to replace.
To deactivate simulation, click the photo or video simulation buttons, select the No Simulation box, and click OK.
When using photo and video simulation for replacing images or videos, follow these guidelines:
- The maximum number of files you can download on a device is 100.
- The files should not consume more than 50% of the device's free disk space.
- The supported image formats are: JPG, GIF, PNG, and BMP. iOS also supports TIF files. The uploaded TIF files may display as broken images, but they can still be used for simulation.
- The supported video formats are: For Android: 3GP, MP4, and MKV. For iOS: MOV, MP4, and M4V.
- The maximum upload file size for images is 5 MB. The maximum upload size for videos is 20 MB with 1.5 GB of free memory for Android devices, and 40 MB for iOS devices.
- The uploaded files are only valid for the current session. Once the test or remote view session is finished, the files will be erased.
- Photo and video simulation is supported for the standard static camera and video mechanisms. Simulation may not be possible for apps that utilize a camera for scanning areas or prepare images for further processing or animations.
- Simulation may not be possible if you customize the built-in camera settings.
On Android devices, set the saveToPic parameter to true (false by default) to save the images or videos to a subfolder in the device's photo gallery. For example, modify the recorded step: