I am currently working on automating an android application using Appium and Selenium and have run into some problems with locating elements by ID. I want to use XPATH but do not know how to get the XPATH of android UI elements. Does anyone know how to determine the XPATH of an element or know of a tool that can do this work quickly? Thanks!
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
You can use UIAutomatorviewer utility in Android SDK to get the required locator. Go to your Android SDK installation's 'tools' folder and trigger uiautomatorviewer.bat file. From there, you can locate app elements.
Visit this link which shows how to use it.
http://www.testingdiaries.com/locate-android-app-elements/
Try viewing the source code:
https://android.stackexchange.com/questions/5039/how-do-i-view-source-in-the-android-browser
Then figuring out the xpath becomes easier from there.