从根本上来说,此修复为我解决了相同的问题:
https://github.com/pschwartau/protractor/commit/1eeff8b1b2e3e8f3b7c8152264411f26d4665a07
如此处最初所述:renanmartins的https://github.com/angular/protractor/issues/85#issuecomment-26846255
内部protractor / lib / protractor.js替换
this.driver.get('about:blank');this.driver.executescript( 'window.name = "' + DEFER_LABEL + '" + window.name;' + 'window.location.href = "' + destination + '"');
与
var driver = this.driver; this.getCapabilities().then(function (capabilities) { if (capabilities.caps_.browserName === 'phantomjs') { driver.executescript('window.name = "' + DEFER_LABEL + '" + window.name;'); driver.get(destination); } else { driver.get('about:blank'); driver.executescript( 'window.name = "' + DEFER_LABEL + '" + window.name;' + 'window.location.href = "' + destination + '"'); } // Make sure the page is an Angular page. driver.executeAsyncscript(clientSidescripts.testForAngular, 10). then(function(hasAngular) { if (!hasAngular) { throw new Error('Angular could not be found on the page ' + destination); } }); });