Hi,
I have installed Appium software in my windows 8.1 PC, When I try to Execute my 1st java program in Eclipse, My Java program is not getting executed in appium application. It was also not displaying any error messages when I run scripts. When I run the program, there is also no error messages in the console and nothing is happening in appium application as well.
I am using windows 8.1 and latest version of Eclipse and appium tools. I have set ANDROID_HOME, JAVA_HOME, and PATH values in Environmental variable, But still i am not getting any Response.
Code:
package calTesting;
import java.net.MalformedURLException;
import java.net.URL;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
public class Calculator {
AndroidDriver driver;
@BeforeClass
public void setUp() throws MalformedURLException {
DesiredCapabilities capabilities= new DesiredCapabilities();
capabilities.setCapability(“BROWSER_NAME”,“Android”);
capabilities.setCapability(“VERSION”,“4.2.2”);
capabilities.setCapability(“deviceName”,“Motorola”);
capabilities.setCapability(“platformNmae”,“Android”);
capabilities.setCapability("appPackage", "com.android.calculator2");
capabilities.setCapability("appActivity", "com.android.calculator2.Calculator");
driver= new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
@Test
public void testCal() throws Exception{
driver.findElement(By.id(“com.android.calculator2:id/digit2”)).click();
driver.findElement(By.id(“com.android.calculator2:id/plus”)).click();
driver.findElement(By.id(“com.android.calculator2:id/digit4”)).click();
driver.findElement(By.id(“com.android.calculator2:id/equal”)).click();
Assert.assertEquals(driver.findElement(By.className(“android.widget.EditText”)).getText(), “6”);
}
@AfterClass
public void tearDown(){
driver.quit();
}
}
This is what I am getting in my Eclipse Console:
[TestNG] Running:
C:\Users\bharath1\AppData\Local\Temp\testng-eclipse–894062743\testng-customsuite.xml
Default test
Tests run: 0, Failures: 0, Skips: 0
Default suite
Total tests run: 0, Failures: 0, Skips: 0
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 3 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@13af739: 21 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@a3ec6b: 1 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@4062d: 71 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@1a50a4c: 19 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@1d415d9: 23 ms
Can somebody help me how to solve this problem, and Why I am getting this?