Item not found by identifier in Appium

I get the following error:

ValueError: Element locator 'identifier=id/edittext1' did not match any elements. 

There is an element with id edittext1 , but it is not recognized!

+5
source share
2 answers

I ran into a similar problem.

I used xpath to host the element.

Below is an example xpath

 Input Text xpath=/hierarchy[@rotation="0"]/android.widget.FrameLayout[@index="0"]/android.widget.LinearLayout[@index="0"]/android.widget.FrameLayout[@index="0"]/android.widget.RelativeLayout[@index="0"]/android.widget.EditText[@index="0"] 
0
source

Try using a different locator, I am using this problem. But with CssSelector it works fine.

Button click example:

 WebElement element1 = driver.findElement(By.cssSelector("div[ng-click^='actionname']")); element1.click(); 
0
source

Source: https://habr.com/ru/post/1259848/


All Articles