Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between AppiumDriver<MobileElement> and AndroidDriver

I am automating android app using Appium (java).
I searched at many places but couldn't find out exact differences between the two drivers mentioned below.

AppiumDriver<MobileElement> driver
AndroidDriver driver

What is difference between them and which one to use when and why?
Any explaination / link / example would be helpful

like image 316
AnswerDroid Avatar asked Feb 09 '16 07:02

AnswerDroid


1 Answers

By the definition from io.appium.java_client.android

public class AndroidDriver<RequiredElementType extends WebElement> 
    extends AppiumDriver<RequiredElementType> implements AndroidDeviceActionShortcuts,
    HasNetworkConnection,PushesFiles, StartsActivity, FindsByAndroidUIAutomator<RequiredElementType> {

AppiumDriver is the super driver for Android driver. So now you shall know, if you are using super driver what all do you have and if you are using the derived driver what all would be getting to use.

Note : AndroidDriver and IOSDriver are derived for different platforms to implement their specific capabilities abstracting one's from the other's.

Though this should not be generalised in anyway, personally I would suggest using AppiumDriver in case of doubts over which to use and how to access elements on the apps.

like image 141
Naman Avatar answered Sep 29 '22 21:09

Naman