java - Selendroid not starting virtual device -
java - Selendroid not starting virtual device -
i trying started selendroid , selenium android virtual devices im having few issues. have java/android sdk/eclipse software installed , can run selenium chromedriver tests fine. when seek run test starts android virtual device, never starts , app doesnt list in http://localhost:4444/wd/hub/status
page.
my generic test below. if run code below, server start , can see local host info status page app version doesnt listed. if run java -jar selendroid-standalone-0.11.0-with-dependencies.jar -app selendroid-test-app-0.11.0.apk
can see app listed in status page. have tried app pre-loaded on virtual device , wit signed app on virtual device, neither have worked.
i pretty much @ dead end else solution. have spent 3-4 days looking solution cant seem find it. in java project have selenium , selendroid .jar file dependencies loaded. have yet install junit or '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 want run our test on android api level 17 device capa.setplatformversion(devicetargetplatform.android17); // explicitly state utilize emulator (an avd) test execution rather physical device capa.setemulator(true); // start new webdriver webdriver driver = new selendroiddriver(capa); // execute 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(); } }
maybe wanna create sure if 'devicetargetplatform.android17' targets device android17. when run test, check log. if http://localhost:4444/wd/hub/status
works you, kindly check device target there.
i had same issue before , figured out using 'android18' not android17.
java selenium selendroid
Comments
Post a Comment