This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
5 / 5
May 2018

Hi All,

I have started my first automation project using Cucumber/Selenium 3.4 with Appium 1.6.5 and iOS version 10.2.

I am able to launch the iOS app perfectly, but I am unable to interact with any elements.
for example, when the app launches, there a table with multiple values on the app page.
the Element is identified as

I have tried
driver.findElement(By.xpath("//XCUIElementTypeStaticText[@name=‘City’]"))
Didnt work

I tried with table head
and its xpath is

//XCUIElementTypeApplication[@name=“CityNames”]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeTable

driver.findElements(By.xpath("//XCUIElementTypeStaticText[@name=‘CityNames’]"))
to get all the elements of the table.

However i get the error
NoSuchSessionExeption
And the message is
A session is either terminated or not started

  • created

    Aug '17
  • last reply

    May '18
  • 4

    replies

  • 1.0k

    views

  • 4

    users

  • 3

    links

@rahulk

driver.findElement(MobileBy.className("XCUIElementTypePickerWheel")).sendKeys("some_text"); 
((IOSDriver) driver).findElementsByIosNsPredicate("value = '" + descr + "'") // value is Text to search
driver.findElement(MobileBy.iOSNsPredicateString("type == 'XCUIElementTypeStaticText' AND name == '" + name + "' AND visible == 1")) // name is ID in most cases

Thanks ! The following worked for me:

driver.findElement(MobileBy.iOSNsPredicateString(“type == ‘XCUIElementTypeStaticText’ AND name == '” + name + “’ AND visible == 1”)) // name is ID in most cases

9 months later

I did a workaround by implementing a script, that scrolls manually and compares element values to the one I’m looking for.