From 0cf8775d221987c9ae493136a1eb46e056b91550 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 21 Oct 2009 18:00:56 +0000 Subject: [PATCH] Importing NanoBlogger post "Website unittesting with Selenium" --- posts/Website_unittesting_with_Selenium.mdwn | 40 ++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 posts/Website_unittesting_with_Selenium.mdwn diff --git a/posts/Website_unittesting_with_Selenium.mdwn b/posts/Website_unittesting_with_Selenium.mdwn new file mode 100644 index 0000000..6296ecf --- /dev/null +++ b/posts/Website_unittesting_with_Selenium.mdwn @@ -0,0 +1,40 @@ +[[!meta title="Website unittesting with Selenium"]] +[[!meta date="2009-10-21 14:00:56"]] +I just discovered [Selenium](http://seleniumhq.org/), which allows you +to drive browers programmatically. This allows you to test the +effects of javascript on the browser's internal page representation. +Not very useful for the department website, since we don't use much +javascript, but I like its python interface, so I'm replacing my +traditional spider with a Selenium implementation. + +Some bugs I've run into so far: + + * [start() doesn't take any + args](http://jira.openqa.org/browse/SRC-758). Simple fix in + selenium.py. + * [captureNetworkTraffic("xml") returns requestHeaders as + responseHeaders](http://jira.openqa.org/browse/SRC-721). Fixed in + source, but you'll need to compile your selenium-server.jar on your + own. There's a nice, detailed explaination of building Selenium + with [Maven](http://maven.apache.org/) + [here](http://wiki.openqa.org/display/SRC/Developer%27s+Guide), but + for the impatient, a simple `mvn install` in the svn root directory + should do it. + * [captureNetworkTraffic("xml") captures invalid XML in URL's + (ampersand problem)](http://jira.openqa.org/browse/SRC-759). + Another simple patch, but this one's just posted by me, so you'll + have to apply it by hand and recompile. +You get the feeling that people don't use the captureNetworkTraffic +side of Selenium very often ;). Ah well, only 3 open bugs in that +area left to bump into ;). + +To keep the test suite easy to maintain, I build it on the fly using +[nose +generators](http://somethingaboutorange.com/mrl/projects/nose/0.11.1/writing_tests.html#test-generators), +which are awesome :). + +More details to come... + +[[!tag linux]] +[[!tag programming]] +[[!tag fun]] -- 2.26.2