I have my project set up to work cross platform by using AppiumDriver.
The problem is, unlike with screenshots, if I wish to implement screen recording I am unable to do so because the required method only exists in either IOSDriver or AndroidDriver.
I launch appium with default capabilities via scripts prior to running tests, and my understanding is that I can’t know which platform I’m on in the java code until the driver has already been instantiated and I can read the platformName capability.
If I try to cast it like so:
((IOSDriver) driver).startRecordingScreen();
I get an error:
java.lang.ClassCastException: io.appium.java_client.AppiumDriver cannot be cast to io.appium.java_client.ios.IOSDriver
Is there a way to record the screen without knowing the platform type until after the driver has been created?
Appium: 1.8.1
Java Client: 6.0.0-BETA5