0

I am trying to make an automated test suite for a mobile app on iOS. The code is written down in Javascript using Titanium framework, which is actually making it very difficult to identify the elements. I’m using Java on IntelliJ, Appium server 1.7.0 (since I the app desktop is not compatible yet with Xcode 9).

I have the following libraries installed in my project: -client-combined-3.5.3-nodeps -selenium-server-standalone-3.5.3 -java-client-4.1.2 (I am aware that there’s a 5.0.3 version, but the driver is set to null in this case, not precisely sure what version I should use).

If I try to call the IOSDriver the following way:

public class LoginTest {

private IOSDriver driver;

@Before
public void setUp() throws MalformedURLException {

    DesiredCapabilities capabilities = new DesiredCapabilities();

    capabilities.setCapability("platformName", "iOS");
    capabilities.setCapability("deviceName", "iPhone 6s");
    capabilities.setCapability("platformVersion", "10.3");
    capabilities.setCapability("app", "/Users/themermaid/Downloads/xxx-4.app");
    capabilities.setCapability("deviceOrientation", "portrait");
    capabilities.setCapability("appiumVersion", "1.7.0");

    driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
    driver.findElementByAccesibilityId("nextButton").click();
}

I get a NullPointerException on any findElementBy, doesn't matter if it is by AccesbilityId (which equals the AccessibilityLabel from Titanium), XPath, or Name.

I found out that if I Use RemoteWebElement and RemoteWebDriver instead of iOS or MobileDriver, then it finds the elements and clicks on them, but then I cannot perform mobile touch actions, such as swiping or long pressing, nor identify by AccesbilityId. If I try to find an IOSElement with a RemoteWebDriver, I get a ClassCastException.

I’m out of ideas at this point on how to go on, I've browsed endlessly everywhere and nobody on the Appium Support forums has replied, so I’d ve very grateful if you could help me out on this.

Eressea
  • 21
  • 3
  • 1
    Possible duplicate of [What is a NullPointerException, and how do I fix it?](https://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – Juan Carlos Mendoza Sep 28 '17 at 13:28
  • I found what the issue was. I deleted all jars and used java-client 5.0.3 – Eressea Sep 29 '17 at 09:22

0 Answers0