I wanted to be able to test an application without cookies enabled without having to maintain firefox profiles. I found out that firefox accepts a minimal profile, containing only prefs.js, which only contains the setting user_pref(\"network.cookie.cookieBehavior\", 2);
. So I came up with a small script to start the selenium server. This still is not ideal because test preconditions should not be in server start, but a script at least reduces the effort to maintain one or more complete firefox profiles. It runs with firefox 3.6 / linux and probably with older firefox versions too.
Still the plugin you need is not integrated. I don't know at all which steps would be neccessary to "install" and configure a plugin using a script, but maybe there is a chance initializing extensions.ini
and the extensions/
directory and probably something more.
The script assumes there is a "lib" directory in the current directory which contains selenium-server.jar.
#!/bin/sh
set -x
# create firefox profile, cookies disabled
d=`mktemp -d -t ffp.XXXXX`
trap "rm -rf \"$d\"; exit" 0 1 2 3 15
echo "user_pref(\"network.cookie.cookieBehavior\", 2);" > "$d/prefs.js"
java -jar lib/selenium-server.jar -firefoxProfileTemplate "$d"