Configuring appium

hi i am new to automantion and appium…Can u plz tell me how to set up and configured appium…
i have node js installed along with appium desktop app…i have eclipse and a real device to work on…Already set my java and android path…android sdk is also there,…Just wanna know how to get started

@Vishnu
please check getting started guide on appium home page. If you find some info is missing or incorrect let us know in this thread.

also going through https://github.com/appium/sample-code , will help a lot

Thank you…I am running a sample test given in the link Sample test amazon

the code is :

package amazon;

import io.appium.java_client.android.AndroidDriver;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;

public class StartApplication {

	private static AndroidDriver driver;
	public static void main(String[] args) throws MalformedURLException, InterruptedException {
		
		File classpathRoot = new File(System.getProperty("user.dir"));
		File appDir = new File(classpathRoot, "/Apps/Amazon/");
		File app = new File(appDir, "in.amazon.mShop.android.shopping.apk");
	
		DesiredCapabilities capabilities = new DesiredCapabilities();
		capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
		capabilities.setCapability("deviceName", "Micromax A311");
		capabilities.setCapability("platformVersion", "4.4.2");
		capabilities.setCapability("platformName", "Android");
		capabilities.setCapability("app", app.getAbsolutePath());
		capabilities.setCapability("appPackage", "in.amazon.mShop.android.shopping");
		capabilities.setCapability("appActivity", "com.amazon.mShop.home.HomeActivity");

		driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
		driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
		Thread.sleep(10000);
		driver.quit();

}

}

But i get error like this :

Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Bad app: E:\eclipse\Testing\amazon\apk\in.amazon.mShop.android.shopping.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:\eclipse\Testing\amazon\apk\in.amazon.mShop.android.shopping.apk’) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 164 milliseconds
Build info: version: ‘2.52.0’, revision: ‘4c2593c’, time: ‘2016-02-11 19:03:33’
System info: host: ‘Vishnu’, ip: ‘192.168.1.108’, os.name: ‘Windows 8.1’, os.arch: ‘amd64’, os.version: ‘6.3’, java.version: ‘1.8.0_73’
Driver info: io.appium.java_client.android.AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:162)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:171)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:72)
at amazon.StartApplication.main(StartApplication.java:33)

Do you have the Amazon APK downloaded to that location? If not, you should download the APK, and change the File paths so that they point to where your APK is stored.

Ok i downloaded the apk in that location and changed the name to sample.apk…And the error is gone
bu wen i run it a new error occured like this:

Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Activity used to start app doesn’t exist or cannot be launched! Make sure it exists and is a launchable activity) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 33.73 seconds
Build info: version: ‘2.52.0’, revision: ‘4c2593c’, time: ‘2016-02-11 19:03:33’
System info: host: ‘Vishnu’, ip: ‘192.168.1.108’, os.name: ‘Windows 8.1’, os.arch: ‘amd64’, os.version: ‘6.3’, java.version: ‘1.8.0_73’
Driver info: io.appium.java_client.android.AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:162)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:171)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:72)
at amazon.StartApplication.main(StartApplication.java:29)

And thank u for ur previous reply…M grateful

Try commenting out or removing the capabilities lines related to setting the “appPackage” and “appActivity” capabilities. Amazon may have changed the starting activity since this Appium demo was made.

You can specify applications for testing in the following two ways:

  1. Specify the “app” attribute to point to a URL or file path containing an APK.
  2. Specify the “appPackage” and “appActivity” attributes. “appPackage” specifies the application ID of the package. Appium will launch the app with this application ID on the test device if the application is pre-installed on the device. “appActivity” specifies the launch activity for Appium to launch the app with.

You shouldn’t normally specify both methods together. Appium is able to extract the application ID and launch activity automatically if you specify the app’s location.