我正在使用phpunit和selenium为我的项目编写一些功能测试。我正在寻找的是检索响应标头的方法
有些 URL 没有.js
扩展名,但返回 javascript 作为代码。
我正在寻找的是用函数content-type
打开的 URL 的标头信息(尤其是 )$this->open();
例如:
//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 文件,但没有找到任何接近它的东西。