虽然 Selenium 的网站上说到可以通过使用 auto=true 参数来自动执行脚本,并同事记录测试结果,可是试了很多次都是不行。今天专门翻了一天的资料,终于弄明白了 Selenium 中的 postReuslts 是怎么一回事。原文如下:

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



相关文章:

  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2021-12-29
  • 2021-06-04
  • 2021-12-04
猜你喜欢
  • 2021-09-21
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2021-05-01
  • 2021-05-21
相关资源
相似解决方案