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?
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?
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.