HI ALL,
I am new to Appium , try to run Appium testcase on Android Simulator and got below error. tried with both App and Chrome but could’t got any success. Also when run Appium Inspector same issue Occur.
Below is the code Used and Appium Log:
Code:
public class AndroidSimulator {
WebDriver driver;
@BeforeClass
public void setUp() throws MalformedURLException{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "6.0");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "AppiumAndroid");
capabilities.setCapability(MobileCapabilityType.APP, "com.android.calculator2");
driver = new RemoteWebDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
}
@Test
public void testCal() throws Exception {
WebElement three=driver.findElement(By.name(“3”));
three.click();
WebElement five=driver.findElement(By.name(“5”));
five.click();
WebElement plus=driver.findElement(By.name("+"));
plus.click();
WebElement four=driver.findElement(By.name(“4”));
four.click();
WebElement zero=driver.findElement(By.name(“0”));
zero.click();
WebElement equalTo=driver.findElement(By.name("="));
equalTo.click();
WebElement results=driver.findElement(By.tagName(“EditText”));
assert results.getText().equals(“75”):“Actual value is : “+results.getText()+” did not match with expected value: 75”;
}
@AfterClass
public void teardown(){
driver.quit();
}
}
Appium Error:
error: Failed to start an Appium session, err was: Error: Device android not configured yet