0

Error

An unknown server-side error occurred while processing the command. Original error: The instrumentation process cannot be initialized. Make sure the application under test does not crash and investigate the logcat output.

Code:

package com.android.app;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.MobileCapabilityType;

public class mobileAutomation {
    @SuppressWarnings("unused")
    public static void main(String[] args) throws MalformedURLException {
        // TODO Auto-generated method stub
        DesiredCapabilities dcap = new DesiredCapabilities();
        dcap.setCapability(MobileCapabilityType.DEVICE_NAME, "emulator-5554");
        dcap.setCapability(MobileCapabilityType.PLATFORM_NAME,"android");
        dcap.setCapability("appPackage", "com.microsoft.teams");
        dcap.setCapability("appActivity", "com.microsoft.skype.teams.Launcher");
        dcap.setCapability("noReset", "true");
        //dcap.setCapability("automationName", "UiAutomator1");
        AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(new URL("http://127.0.0.1:4723/wd/hub"), dcap);

    }

}

1 Answer 1

1

use UiAutomator2 and incluse Android Version

caps.setCapability("platformVersion","4.3");

also make sure appium server is started before running your tests

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.