Unable to Click on an element even if it is visible - iOS

I am trying to click on a button using Accessibility ID as well as XPATH but getting an error - element is not displayed. Below are the properties for the element that I got from appium inspector -

Version -
appium driver - 1.6.3
iOS - Platform - 10.2, iPhone 6s

It works sometimes and very flacky. Has anyone encountered such issue? What is the best way to Automate the click for that element.

A couple things I’d try.

  • Upgrade to Appium 1.6.4-beta so you are on the latest
  • Make sure you are waiting long enough for it to become visible

What client libraries are you using? For java, try something simple like this…

WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(MobileBy.AccessibilityId("Refine")));
element.click();

Thanks Brian, will try it and check if its working. I am using Mocha js to write the tests.

Thanks,
Rajiv