I want to launch Appium with Android emulator on Windows.
I want to test ApiDemo.apk
.
The following graphic shows my Appium GUI configuration:
The following graphic shows my starting emulator:
The following code is showing my JUnit test case:
import java.net.URL;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
public class AppiumAndroidTest {
private AppiumDriver<WebElement> driver;
@Before
public void setUp() throws Exception {
DesiredCapabilities capa = new DesiredCapabilities();
capa.setCapability("automationName","Appium");
capa.setCapability("platformName","Android");
capa.setCapability("deviceName","Nexus_5");
capa.setCapability("platformVersion","23");
capa.setCapability("newCommandTimeout","30");
capa.setCapability("unicodeKeyboard", true);
capa.setCapability("resetKeyboard", true);
capa.setCapability("app", "C:\\Android\\SDK\\apps\\ApiDemos.apk");
driver = new AndroidDriver<WebElement>(new URL("http://127.0.0.1:4723/wd/hub"), capa);
}
@After
public void tearDown() throws Exception {
driver.quit();
}
@Test
public void testScriptGoesHere() throws Exception {
System.out.println("Test start");
System.out.println("Test end");
}
}
Now I receive this error in Appium GUI log:
> Nexus_5
> info: [debug] Emulator Nexus_5 not running
> info: [debug] Trying to find Nexus_5 emulator
> info: [debug] Getting connected emulators
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: C:\Android\SDK\platform-tools\adb.exe devices
> info: [debug] 1 device(s) connected
> info: [debug] 1 emulator(s) connected
> info: [debug] Sending telnet command to device: avd name
> info: [debug] Getting running emulator port
> info: [debug] Socket connection to device created
> info: [debug] Socket connection to device ready
> info: [debug] Telnet command got response: a[K[Dav[K[D[Davd[K[D[D[Davd [K[D[D[D[Davd n[K[D[D[D[D[Davd na[K[D[D[D[D[D[Davd nam[K[D[D[D[D[D[D[Davd name[K
So can anyone tell me how to fix this?
Greets!