Another milestone on the road to Zen with Ingeniweb components
Latest version : 1.22

PloneSelenium

> A Plone product for web-based functional tests <

About PloneSelenium

A Plone product for web-based functional tests

PloneSelenium has been designed by the INGENIWEB team.

Screenshots

Here come a few screenshots of the PloneSelenium administration interface.

doc/selenium_configlet.png

Plone Configlet showing Selenium

doc/selenium_functional_tests.png

Selenium Functional Tests

doc/selenium_plone_workflow_functional_tests.png

Plone Workflow Functional Tests

doc/selenium_testrunner.png

Selenium Test Runner for the Plone Workflow Tests

Readme

Plone Selenium

PloneSelenium is a Plone Product allowing developers to create TTW Selenium test suites with a single Python Script, in order to do browser-based functional testing of their site. Once you have developped the tests with PloneSelenium, you can run them in batch mode in Zelenium. Functional tests are exported from PloneSelenium to Zelenium, so you can profit from the Zelenium features. Check out the Zelenium home page and documentation as well. It is also worth checking out the Selenium home page.

Dependencies

Depends on Zelenium:

http://www.zope.org/Members/tseaver/Zelenium

Currently you _must_ use the SVN version of Zelenium:

Have a look at the ZopeSVNFAQ::

    http://www.zope.org/DevHome/Subversion/ZopeSVNFAQ

Then fetch Zelenium from here::

    svn://svn.zope.org/repos/main/Zelenium/trunk

If you want to use the CVS version of PloneSelenium, check it out from CVS:

export CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ingeniweb
cvs login
cvs -z3 -q co -d PloneSelenium PloneSelenium

Known Limitations

You have to be logged out before starting the tests. Typically, when you log in through the ZMI as a Manager, the Browser will continue to send your credentials even if you try to log out.

Documentation

Read docs/ploneselenium_paper.html

Credits

Most of the work was already done by Jason Huggins of ThoughtWorks, Inc., who implemented Selenium and the first version of Selenium for Plone.

http://selenium.thoughtworks.com/

The Selenium for Plone license is Apache License. The Selenium license if LGPL.

PloneSelenium uses the selenium skin prepared by Zope Corporation for their Zelenium product.

http://www.zope.org/Members/tseaver/Zelenium/

Author

Maik Röder, Ingeniweb maik.roeder@ingeniweb.com

License

Version

$Id: README.txt,v 1.8 2005/10/18 09:38:54 roeder Exp $

Download

Released versions

Released versions of PloneSelenium are available here. The current version is 1.22.

CVS version

The repository contains the up-to-date versions of our source code. In order to get the HEAD branch of PloneSelenium, use :

cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ingeniweb co PloneSelenium
          

You can also browse the CVS with your browser.

Documentation

Readme

Please take time the read the Readme

F.A.Q

From where can I run the functional tests?
Go to the Plone Configlet and follow the link "Plone Selenium Test Runner"
How can I create my own functional tests?
You can take the Python Script PloneSelenium/skins/PloneSelenium/get_plone_workflow_ftests.py as an example. Just copy this script to your own skin and rename it. Then modify the script according to your needs. Next, you'll have to register the script in the Plone Selenium tool at MyPlone/portal_selenium/manage_editActionsForm
Why do I have to write a Python Script? Can't I just write test tables?
Currently the only way to write tests is to use Python Scripts. The target audience for PloneSelenium is Python Programmers, and writing HTML tables is not flexible enough for a Python programmer, who would end up creating test tables through Python anyway.
During my functional tests, logging in with another user does not work.
Make sure that you didn't log in into Zope using a Management account. Open a new browser and log in using Plone through the login portlet. Logout in Plone does not work if you login using Zope, because the browser insists on sending the login information. By default you can only login with the test users from localhost. For security reasons you can not currently run test from another machine. A simple solution is to remove the domains for the test users in MyPlone/acl_users/Users/acl_users/manage_users
Can someone who knows the login of a test user break into my site?
There is some level of security built-in to PloneSelenium. By default you'd have to be logged in to localhost to log in as another user. There are ways to circumvent this security measure, but they are quite hard to accomplish. Still, it is recommended to only use PloneSelenium on development systems. By default you can only connect on localhost.

How can I select an item of a specific value in a checkbox, given that the name of each item is the same?

<input type="checkbox" value="document1" name="id" /> <input type="checkbox" value="document2" name="id" /> <input type="checkbox" value="document3" name="id" />

To select the one which you require, you can either add different 'id' attributes to each field or use XPath. e.g.

suite.click("//input[@value='document1']")

How can I select an item of a specific name in a checkbox, given that the value of each item is the same?

<input type="checkbox" value="document1" name="copy:list" /> <input type="checkbox" value="document1" name="cut:list" /> <input type="checkbox" value="document1" name="delete:list" />

To select the one which you require, you can either add different 'id' attributes to each field or use XPath. e.g.

The following is correct XPath, but does not seem to work in all browsers:

suite.click("//input[@name='copy:list' and @value='document1'])

If you really have to use such expressions, and don't need to support IE, run your tests in Firefox, which seems to have better support for XPATH than IE.

How can I make sure that a checkbox is in a defined state before toggling it with a click?

This is not possible right now. Selenium will get a new verb that will allow you to do this in the future.

Links

History

PloneSelenium changes

TODO

  • Add documentation in Interpreter.py

CVS

  • Updated API in Interpreter.py
  • Added docs for new svn repository for Zelenium (MR)
  • Refactoring (MR)
  • Fix bug in Zelenium Export (MR)

1.2 - 2005-10-05

  • Disjointed scripts names from action title and id
  • Making it possible to start tests as anonymous when the test users were not yet created using a manager user.

1.1 - 2005-07-29

  • Dropping dependency on Selenium package.
  • Moving Dispatcher.py and Interpreter from Selenium to PloneSelenium.
  • Integrated selenium skin from Zelenium 0.6

1.0 - 2005-05-13

  • Use Plone Site as Base
  • Creation of test users and groups
  • Use domain localhost for all test users

PloneSelenium ChangeLog is also available for detailed informations.

Contact