I’m new to appium and tried the sample from uTest - The Professional Network for Testers, when I run the code using testNG I get this error as In APPIUM
error: Failed to start an Appium session, err was: Error: Bad app: C:\MobileTesting\RunningAppium\apps\Chess Free.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 ‘C:\MobileTesting\RunningAppium\apps\Chess Free.apk’
info: [debug] Using local app from desired caps: C:\MobileTesting\RunningAppium\apps\Chess Free.apk
info: [debug] Got configuration error, not starting session
info: [debug] Cleaning up appium session
info: [debug] Error: Bad app: C:\MobileTesting\RunningAppium\apps\Chess Free.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 ‘C:\MobileTesting\RunningAppium\apps\Chess Free.apk’
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:56:13)
at C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\device.js:82:16
at Object.oncomplete (fs.js:107:15)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Bad app: C:\MobileTesting\RunningAppium\apps\Chess Free.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 ‘C:\MobileTesting\RunningAppium\apps\Chess Free.apk’)”,“origValue”:“Bad app: C:\MobileTesting\RunningAppium\apps\Chess Free.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 ‘C:\MobileTesting\RunningAppium\apps\Chess Free.apk’”},“sessionId”:null}
info: ← POST /wd/hub/session 500 8.990 ms - 724
Code:
File classpathRoot = new File(System.getProperty(“user.dir”));
File appDir = new File(classpathRoot, “/apps”);
File app = new File(appDir, “Chess Free.apk”);
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, “”); //Name of mobile web browser to automate. Should be an empty string if automating an app instead.
capabilities.setCapability(“platformName”, “Android”);
capabilities.setCapability(CapabilityType.VERSION, “4.4.2”);;
capabilities.setCapability(“deviceName”, “Samsung”);
capabilities.setCapability(CapabilityType.PLATFORM, “WINDOWS”);
capabilities.setCapability(“app”, app.getAbsolutePath());
//capabilities.setCapability(“appPackage”, “com.example.android.contactmanager”);
//capabilities.setCapability(“appActivity”, “.ContactManager”);
capabilities.setCapability(“appPackage”, “uk.co.aifactory.chessfree”);
capabilities.setCapability(“appActivity”, “.ChessFreeActivity”);
driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
Please let me know how to solve this issue, I can run the chrome using same emulator. However I cant make this app ro run…