Appium Scripts are failed to Execute while setting AUTOMATION\_NAME = “ESPRESSO”

Issue

I am using Espresso Driver to run my script. Every time it asks me to do the instrumentation. But I don’t have the source code, since I only received the .APK file from my customer. In this case, is there any workaround?

The version, code, and log details are below.

Appium Version : Appium 1.14.0 - Beta 1 (Tested with Appium 1.13 also)


dc.setCapability(MobileCapabilityType.PLATFORM, Platform.ANDROID);
dc.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ESPRESSO);
dc.setCapability("forceEspressoRebuild", "true");
dc.setCapability("appPackage","com.example.android.contactmanager");
dc.setCapability("appActivity","com.example.android.contactmanager.ContactManager");

I have used dc.setCapability("forceEspressoRebuild", "true");

Error Stack Trace "Exception in thread "main" 
org.openqa.selenium.SessionNotCreatedException: 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: java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.appium.espressoserver.test/androidx.test.runner.AndroidJUnitRunner} from pid13612, uid13612 not allowed because package io.appium.espressoserver.test does not have a signature matching the target com.phonepe.app
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'INBLR-JENAB', ip: '192.168.99.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131'
Driver info: driver.version: AndroidDriver"

Solution

Espresso needs to be in the application, you’re trying to test using the appium-espresso-driver. Check out How to Get Started with Espresso (Android) article to get familiarized with the concept.

If it is not there and you don’t have access to the sources – you won’t be able to use the Espresso driver, you will have to go for UIAutomator2 instead

Answered By – Dmitri T

Leave a Comment