Unable to find element by xpath

Using Appium 1.2.2, when trying to find an element by xpath:
apm.driver.find_element(:xpath, “//UITableViewCell/UILabel[contains(@accessibility_id, ‘myLabel’)]”)

I get a ElementNotFound error:
An element could not be located on the page using the given search parameters.

Any ideas on how to fix this?

Well, are you sure the element is there?
Try substituting other value for the @accessbilityId part.
"//UITableViewCell/UILabel[contains(@description, 'myLabel')]" maybe?

My mistake, the element was actually a UIATableCell. Thanks!

1 Like