jeudi 28 janvier 2021

In Eclipse while doing appium testing ...How to set JAVA_HOME environment variable for Android Tools to work properly?

Original error: The JAVA_HOME environment variable must be set for Android Tools to work properly

My code:

    DesiredCapabilities capabilities = new DesiredCapabilities();
    
    capabilities.setCapability("BROWSER_NAME", "Android");
    capabilities.setCapability("VERSION", "9.0");

    // ZY224HFLPG is device name
    capabilities.setCapability("deviceName","ZY224HFLPG");
    capabilities.setCapability("platformName","Android"); 

    capabilities.setCapability("appPackage", "com.android.calculator2");
    capabilities.setCapability("appActivity","com.android.calculator2.Calculator"); 

driver = new RemoteWebDriver(new URL("https://ift.tt/3oyke3m), capabilities);

Output:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot verify the signature of 'C:\Users\karakris\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.15.0.apk'.

Original error: The JAVA_HOME environment variable must be set for Android Tools to work properly

Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'LIN19003760', ip: '192.168.0.106', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '15.0.1' Driver info: driver.version: RemoteWebDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot verify the signature of 'C:\Users\karakris\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-uiautomator2-server\apks\appium-uiautomator2-server-v4.15.0.apk'. Original error: The JAVA_HOME environment variable must be set for Android Tools to work properly at getResponseForW3CError (C:\Users\karakris\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9) at asyncHandler (C:\Users\karakris\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:384:37) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) . . .

WHAT SHOULD HAVE TO DO?

Aucun commentaire:

Enregistrer un commentaire