Selenium can't actually write to a file directly. In "auto" mode,
Selenium will POST results to a URL, where it expects to find a "results
handler". The default URL is "/postResults". So, you need to implement
a "results handler" (typically a CGI-script, Java servlet, or similar),
and arrange for it to be "mounted" at "http://yourserver/postResults"
(see the Selenium manual for details of what data gets POSTed). Your
handler can record the result data however you wish; writing to a file
is fairly standard.
You can specifiy an alternative handler location by providing a
"resultsUrl" parameter - but beware that, unless you're using HTA, it
needs to be on the same server as Selenium, as posting of results is
subject to the same cross-site scripting restrictions as the rest of
Selenium.
原文出处:http://forums.openqa.org/thread.jspa?threadID=554&tstart=150