Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

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
    
share|improve this question

2 Answers 2

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

sudo pip install selenium
share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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