Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

SEO Metadata
titleSimulate Capture

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

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

...

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

Usage

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

Info
titleSet Experitest Url

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

Example

Code Block
languagejava
titleSimulate 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");
Info
titlePrerequisite

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

Info
titleFor Android 9+

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

Code Block
adb shell settings put global hidden_api_policy_pre_p_apps 1
adb shell settings put global hidden_api_policy_p_apps 1