startActivity() method not available!

I am using Appium 3.2.0 with Java client and facing an issue with the startActivity method. I use IntelliJ as my IDE and it couldn’t find the startActivity method when type driver.startActivity(). It shows other available method though. Anyone faced this issue?

are you casting your driver as AndroidDriver? If not, you should be. startActivity only exists in that subclass because it’s not relevant to iOS

startActviity() is available in AndroidDriver class
startActviity() is not available in IOSDriver class

Already tried casting, result was the same. (AndroidDriver) driver. … But, still no luck

So I kind of solved this time being by checking which instance of the appium driver is actually running (Android or iOS). But am still not sure why the casting didn’t work for me.

1 Like