Skip to main content

Selenium RC integration with zope.testing

gocept.selenium integrates Selenium RC with your Plone/Zope 2/ZTK test suite.

Quick start with ZTK

Assuming that you already have a package that uses zc.buildout and zope.testing, you need to do this to enable Selenium tests:

  1. Add gocept.selenium to the list of eggs either in your setup.py, or in buildout.cfg

  2. Install Selenium RC by some means, e.g. by using collective.recipe.seleniumrc:

    [seleniumrc]
    recipe = collective.recipe.seleniumrc
    url = http://release.seleniumhq.org/selenium-remote-control/1.0.1/selenium-remote-control-1.0.1-dist.zip
    md5sum = 068b1adb26a7450717e6d6d67e261b58
  3. Run buildout to install gocept.selenium and selenium (the Python bindings for Selenium RC).

  4. Create a layer for your tests, like this:

    import gocept.selenium.ztk
    import zope.app.testing.functional
    zcml_layer = zope.app.testing.functional.ZCMLLayer(
        'ftesting.zcml',
        __name__, __name__, allow_teardown=True)
    selenium_layer = gocept.selenium.ztk.Layer(zcml_layer)

Essentially, the zcml_layer is what you would use for typical ZTK functional tests, and then you wrap it to create selenium_layer.

  1. Start writing tests that inherit gocept.selenium.ztk.TestCase; make sure you set the layer attribute to selenium_layer on each test class.

  2. In your tests, use self.selenium to control Selenium RC, e.g.

    class MyTest(gocept.selenium.ztk.TestCase):
    
        layer = selenium_layer
    
        def test(self):
            self.selenium.open('http://%s/foo.html' % self.selenium.server)
            self.selenium.assertBodyText('foo')
  3. Run seleniumrc.

  4. Run bin/test and see it work!

Quick start with Zope 2/Plone

Essentially the same, only use gocept.selenium.zope2 or gocept.selenium.plone instead of gocept.selenium.ztk.

Similar packages

zc.selenium – integrates Selenium Core with zope.testing.

Development

Report bugs at <https://intra.gocept.com/projects/projects/gocept-selenium/issues>.

Get the latest source with

svn co http://svn.gocept.com/repos/gocept/gocept.selenium/trunk gocept.selenium

Changes

0.4.2 (2010-05-20)

  • API expansion: *keyDown, *keyUp, keyPress.

0.4.1 (2010-04-01)

  • API expansion: added getSelectedLabel.

  • Ignore the code of a server’s response when calling open. The default behaviour of SeleniumRC changed between 1.0.1 and 1.0.2 but we want the old behaviour by default.

0.4 (2010-03-30)

  • API expansion: add getLocation to retrieve currently loaded URL in browser.

  • API expansion: added waitForPopUp, selectPopUp, deselectPopUp and close.

  • API expansion: added verifyAlertPresent, verifyAlertNotPresent and waitForAlertPresent.

  • Usability: raise a better readable exception when an unimplemented selenese method is called.

  • Usability: raise failure exceptions that convey the name of the failed assertion in spite of some lambdas wrapped around it.

0.3 (2010-01-12)

  • Extracted ‘host’ and ‘port’ as class attributes of gocept.selenium.ztk.Layer so subclasses can override them; stopped hardcoding 8087 as the server port.

0.2.1 (2009-12-18)

  • Fix incomplete sdist release on PyPI.

0.2 (2009-12-18)

  • Make Zope 2 test server reachable from the outside.

  • Implemented getTitle/assertTitle/waitForTitle/etc.

0.1 (2009-11-08)

  • first release

Metadata

Release files for gocept.selenium 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gocept.selenium 0.4.2
File Size Uploaded Provenance Actions
gocept.selenium-0.4.2.tar.gz 16.1 kB Without provenance Details for gocept.selenium-0.4.2.tar.gz

Release files / gocept.selenium-0.4.2.tar.gz

Download URL gocept.selenium-0.4.2.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1266b774a2e6d8dbf28e10c5c3a1d3cf0bde4315d389b09fa3f6009475ab9225
BLAKE2b-256 checksum
How to use checksums
b9ee9f366fc03b56104c590a2273b7a954c3fce76e9349990d0905b0ada6ed74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for gocept.selenium 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page