Search code examples
appiumios-ui-automationappium-ios

How to use Ios UI Automation xpath in appium for ios


I am using iosuiautomator for finding the xpath of element

enter image description here

(Note: In appium can't find the xpath). while running following error is displaying

enter image description here


Solution

  • When using iOSUIAutomation search strategy, you don't need localTarget().target.().etc. You can start from right after mainWindow(). I also noticed you put the tap action inside the quotes but is actually a function of the mobile element (and has 2 parameters) so what you'd want is:

    driver.findElementByIosUIAutomation(".tableViews()[2].cells()[2]").tap(1, 250)