Unable to get ios predicate for UIATableCell present inside a UIAWindow and nothing between these two

The problem

I am planning to design iOS Predicate for an XPath “//UIAApplication[1]/UIAWindow[1]/UIATableCell[2]/UIAButton[1]” as per my requirement. I found everywhere the “cells” is present in a tableView but there is no tableView or any other view between UIAWindow or UIATableCell. I searches lots of forums but no success

Environment

Appium 1.5.3
Max OS X 10.11.6
iphone 5s(8.2) and iPad 6 Plus(8.3)

Details

I tried to design a predicate as “.cells[1].buttons[0]” but this is not successful. I want to click a button present inside the tableCell but prior to this the tableCell itself is not recognized. Every forum or website says that the tableCell present inside the tableView but here it’s not the situation. I want it out of tableView. I checked with my developer is there any specific reason by having in this manner but came to know that here tableCell itself is a view that is holding a button but I didn’t understand how this is possible…? Checked Google and all forums and websites but nothing helped in getting a solution for this. I tried to keep mainWindow() before the cells also but it didn’t help me hence desperately hoping that I might get some help in this arena as I see members like @imurchie are so actively providing solutions and they are really so useful to solve my issues. Still a beginner is gaining knowledge about iOSPredicate with Appium I make humble request for a solution.

Link to Appium logs

When the predicate is designed as “.cells[1].buttons[0]”, the logs I got are:-
org.openqa.selenium.WebDriverException: undefined is not an object (evaluating ‘$.mainWindow().cells[1]’) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.23 seconds
Build info: version: ‘2.53.1’, revision: ‘a36b8b1’, time: ‘2016-06-30 17:32:46’
System info: host: ‘Product-QA-Macmini.local’, ip: ‘172.17.12.180’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11.6’, java.version: ‘1.8.0_45’
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities [{app=/Users/TAGIT/Documents/TestData/workspace/6.3_Automation_iOS_ParallelExecution/APK/Mobeix6.3.ipa, networkConnectionEnabled=false, bundleid=com.tagitmobile.MobeixSixTwo, databaseEnabled=false, version=, deviceName==iPhone 5s, platform=MAC, desired={app=/Users/TAGIT/Documents/TestData/workspace/6.3_Automation_iOS_ParallelExecution/APK/Mobeix6.3.ipa, platformVersion=8.2, bundleid=com.tagitmobile.MobeixSixTwo, browserName=iPhone, udid=830f6bf0b038d7e8a006fc9b34609b2ec70d55ce, platformName=iOS, version=, deviceName==iPhone 5s, platform=MAC}, platformVersion=8.2, webStorageEnabled=false, locationContextEnabled=false, browserName=iPhone, takesScreenshot=true, javascriptEnabled=true, udid=830f6bf0b038d7e8a006fc9b34609b2ec70d55ce, platformName=iOS}]
Session ID: 5bea8e7a-93e2-4706-84a1-a7d331bd465b
*** Element info: {Using=-ios uiautomation, value=.cells[1].buttons[0]}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363)
at io.appium.java_client.DefaultGenericMobileDriver.findElement(DefaultGenericMobileDriver.java:56)
at io.appium.java_client.AppiumDriver.findElement(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.findElement(IOSDriver.java:1)
at io.appium.java_client.ios.IOSDriver.findElementByIosUIAutomation(IOSDriver.java:207)
at com.mobienxV6_3.automation.usecases.UC6302_Mobile.FixedLeftPanel(UC6302_Mobile.java:99)
at com.mobienxV6_3.automation.usecases.UC6302_Mobile.UC6302Menu(UC6302_Mobile.java:398)
at com.mobienxV6_3.automation.execution.iOSDeviceExecution.MainMenu(iOSDeviceExecution.java:199)
at com.mobienxV6_3.automation.execution.iOSDeviceExecution.ExecutionMode(iOSDeviceExecution.java:110)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:216)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:143)
at org.testng.TestRunner.beforeRun(TestRunner.java:631)
at org.testng.TestRunner.run(TestRunner.java:599)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:368)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:402)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Code To Reproduce Issue [ Good To Have ]

String predicateValue = “.cells[1].buttons[0]”;
driver.findElementByIosUIAutomation (predicateValue).click ( );