3

I'm trying to get the Selenium Android client to run in my emulator:

  1. Install SDK
  2. Run emulator
  3. Install android-server-2.0rc1.apk in the emulator and devices
  4. Forward the port by adb forward tcp:8080 tcp:8080
  5. Install Python and set the selenium.py seript as this page says: http://seleniumhq.org/docs/appendix_installing_python_driver_client.html
  6. Run the web driver client in the emulator
  7. Run the command in Python from selenium import webdriver
  8. This gives me the following error message:

    Traceback (most recent call last):
    File "<pyshell#0>", line 1, in <module>
    from selenium import webdriver
    ImportError?: cannot import name webdriver
    
testerab
5,1151 gold badge33 silver badges54 bronze badges
asked Jun 26, 2011 at 5:53

2 Answers 2

5

You need to install the selenium bindings for Python. Try this:

sudo pip install selenium
answered Feb 7, 2012 at 20:30
1

Run python and do this:

import sys
sys.path

it will return sort of "list of folders/modules" you can import from.
To be able to import from selenium, you need to have it in this list,
it appears similar to this:

'.../lib/python2.6/site-packages/selenium-2.12.1-py2.6.egg',

If you don't have one, chances are you did not installed it properly, or it didn't make it to your pythonpath.

If you still sure that you did install it, try to add path to the selenium folder to the sys.path manually like this:

import sys
path_to_selenium = '/path/to/installed/selenium'
sys.path.append(path_to_selenium)
from selenium import webdriver

For more information read this, this and this.

answered Feb 7, 2012 at 21:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.