I am new to , i configured with selenium it is working fine
I am able to the browser in my device and able to edit and do all the commands.
But unable to open specified , i gave the location correctly but it throws an error

A new session could not be created. (Original error: Bad app: E:AppiumAppsRecycle_BuddyRecylebuddy.apk. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat ‘E:AppiumAppsRecycle_BuddyRecylebuddy.apk’) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 46 milliseconds
Build info: version: ‘3.11.0’, revision: ‘e59cfb3’, time: ‘2018-03-11T20:33:15.31Z’
System info: host: ‘CYWD031’, ip: ‘192.168.2.84’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_171’

In appium server following error occurs

info: –> POST /wd/hub/session {“desiredCapabilities”:{“app”:”E:AppiumAppsRecycle_BuddyRecylebuddy.apk”,”appActivity”:”com.myrecylebuddy.ui.splash.SplashActivity”,”appPackage”:”com.myrecyclebuddy”,”browserName”:””,”deviceName”:”4529a900″,”platformName”:”Android”,”udid”:””,”version”:”6.0.1″},”capabilities”:{“desiredCapabilities”:{“app”:”E:AppiumAppsRecycle_BuddyRecylebuddy.apk”,”appActivity”:”com.myrecylebuddy.ui.splash.SplashActivity”,”appPackage”:”com.myrecyclebuddy”,”browserName”:””,”deviceName”:”4529a900″,”platformName”:”Android”,”udid”:””,”version”:”6.0.1″},”firstMatch”:[{“browserName”:””,”platformName”:”android”}]}}
info: Client User-Agent string: Apache-HttpClient/4.5.3 (Java/1.8.0_171)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : version
info: [debug] Using local app from desired caps: E:AppiumAppsRecycle_BuddyRecylebuddy.apk
info: [debug] Got configuration error, not starting session
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Bad app: E:AppiumAppsRecycle_BuddyRecylebuddy.apk. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat ‘E:AppiumAppsRecycle_BuddyRecylebuddy.apk’
info: [debug] Error: Bad app: E:AppiumAppsRecycle_BuddyRecylebuddy.apk. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat ‘E:AppiumAppsRecycle_BuddyRecylebuddy.apk’
at [object Object]. (C:Program Files (x86)Appiumnode_modulesappiumlibdevicesandroidandroid-common.js:56:13)
at C:Program Files (x86)Appiumnode_modulesappiumlibdevicesdevice.js:82:16
at FSReqWrap.oncomplete (fs.js:95:15)
info: [debug] Responding to client with error: {“status”:33,”value”:{“message”:”A new session could not be created. (Original error: Bad app: E:AppiumAppsRecycle_BuddyRecylebuddy.apk. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat ‘E:AppiumAppsRecycle_BuddyRecylebuddy.apk’)”,”origValue”:”Bad app: E:AppiumAppsRecycle_BuddyRecylebuddy.apk. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Error locating the app: ENOENT, stat ‘E:AppiumAppsRecycle_BuddyRecylebuddy.apk'”},”sessionId”:null}
info: <– POST /wd/hub/session 500 2.157 ms – 700

This is my code

package demo;

import java.net.MalformedURLException;

import java.net.URL;

import java.io.File;

import org.junit.Test;

import org.openqa.selenium.By;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.MobileElement;

import io.appium.java_client.android.AndroidDriver;

import io.appium.java_client.remote.MobileCapabilityType;

public class StartChrome {

    private static AndroidDriver<MobileElement> driver;

    @Test

    public void test1() throws MalformedURLException{

         File appDir= new File("E:/Appium/Apps/Recycle_Buddy");

            File APP= new File(appDir,"Recylebuddy.apk");

    DesiredCapabilities capabilities= new DesiredCapabilities();

     capabilities.setCapability(MobileCapabilityType.BROWSER_NAME,"" );

capabilities.setCapability(MobileCapabilityType.PLATFORM,Platform.ANDROID);

    capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"Android");

      capabilities.setCapability(MobileCapabilityType.APP, 
APP.getAbsolutePath());

     capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"4529a900");

         capabilities.setCapability(MobileCapabilityType.UDID, "");

       capabilities.setCapability(MobileCapabilityType.VERSION,"6.0.1");

       capabilities.setCapability("appPackage", "com.myrecyclebuddy");

       capabilities.setCapability("appActivity", 
"com.myrecylebuddy.ui.splash.SplashActivity");

         driver = new AndroidDriver<MobileElement>(new 
URL("http://127.0.0.1:47334/wd/hub"), capabilities);


driver.findElement(By.id("com.myrecyclebuddy:id/email")).sendKeys("[email protected]
mer.com");


driver.findElement(By.id("com.myrecyclebuddy:id/password")).sendKeys("[email protected]
123");





    driver.findElement(By.id("com.myrecyclebuddy:id/loginButton")).click();





    driver.quit();

    }

}



Source link https://sqa.stackexchange.com/questions/34008/how-to-open-the-app-using-appium

LEAVE A REPLY

Please enter your comment!
Please enter your name here