android - AndroidWebDriver class missing in Selenium-Java library -
i tried example provided in the, android app testing through selenium, have included selenium-java library , android-webdriver apk installed in emulator, when try sample code provide in forum got error in anroidwebdriver import, in selenium library androiddriver class available, adroidwebdriver jar. plz assit.
note: selenium library latest one.
import android.test.activityinstrumentationtestcase2; import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.android.androidwebdriver; import simple.app.simpleappactivity; public class simplegoogletest extends activityinstrumentationtestcase2<simpleappactivity> { private webdriver driver; private webdriver googledriver; public simplegoogletest() { super("simple.app", simpleappactivity.class); } @override protected void setup() throws exception { driver = new androidwebdriver(getactivity()); } ........................,,,,, }
there 2 variations of android driver:
androiddriver()
use on personal computer e.g. laptop, workstation, etc. provides richest , complete set of capabilities tests.androidwebdriver()
runs on android device, wraps webview component provide basic core functionality.
the example code comes android sdk , optional support selenium/webdriver runs basic tests on device. tests compiled android program extend activityinstrumentationtestcase2
. androidwebdriver()
contained in sdk/extras/google/webdriver/android_webdriver_library.jar
(and javadocs in sdk/extras/google/webdriver/android_webdriver_library-srcs.jar
so, if want run tests on android device, need include android-webdriver-library.jar in project. perhaps simplest way copy jar test project's libs folder.
however, if run tests on personal computer can modify example code use androiddriver instead of androidwebdriver. need change base class e.g. use junit 3 or junit 4. have posted sample test answer question on stack overflow here having difficulty in finding elements using xpath , css in selenium android webdriver testing
Comments
Post a Comment