1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
:mod:`webtest.sel` -- Functional Testing with Selenium
========================================================
.. automodule:: webtest.sel
Environment variables
---------------------
Those value are used if found in environment:
- ``SELENIUM_HOST``: Default to ``127.0.0.1``
- ``SELENIUM_PORT``: Default to ``4444``
- ``SELENIUM_BIND``: IP used to bind extra servers (WSGI Server/File server).
Default to ``127.0.0.1``
- ``SELENIUM_DRIVER``: The driver used to start the browser. Usualy something
in ``*chrome``, ``*firefox``, ``*googlechrome``. Default to
``*googlechrome``. You can get the full list by running::
$ java -jar selenium-server.jar -interactive
cmd=getNewBrowserSession
- ``SELENIUM_KEEP_OPEN``: If exist then browser session are not closed so you
can introspect the problem on failure.
- ``SELENIUM_JAR``: If selenium is not running then this jar is used to run
selenium.
Module Contents
---------------
.. autoclass:: SeleniumApp
:members:
.. autoclass:: Selenium
:members:
.. autofunction:: selenium
Return Values
~~~~~~~~~~~~~
Some of the return values return instances of these classes:
.. autoclass:: TestResponse
:members:
.. autoclass:: Document
:members:
.. autoclass:: Element
:members:
.. autoclass:: Form
:members:
Examples
--------
Testing a wsgi application
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. literalinclude:: ../../tests/test_selenium.py
:pyobject: TestApp
Testing the jquery.ui website
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. literalinclude:: ../../tests/test_selenium.py
:pyobject: TestJQueryUI
|