Java client for xcuitest

I have difficulty to understand how to work with the new driver…
I succeeded to run the XCUITEST driver on IOS 10 with this line…

Wed driver = new RemoteWebDriver(new URL(""), capabilities);

When I worked with appium before the driver was created like that :

AppiumDriver iosDriver = new IOSDriver(new URL(""), capabilities);

Few Q:

  1. Is it the way to work with IOS 10, via selenium jars?
    the appium java-client jars for appium are deprecated for IOS 10? and if not, what is the version of the java-client jar that contains the appium driver for xcuitest?

  2. Can any one give me a direction to all the new xcuitest driver documentation (specification of the methods)?
    How to find element? like in selenium, or there are new elements objects to specify in the code?


Sorry, first line is:
WebDrier driver = new RemoteWebDriver(new URL(""), capabilities);

  1. Appium must be 1.6.X
  2. java client version 4.1.2

10x man

As I understand, the driver creation is like this?
AppiumDriver iosDriver = new IOSDriver(new URL(""), capabilities);
Am I correct?
What about my Q concerning the elements objects? The API didn’t change?

my way on Mac (some code copy-paste. some capabilities not working in 1.6.X… just left in case - e.g. ‘waitForAppScript’):

protected static AppiumDriver driver;
private static DesiredCapabilities capabilities = null;

if (deviceName.contains("iPhone")) capabilities = DesiredCapabilities.iphone();
    else if (deviceName.contains("iPad")) capabilities = DesiredCapabilities.ipad();
    else System.err.println("  DEVICE NAME for iOS platform is WRONG: " + deviceName);

capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "Appium");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, osVersion);
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "120");
capabilities.setCapability("waitForAppScript","$.delay(3000); $.acceptAlert(); true;");

if (devicePlatform.contains("fullReset")) { // reinstall client
    System.out.println("  Driver DO FULL-RESET");
    capabilities.setCapability(MobileCapabilityType.FULL_RESET, true);
    capabilities.setCapability(MobileCapabilityType.NO_RESET, false);
} else if (devicePlatform.contains("fastReset")) { // clears cache without reinstall
    System.out.println("  Driver DO FAST-RESET");
    capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
    capabilities.setCapability(MobileCapabilityType.NO_RESET, false);
} else {
    System.out.println("  Driver DO NORMAL start");
    capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
    capabilities.setCapability(MobileCapabilityType.NO_RESET, true);

File appDir = new File(userDir, fileName);
capabilities.setCapability(MobileCapabilityType.APP, appDir.getAbsolutePath());

String baseURL = "";
String minorURL = "/wd/hub";
String port = appiumServer_Port;
driver = new IOSDriver(new URL(baseURL+port+minorURL), capabilities);

Thanks for the super quick response :slight_smile:

One more issue…

I have difficulty finding elements…
Here is my code…
The class name I got from the Xcode 8 Accessibility Inspector
WebElement e = driver.findElement(By.className(“MockiPhoneAccessibilityElement”));

The driver doesn’t find the element…
Any ideas???

And concerning the capability you mentioned…
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, “Appium”);
It is not?
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, “XCUITest”);

No matter. Both are working.

And corning the elements?