0
votes

questions:

1.App does not have any Content-desc,what should i be using in this case? to call the element ex: There is a button,and need to tap on that button when i inspect the element from UIautomator tool,it does not have any content in content-desc, what else can i considere best way to identify that element

Ex: Resource-id : au.com.carsguide:id/search_btn Content-desc - blank

If i use Resource-id, the appium does not picks that value, it has to be only "search_btn" then it picks the value, why is resource-id not supported with complete package name?

  1. What is the difference b/w AndroidDriver and RemoteDriver, which one should i be using, If using RemoteDriver is like do we need to run the selenium server?

3.I am able to run the appium automation on the actual device, can any one help me in running the automation on android emulator? how to do that?

Below error is seen when used AndroidDriver:

FAILED CONFIGURATION: @BeforeClass setUpBeforeClass
java.lang.Error: Unresolved compilation problems: 
The return types are incompatible for the inherited methods    FindsByAccessibilityId<WebElement>.findElementsByAccessibilityId(String),   AppiumDriver<RequiredElementType>.findElementsByAccessibilityId(String)
The return types are incompatible for the inherited methods   FindsByCssSelector.findElementsByCssSelector(String),   AppiumDriver<RequiredElementType>.findElementsByCssSelector(String)
The return types are incompatible for the inherited methods  WebDriver.findElements(By), AppiumDriver<RequiredElementType>.findElements(By)
The return types are incompatible for the inherited methods  FindsById.findElementsById(String),  AppiumDriver<RequiredElementType>.findElementsById(String)
The return types are incompatible for the inherited methods  FindsByLinkText.findElementsByLinkText(String),  AppiumDriver<RequiredElementType>.findElementsByLinkText(String)
The return types are incompatible for the inherited methods  FindsByXPath.findElementsByXPath(String),  AppiumDriver<RequiredElementType>.findElementsByXPath(String)
The return types are incompatible for the inherited methods  FindsByName.findElementsByName(String),  AppiumDriver<RequiredElementType>.findElementsByName(String)
The return types are incompatible for the inherited methods  FindsByTagName.findElementsByTagName(String),  AppiumDriver<RequiredElementType>.findElementsByTagName(String)
The return types are incompatible for the inherited methods  FindsByLinkText.findElementsByPartialLinkText(String),  AppiumDriver<RequiredElementType>.findElementsByPartialLinkText(String)
2

2 Answers

1
votes
  1. Less is good. Why do you want to access id with package name ? By the way you have specified package name in capabilities so appium uses id with package name internally to locate application components. If component belongs to other app then you need to provide id with its package name.

  2. You don't need to run selenium server, you need to run Appium Server. AndroidDriver extends Abstract AppiumDriver which extends DefaultGenericMobileDriver (this is also abstract) again this abtract class extends RemoteWebDriver.

So AndroidDriver has more APIs/functions than RemoteWebDriver. So you can choose AndroidDriver.

-1
votes
    • You can use Genymotion emulator
    • When emulator is run perform command adb devices in terminal to get emulator id
    • Use emulator id 192.168.56.101:5555 for deviceName and udid appium capabilities