1

The Selenium docs for the Android Driver say to install the Android SDK in ../android_sdk, relative to the directory containing the Selenium repository. Simple, but I'm not sure exactly what folder corresponds to the Selenium repository

If my directory looks like this, simplified just to give an idea of the directory structure:

/lib
    /selenium
        setup.py
        Webdriver.sln
        wire.py
        (other files)
        /py
            /selenium
                __init__.py
                selenium.py

Where would be the appropriate place to unpack the Android SDK?

1 Answer 1

0

I don't think it matters where you unpack it to. The point is that I launch the avd:

D:\Temp\1Mobile\Installs\adt-bundle-windows-x86-20130219\sdk\tools>emulator -avd
 AVD_for_Nexus_S1 -no-audio -no-boot-anim -scale .8

Then I run the following commands (one at a time) to get the AVD's name, and register webdriver to it...

cd D:\Temp\1Mobile\Installs\adt-bundle-windows-x86-20130219\sdk\platform-tools
adb devices
adb -s (AVD_NAME) -e install -r android-server.apk
adb -s (AVD_NAME) shell am start -a android.intent.action.MAIN -n org.openqa.selenium.android.app/.MainActivity
adb -s (AVD_NAME) forward tcp:8080 tcp:8080

Then in your test.py file you want something like this (so it knows where to send commands to):

 def setUp(self):
        #self.driver = webdriver.Firefox()
        self.driver = webdriver.Remote("http://127.0.0.1:8080/wd/hub",desired_capabilities={"browserName": "android"})

HTH, Sam

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.