I'm trying to get the Selenium Android client to run in my emulator:
- Install SDK
- Run emulator
- Install android-server-2.0rc1.apk in the emulator and devices
- Forward the port by adb forward tcp:8080 tcp:8080
- Install Python and set the selenium.py seript as this page says: http://seleniumhq.org/docs/appendix_installing_python_driver_client.html
- Run the web driver client in the emulator
- Run the command in Python
from selenium import webdriver
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
2 Answers 2
You need to install the selenium bindings for Python. Try this:
sudo pip install selenium
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