Page tree
Skip to end of metadata
Go to start of metadata

Description

The command allows users to test applications that use the camera on a mobile device.

The command injects an image file to the camera preview screen.

Parameters

NameValueDescription
Picture PathPath in String formatThe image file full path, this image will switch the original camera preview screen.

Usage

The command can be used to Simulate Camera capture action, this command needs the Simulate Capture libraries when an application is uploaded.

Set Experitest Url

Please make sure you replace <EXPERITEST_URL> with appropriate URL in the sample code below.

Example

Simulate Capture
DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<EXPERITEST_URL>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "deviceid");
     
...
... 
 
// this command simulates 
seetest.simulateCapture("C:\\images\\image.jpg");

Prerequisite

To work with this feature, the app must require and acquire the permission“android.permission.WRITE_EXTERNAL_STORAGE” before attempting to simulate capture

For Android 9+

For SeeTest local, android 9+, a user should make sure that the following shell commands are run before running of the application:

adb shell settings put global hidden_api_policy_pre_p_apps 1
adb shell settings put global hidden_api_policy_p_apps 1
  • No labels