How to use the api findElementsByTagName for native android app?Please provide working sample for the same?

Hi,

How would we know the tagName from UIAutomator? is there any other way to find it out the tagname for the particular elements in the view.

I tried with for default calculator app. I couldn’t able to get the elements using TagName. Here is the stack trace.

org.openqa.selenium.UnsupportedCommandException: Invalid locator strategy: tag name (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 34 milliseconds
Build info: version: ‘unknown’, revision: ‘1969d75’, time: ‘2016-10-18 09:43:45 -0700’
System info: host: ‘C02PK9CVFVH5’, ip: ‘92.242.140.21’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11.6’, java.version: ‘1.8.0_121’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{appPackage=com.android.calculator2, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, deviceName=ZX1G22V8TT, platform=LINUX, appActivity=com.android.calculator2.Calculator, desired={appPackage=com.android.calculator2, appActivity=com.android.calculator2.Calculator, platformVersion=5.0, platformName=Android, deviceName=Nexus 5}, platformVersion=5.1, webStorageEnabled=false, locationContextEnabled=false, browserName=Android, takesScreenshot=true, javascriptEnabled=true, platformName=Android}]
Session ID: ffbb4cc9-cb60-4f6a-aa2f-725fff8a2023
*** Element info: {Using=tag name, value=button}

APPIUM java client: 5.0.0_BETA3

Appium Version:1.4.13

Could you please share the working example for the Native app using “driver.findElementsByTagName(“button”);”

Regards,

Shiva Oleti

@shiva, Looks like it’s not supported yet. See https://github.com/appium/appium/issues/6025