我们正在使用Selenium WebDriver和PhantomJS对我们的单一页面应用程序运行黄瓜测试。我们最近实现了一个appcache清单,现在我们的缓存失败了。在我们的故障排除中,它似乎失败了,因为幻影不支持缓存清单。在浏览phantomjsdriver.log时,我们发现通过协商的能力包括:
"applicationCacheEnabled":false然后,我们尝试设置所需的功能,以便通过以下方式启用它:
var webdriver = require('selenium-webdriver');
var hooks = function() {
this.Before(function(callback) {
var pBrowser = webdriver.Capabilities.phantomjs();
pBrowser.set('applicationCacheEnabled', true);
this.driver = new webdriver.Builder().withCapabilities(pBrowser).build();
});日志文件中所需的vs协商功能表明,它正在尝试设置,但没有成功(而且我们的命令仍然失败)。
SessionManagerReqHand - _postNewSessionCommand - New Session Created: c6f61520-b603-11e3-83b0-2b905be08819
GhostDriver - Main - running on port 63911
CONSTRUCTOR - Desired Capabilities: {"browserName":"phantomjs","applicationCacheEnabled":true}
CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.1","driverName":"ghostdriver","driverVersion":"1.0.3","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}是否有人知道我们的场景是否不受支持,或者我们是否以错误的方式实现它?
发布于 2014-03-31 22:56:14
根据http://bit.ly/1mrRvaV源代码的第47行,GhostDriver不支持所需的和协商的功能。
https://stackoverflow.com/questions/22718643
复制相似问题