Photo and video simulation
Mobile Center's photo and video simulation lets you simulate the capturing of images and videos.
About photo and video simulation
Using Mobile Center'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, Mobile Center 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, Mobile Center 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. For details, see Device control panel.
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).
- You can prepare all of the 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. Click OK to register the new selection.
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.
- Navigate on your device to the page from where you will be taking a picture or video.
- Click the 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 of 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 simulation mode is active, the photo or video simulation buttons are displayed in a frame in the remote view's Control Panel.
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) in order to save the images or videos to a subfolder in the device's photo gallery. For example, modify the recorded step: