Appium Android : find element by element Id in Java

583 Views Asked by At

enter image description here

I tried the following APIs:

MobileElement book = driver.findElementById("c0cc9a86-2fbb-44d6-b288-d8c763c8a0ea");(1)
MobileElement book2 = driver.findElement(By.id("c0cc9a86-2fbb-44d6-b288-d8c763c8a0ea"));(2)

both don't work, (it crashed) I googled and found nothing useful, how can I get to know which API will work in this case?

1

There are 1 best solutions below

0
Gobinda On

Please try this -

MobileElement book = driver.findElementById("com.ophone.reader.ui:id/fixed_bottom_navigation_icon");(1)
MobileElement book2 = driver.findElement(By.id("com.ophone.reader.ui:id/fixed_bottom_navigation_icon"));(2)