android app is not launched after Running appium script using java for sauce labs

I am new to saucelabs. I dont how to install appium java client and how to excute java test script file through which command? Can anybody help to me?Got confused with many commands and tutorials. I am using eclipse and java to run appium script to lauch android application in sauce labs.I have included external jar files (required jars for testNG,java client appium,junit ,saucerest,-1.0.26).When i run the script as testNg application,it gives result.But The application is not launched after logging in saucelabs.The TestNg result is attached as file.The script is

public class sampAppium {

    public AndroidDriver driver; // RemoteWebDriver driver1;

    public void setUp() throws Exception { // set up appium

        String apkURL = "sauce-storage:Report.apk";
        String sauceUserName = "gkyrreport";
        String sauceAccessKey = "e4f*****************8eeed6638";

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("deviceName", "Android Emulator");
        capabilities.setCapability("platformVersion", "4.4");
        capabilities.setCapability("app", apkURL);
        capabilities.setCapability("appPackage", "");
        capabilities.setCapability("appActivity", ".MainActivity"); // driver1 = new RemoteWebDriver(new URL(MessageFormat.format("http://{0}:{1}",sauceUserName, sauceAccessKey)), capabilities);

        URL sauceURL = new URL("https://"; + sauceUserName + ":" + sauceAccessKey + "");
        driver = new AndroidDriver(sauceURL, capabilities);

        System.out.println("App launched successfully");

    @After public void tearDown() throws Exception {

    @Test public void testUIComputation() throws Exception {
        WebElement button = driver.findElementByClassName("UIAButton");;

    public String getSessionId() {
        return getSessionId();

Source: eclipse

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.