【发布时间】:2013-11-07 13:50:29
【问题描述】:
我正在使用phpunit 和selenium 为我的项目编写一些功能测试。 我正在寻找的是检索响应头的方式
有些网址没有 .js 扩展名,但返回 javascript 作为代码。
我要找的是用$this->open();函数打开的URL的头部信息(尤其是content-type)
例如:
//if I do
$this->open('http://stackoverflow.com');
// or
$this->open('http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js')
// and then use some function like
$this->getResponseHeaders();
// returns me array of header information or
// some function just for content type
$this->getContentType();
// which return text/html or text/javascript
selenium 是否有任何方式提供此功能或获取详细信息的技巧或技巧。我浏览了 selenium 文档和 TestCase 文件,但没有找到任何接近它的东西。
【问题讨论】: