Can't run Appium TestCase

AppiumTest.javapackage com.test;import java.io.File;import java.net.URL;import java.util.List;import org.junit.Test;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;imp...

AppiumTest.java

package com.test;

import java.io.File;
import java.net.URL;
import java.util.List;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.BeforeMethod;

public class AppiumTest {

    private WebDriver driver;

    @BeforeMethod
    public void setUp() throws Exception{
        File rootFile = new File(System.getProperty("user.dir"));
        File appFile = new File(rootFile, "Application");
        File app = new File(appFile, "demo.apk");
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("device", "Android");
        capabilities.setCapability("app", app.getAbsolutePath());
        capabilities.setCapability("app-package", "my_demo_apk_pck");
        capabilities.setCapability("app-activity", ".Login");
        driver = new RemoteWebDriver(new URL("http://0.0.0.0.4723/wd/hub"), capabilities);

    }

    @Test
    public void loginTest(){

        List<WebElement> txt = driver.findElements(By.className("android.widget.EditText"));
    }

And I paste my demo.apk inside the Application directory

And I installed TestNG plugin in my Eclipse IDE

Before running my AppiumTest.java, I start the Appium Server by running Appium.exe and I got the message as

Starting Node Server
> info: Welcome to Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe)
> info: Appium REST http interface listener started on 0.0.0.0:4723
> info: [debug] Non-default server args: {"app":"**\\demo.apk","logNoColors":true,"deviceName":"**","platformName":"Android","platformVersion":"18","automationName":"Appium"}
> info: Console LogLevel: debug

After starting Appium server, I run my AppiumTest.java by RunAs->TestNG Test and I got an message as Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="Sun Microsystem Inc." and I can't run it. How can I solve my issue. Can any one suggest me about my issue

While running I got,

Default suite
Total tests run: 0, Failures: 0, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@626b2d4a: 0 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@73a8dfcc: 29 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@6f2b958e: 3 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 0 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@aec6354: 25 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@c2e1f26: 3 ms
Picked up JAVA_TOOL_OPTIONS: -Djava.vendor="Sun Microsystem Inc."

Use AppiumDriver instead of RemoteWebDriver , You can use IOSDriver or AndroidDriver respectively

AppiumDriver driver = new IOSDriver(new URL("http://0.0.0.0.4723/wd/hub"), capabilities)

I have been using testng and eclipse for long time but never run with this issue. Try to change your drivers as given below:

protected AppiumDriver driver;
driver = new AppiumDriver(new URL("http://0.0.0.0.4723/wd/hub"), capabilities);
Translating... 0%