I’m trying to capture screen recording of automation running through Appium using below code.
final BaseStartScreenRecordingOptions startScreenRecordingOptions = new AndroidStartScreenRecordingOptions()
.withTimeLimit(Duration.ofSeconds("180"))
.withVideoSize("1280x720")
.enableBugReport();
try {
((CanRecordScreen) driver).startRecordingScreen(startScreenRecordingOptions);
log.info("[VIDEO_RECORDING] Video recording started with options : %s", ReflectionToStringBuilder.toString(startScreenRecordingOptions));
} catch (final Exception e) {
log.error("[VIDEO_RECORDING] Start Video Recording operation failed with error : %s",e.getMessage());
}
This code was working fine till couple of days ago and suddenly started throwing below error on real devices.
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: The expected screen record file '/sdcard/2f4a4590.mp4' does not exist after 5000ms. Is screenrecord utility available and operational on the device under test?
I tested by running the ADB commands directly on the device and it works just fine.
adb -P 5037 -s <UDID> shell screenrecord --size 1280x720 --time-limit 10 --bugreport /sdcard/test.mp4
adb -P 5037 -s <UDID> shell "[ -e '/sdcard/test.mp4' ] && echo __PASS__"
Tested the same on different device Samsung S9 and it works fine too.
Environment Info :
- Appium Version : 2.1.3
- Appium uiautomator2 driver version : 2.32.1
- Appium Java Client Version :
- Impacted Devices : Google Pixel 7, Android 13
- Working Devices : Samsung S9, Android 10
Not sure if something changed from Appium/ADB/Android side causing issues ? Any insights on this would be helpful.