I am new to appium, After starting the appium server, I tried to run my simple program of opening whatsapp using the below code but I am ending with the error "Bad app".
public class WatsApp {
public static void main(String[] args) throws MalformedURLException {
File app = new File("E:\\appium\\APK files\\com.whatsapp.apk");
WebDriver dr;
DesiredCapabilities cap = DesiredCapabilities.android();
cap.setCapability(CapabilityType.BROWSER_NAME, "");
cap.setCapability("deviceName", "SM-N750");
cap.setCapability("platformVersion", "4.4.2");
cap.setCapability("platformName", "Android");
cap.setCapability("app", app.getAbsolutePath());
dr= new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), cap);
dr.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
dr.quit();
}
}
error: Failed to start an Appium session, err was: Error: Bad app: E:\appium\appium_work\basicappium\‪E:\appium\APK files\com.whatsapp.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:\appium\appium_work\basicappium\‪E:\appium\APK files\com.whatsapp.apk' 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. : platform, version info: [debug] No appActivity desired capability or server param. Parsing from apk. info: [debug] No appPackage desired capability or server param. Parsing from apk. info: [debug] Using local app from desired caps: E:\appium\appium_work\basicappium\‪E:\appium\APK files\com.whatsapp.apk info: [debug] Got configuration error, not starting session info: [debug] Cleaning up appium session info: [debug] Error: Bad app: E:\appium\appium_work\basicappium\‪E:\appium\APK files\com.whatsapp.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:\appium\appium_work\basicappium\‪E:\appium\APK files\com.whatsapp.apk' at [object Object]. (C:\Program Files\Appium\node_modules\appium\lib\devices\android\android-common.js:56:13) at C:\Program Files\Appium\node_modules\appium\lib\devices\device.js:82:16 at Object.oncomplete (fs.js:107:15)
plz help me out for this thanks in advance