Selenium 中如何自动记录测试结果

虽然 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



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值