Hi there I have the following code:

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.AutomationName;
import io.appium.java_client.remote.MobileCapabilityType;

public class Base {

    public static void main(String[] args) throws MalformedURLException {
        // TODO Auto-generated method stub

        DesiredCapabilities d = new DesiredCapabilities();
        d.setCapability(MobileCapabilityType.DEVICE_NAME, "iPHONE 6");
        d.setCapability(MobileCapabilityType.PLATFORM_NAME, "IOS");
        d.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST);
        d.setCapability(MobileCapabilityType.APP, "//users//xcodeclub//Desktop//UICatalog.app");
        IOSDriver<IOSEelement> driver = new IOSDriver<>(new URL(""),d);



But I am getting the following error:

Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
    IOSEelement cannot be resolved to a type
    Cannot infer type arguments for IOSDriver<>
    '<>' operator is not allowed for source level below 1.7

    at Base.main(Base.java:29)

I have tried some marvens but is not working, someones know how to help me? I am new in the automation thing and I do not know how to fix this.

1 Answer 1


Make sure you cast the driver correctly and import all necessary libraries. Here is the example on Appium's GitHub

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.ios.IOSElement;
AppiumDriver<IOSElement> driver;
driver = new IOSDriver<>(new URL(""), capabilities);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.