Could not find element(By Xpath) - Android

I’m trying to send some data to a EditText Element by Xpath.

[FindsBy(How = How.XPath, Using = "//android.widget.LinearLayout[14]/android.widget.RelativeLayout[0]/android.widget.EditText[0]")] public IWebElement JobTest { get; set; }

this screeen has many textboxs and to get this specific one I have to scroll down , and I thought when using the Xpath element, the screen will be scrolled down automatically…?

@Yaniv_Eliav: Not true for the mobile. You should scroll to the view where the EditText present and then only you can perform the action on the element.

@email2vimalraj: so even if the Element had an ID(which is not true in this case), I should have scroll to the element and then perform the action?
anything wrong with the Xpath? or the problem is that I ddidn’t scroll down to the element first?

Always. Appium only works with elements within the screen.

1 Like

There is nothing wrong on how you perform. Only mandatory thing is that you have to scroll to the view and then only you can perform an action. Even if is an ID attribute also.