[TIP] What strategies to you use to factor seleniums tests to avoid duplications of the same or similar test steps?

Benji York benji at benjiyork.com
Thu Feb 14 06:09:34 PST 2008


Fred Drake wrote:
> On Feb 13, 2008 8:13 PM, Bob Clancy <bob.clancy at verizon.net> wrote:
>> exercises, and rereading the slide-show, it doesn't look like it will be
>> easy to avoid "duplicated test logic" in Selenium. This makes me want to use
>> another framework where I can structure action words to do higher level
>> actions needed in testing.
> 
> For Zope 3 applications, there's a zc.selenium package on svn.zope.org
> that provides an interesting approach.

Here's the doctest for the part of zc.selenium that's not 
Zope-specific:http://svn.zope.org/*checkout*/zc.selenium/trunk/src/zc/selenium/pytest.txt

For ZODB-based apps we use another trick in Selenium tests: during test 
runs we expose a two URLs that the tests can call.  These URLs trigger a 
database checkpoint to be established.  This lets us checkpoint a 
database, make changes to it, then revert those changes later.  That 
helps a lot when you want to do several tests with the same setup, but 
don't want to repeat the set-up or write a tear-down.
-- 
Benji York
http://benjiyork.com



More information about the testing-in-python mailing list