In the above screenshot, I am trying tap on “Add new account button”
I tried
driver.findElementByAndroidUIAutomator(“text(“Add new account”)”).click();
driver.findElementByXPath("//android.widget.Button[@text=‘Add new account’]").click();
driver.findElementById(“com.ezepay:id/bAddAcc”).click();
All three are giving me same Error: An element could not be located
Could you please let me know where I am going wrong?
I thought my approach to reach this is right.
Which version of appium you are using?
I had same issue, but when i updated the appium(1.10.1).
it worked fined
Yes Appium version might be the reason, please let us know your version.
Also try putting a delay for a second or two after you land on the screen, might work.
Thanks @Aish.appium and sanjaydhami
I used X, Y coordinator, it worked for me. Not sure if this is a ideal approach as the screen-size might vary in different resolution phone.
Here is my Appium version(v1.10.0)
Should I update the Appium Version and try?
Please let me know.
Yeah i think coordinates would not help when your test on different device.
try this driver.findElementByAndroidUIAutomator(“new UiSelector().className(“android.widget.Button”).text(“This button”)”);
Let me know if this works.
I’m facing the same problem since I updated to appium 1.10.1
I’m using
driver.hasElementByAccessibilityId('login_button');
Even with delay, the problem occurs.