I am trying to get started with selendroid and selenium for android virtual devices but im having a few issues. I have all the java/android sdk/eclipse software installed and i can run selenium chromedriver tests fine. BUT when i try to run a test that starts the android virtual device, it never starts and the app doesnt list in the http://localhost:4444/wd/hub/status
page.
My generic test is below. If i run this code below, the server will start and i can see my local host data from the status page BUT my app version doesnt get listed. If i run java -jar selendroid-standalone-0.11.0-with-dependencies.jar -app selendroid-test-app-0.11.0.apk
then i can see my app listed in the status page. I have tried with the app pre-loaded on the virtual device and also wit the signed app on the virtual device, neither have worked.
I am pretty much at a dead end as where else to look for the solution. I have spent 3-4 days looking for a solution but cant seem to find it. Currently in the java project i have only the selenium and selendroid .jar file dependencies loaded. I have yet to install any jUnit or anything 'test' releated
package testpackage;
import io.selendroid.SelendroidCapabilities;
import io.selendroid.device.DeviceTargetPlatform;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class testClass {
/**
* @param args
*/
public static void runSelendroidTest() throws Exception {
// specify test capabilities (your 'test environment')
SelendroidCapabilities capa = new SelendroidCapabilities("io.selendroid.testapp:0.11.0");
// explicitly state that we want to run our test on an Android API level 17 device
capa.setPlatformVersion(DeviceTargetPlatform.ANDROID17);
// explicitly state that we use an emulator (an AVD) for test execution rather than a physical device
capa.setEmulator(true);
// start a new WebDriver
WebDriver driver = new SelendroidDriver(capa);
// execute a very simple test
WebElement inputField = driver.findElement(By.id("my_text_field"));
Assert.assertEquals("true", inputField.getAttribute("enabled"));
inputField.sendKeys("Selendroid");
Assert.assertEquals("Selendroid", inputField.getText());
// quit testing
driver.quit();
}
}