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

Bob Clancy bob.clancy at verizon.net
Thu Feb 14 06:24:36 PST 2008


Tarjei, Thank you for pointing out Canoo WebTest.  At first glance, it seems
to have a feature set very much in line with what I'd like.  I'll have to
play around with it a bit.  Thanks again.

Bob Clancy wrote:
> Will it cover abstracting testcases to reduce duplicate code?  ...

Tarjei wrote:
] Hmm, I'm not sure how you define duplicate testcases, ...

I wasn't referring to testcases, but subsets of testcases (such as logging
on and getting to a given screen) that could be factored out into common
code.  Most of the time this would likely be setup and tear-down, but
sometimes it might not be.  Factoring out common operations that are part of
setup and/or teardown is really what I was talking about.

]                                                   ... but an interesting
] approach would be to make a selenium version that only relates to the
] html (for example using Webtest[1]) and that discards the commands it
] cannot support. Thus you could have a version of your tests running in a
] virtual browser that would be a lot faster than a normal browser but
] that could still do most of the things you are interested in.

Automatically not running some class of tests is an intersting concept.  The
idea here seems to be to interpret testcase action words using more than one
execution engine, where the execution engine in a sense defines a
permutation of the testcase.  (Ie:  in your case, skipping the
slow/client-based tests while running in a http/server-only permutation.)
Nice idea!  This could be extended or documented with attributes in the
testcases identifying which testcases work in each permutation.  It would be
nice to see our open source test tools evolve to embrace such ideas.  Thank
you for sharing your comments.

thanks,
--
Bob Clancy  (9 Lives Software Engineering,  Boston, MA, USA)








More information about the testing-in-python mailing list