public class AndroidContactsTest {
private AppiumDriver driver;
@Before
public void setUp() throws Exception {
// set up appium
File classpathRoot = new File(System.getProperty("user.dir"));
File appDir = new File(classpathRoot, "src/Package/apps");
File app = new File(appDir, "ChessFree.apk");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName","Samsung");
capabilities.setCapability("platformVersion", "4.2.2");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage", "uk.co.aifactory.chessfree");
capabilities.setCapability("appActivity", ".ChessFreeActivity");
driver = new AndroidDriver<>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}
@After
public void tearDown() throws Exception {
driver.quit();
}
@Test
public void play(){
WebElement el = driver.findElement(By.name("PLAY!"));
el.click();
driver.findElement(By.name("Single Player")).click();
driver.findElement(By.name("PLAY")).click();
}
}
I Get the below error message with executed
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: ‘2.46.0’, revision: ‘87c69e2’, time: ‘2015-06-04 16:17:10’
System info: host: ‘GDC-NO-7Q7FRY1’, ip: ‘10.61.21.135’, os.name: ‘Windows 8.1’, os.arch: ‘amd64’, os.version: ‘6.3’, java.version: ‘1.8.0_51’
Driver info: driver.version: AndroidDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
Emulator:
chromeversion is : com.android.chrome-v44.0.2403.133-240313300-stable-Android-4.1 .apk
Installed chrome using adb command.
When I open the chrome on emulator it’s not getting open. WHat is the problem and when I’m not using chrome for my .apk capabilities why the appium wants chrome to be launched.