I am getting an error when I am launching Appium on Android

When launching Appium on Android I get following error:

Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: The desired capabilities must include either an app, appPackage or browserName Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'

My code:

package SignupUchat;

import java.net.MalformedURLException;
import java.net.URL;

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

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;

public class Signup_Uchat {

    public static void main(String[] args) throws Exception {
        DesiredCapabilities dc=new DesiredCapabilities();

        dc.setCapability(MobileCapabilityType.AUTOMATION_NAME, "Appium");
        dc.setCapability(MobileCapabilityType.DEVICE_NAME, "HUAWEI");
        dc.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
        dc.setCapability(MobileCapabilityType.PLATFORM_VERSION, "8.1.0");
        dc.setCapability("appPakage","com.android.calculator2");
        dc.setCapability("appActivity","com.android.calculator2.Calculator");

        URL url=new URL("http://127.0.0.1:4723/wd/hub");
        AndroidDriver<WebElement> driver=new AndroidDriver<WebElement>(url,dc);
    }
}   

1 answer

  • answered 2019-10-08 09:05 frianH

    It seem like your wrong at the line:

    dc.setCapability("appPakage","com.android.calculator2");
    

    It should:

    dc.setCapability("appPackage","com.android.calculator2");
    

    appPackage not appPakage

    Capabilities