How to use resource-id find location

if have example please show me

You have to be more explicit.

If you want to find element using id, there are several alternatives. You can use:

driver.findElementById("your_id")

thank you but i want to know python2.7 can find resource-id or not?

find_element_by_id I guess :thinking:

xpath=//hierarchy/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.webkit.WebView[1]/android.webkit.WebView[1]/android.view.View[9]/android.widget.EditText[1]

xpath=//hierarchy/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.webkit.WebView[1]/android.webkit.WebView[1]/android.view.View[10]/android.widget.EditText[1]

This is different ??

This will work for python, in getting access to the resource id.

self.driver.find_element_by_id("")

ID(resource-id): Native element identifier. resource-id for android; name for iOS.

Node details of that element will be displayed. In those details get the value of ‘resource-id’. And pass the value in the syntax.

Syntax:
driver.findElement(By.id(“resource-id Value”));

Example:

Using this ID we can locate an element. Let’s try to find the digit 1 from the calculator app using UI Automator. Just Click on number ‘1’ in UIAutomator. In node details you will ‘resource-id’ having value ‘com.android.calculator2:id/digit_1’.

Refer this post for Locator strategies: