import selenium

55 views
Skip to first unread message

xina towner

unread,
Feb 22, 2012, 6:04:13 AM2/22/12
to django...@googlegroups.com
Hello, I've problems importing selenium module, I try this:

from selenium import webdriver

and it says it can resolve. I've installed selenium using pip install selenium.

What am I missing?

--
Thanks,

Rubén

Sébastien Billion

unread,
Feb 22, 2012, 6:49:40 AM2/22/12
to django...@googlegroups.com
Hi,

Maybe you missed to add selenium in INSTALLED_APP in settings.py ...

2012/2/22 xina towner <xinat...@gmail.com>


--
Thanks,

Rubén

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Tom Evans

unread,
Feb 22, 2012, 6:59:34 AM2/22/12
to django...@googlegroups.com
On Wed, Feb 22, 2012 at 11:49 AM, Sébastien Billion
<sebastie...@gmail.com> wrote:
> Hi,
>
> Maybe you missed to add selenium in INSTALLED_APP in settings.py ...
>

selenium is not a django app, it is a python library:

http://pypi.python.org/pypi/selenium

Only django apps need to go in INSTALLED_APPS. Please don't blindly
recommend people to put stuff into INSTALLED_APPS unless you know what
it is for.

OP: It works for me (see log below). Try reinstalling?

Cheers

Tom

tom@voncount '11:57:01' '~/tmp/selenium'
> $ virtualenv environ
New python executable in environ/bin/python2.7
Also creating executable in environ/bin/python
Installing setuptools............done.
Installing pip...............done.
tom@voncount '11:57:08' '~/tmp/selenium'
> $ . ./environ/bin/activate
(environ)tom@voncount '11:57:14' '~/tom/tmp/selenium'
> $ pip install selenium
Downloading/unpacking selenium
Downloading selenium-2.19.1.tar.gz (4.0Mb): 4.0Mb downloaded
Running setup.py egg_info for package selenium
/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning:
Unknown distribution option: 'src_root'
warnings.warn(msg)

warning: no files found matching 'docs/api/py/index.rst'
Installing collected packages: selenium
Running setup.py install for selenium
/usr/local/lib/python2.7/distutils/dist.py:267: UserWarning:
Unknown distribution option: 'src_root'
warnings.warn(msg)

warning: no files found matching 'docs/api/py/index.rst'
Successfully installed selenium
Cleaning up...
(environ)tom@voncount '11:57:33' '~/tmp/selenium'
> $ python
Python 2.7.1 (r271:86832, Dec 13 2010, 15:52:15)
[GCC 4.2.1 20070719 [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.
>>> import selenium
>>> selenium.__version__
'2.19.0'
>>>

Sébastien Billion

unread,
Feb 22, 2012, 7:04:23 AM2/22/12
to django...@googlegroups.com
Sorry for that

2012/2/22 Tom Evans <teva...@googlemail.com>
>>>

dizzydoc

unread,
Feb 22, 2012, 11:41:42 PM2/22/12
to Django users
@xina towner

Hi,
I have been working with selenium from quite a lot time.

There are three things you need to build and run functional test cases
using selenium.

Since selenium is a browser based testing environment you need a
server that serves it. So you need:
1. selenium-server-standalone-2.18.0.jar

For python to understand selenium functions you need a selenium
library. So you need:
2. selenium-2.19.1.tar.gz

And last you need someone to write the test cases for you! So you need
and IDE, a browser plugin that helps you build them
3. Selenium IDE

You may download it from here- http://seleniumhq.org/download/

HOW TO SETUP SELENIUM LIB:
Once you have downloaded selenium-2.19.1.tar.gz, extract it and move
to the extracted directory on command line.
Write the following command once you are in the selenium-2.19.1 dir:
$ python setup.py build
$ python setup.py install

If you encounter a setup tool error, you might need to install setup
tools. Read docs for how to do it or simply google :)

And if this doesnt work!! simply open the directory copy selenium py
(location: selenium-2.19.1/py/selenium/selenium.py) and paste it in
your dist-packages. Since selenium.py doesn't come with much
dependencies copying works, although its not ethical.

Hope this helps.

Reply all
Reply to author
Forward
0 new messages