无法将Firefox v52.0与Protractor

时间:2017-03-13 10:07:02

标签: selenium firefox protractor

使用GeckoDriver时,我正在尝试在Angular2网站上运行Protractor测试时遇到问题。

我正在使用Selenium Standalone Server运行我的测试,它们可以在Chrome和IE11中运行,但是当我尝试使用Firefox运行时,我收到以下错误:

Failed: Error while running testForAngular: Error: Permission denied to access property "invoke"
  Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800'
  System info: host: 'MyPC', ip: '128.87.191.161', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
  Driver info: org.openqa.selenium.firefox.FirefoxDriver
  Capabilities [{moz:profile=C:\Users\Me\AppData\Local\Temp\rust_mozprofile.UbDrIDtk4eEX, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=52.0, platformVersion=6.1, moz:processID=12820, browserName=firefox, platformName=windows_nt}]
  Session ID: 6ddf7356-5306-4db6-b6c2-2898406c3193
  Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800'
  System info: host: 'MyPC', ip: '128.87.191.161', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
  Driver info: org.openqa.selenium.firefox.FirefoxDriver
  Capabilities [{moz:profile=C:\Users\Me\AppData\Local\Temp\rust_mozprofile.UbDrIDtk4eEX, rotatable=false, timeouts={implicit=0, page load=300000, script=30000}, pageLoadStrategy=normal, platform=ANY, specificationLevel=0, moz:accessibilityChecks=false, acceptInsecureCerts=false, browserVersion=52.0, platformVersion=6.1, moz:processID=12820, browserName=firefox, platformName=windows_nt}]
  Session ID: 6ddf7356-5306-4db6-b6c2-2898406c3193
      at AbstractExtendedWebDriver.get.timeout.driver.controlFlow.execute.then.then.then.then.then.then.executeAsyncScript_.then (c:\Projects\Project\ProtractorTests\node_modules\protractor\lib\browser.ts:944:27)
      at ManagedPromise.invokeCallback_ (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\promise.js:1366:14)
      at TaskQueue.execute_ (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\promise.js:2970:14)
      at TaskQueue.executeNext_ (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\promise.js:2953:27)
      at events.EventEmitter.events.EventEmitter.events.EventEmitter.scheduleCallbacks.asyncRun (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\promise.js:2813:27)
      at c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\promise.js:676:7
      at process._tickCallback (internal/process/next_tick.js:103:7)
  From: Task: Run beforeEach in control flow
  From asynchronous test: 
  Error
      at Suite.<anonymous> (C:\Projects\Project\ProtractorTests\specs\login-spec.ts:10:5)
      at Object.<anonymous> (C:\Projects\Project\ProtractorTests\specs\login-spec.ts:8:1)
      at Module._compile (module.js:571:32)
      at Object.Module._extensions..js (module.js:580:10)
      at Module.load (module.js:488:32)
      at tryModuleLoad (module.js:447:12)
      at Function.Module._load (module.js:439:3)
      at Module.require (module.js:498:17)
      at require (internal/module.js:20:19)
      at Array.forEach (native)

如果我尝试使用directConnet运行Firefox测试,我会收到另一个错误:

[09:37:35] E/launcher - Unable to parse new session response: {"value": {"sessionId":"b00ee8b7-434e-48e6-83a6-3bca08caba31","value":{"acceptInsecureCerts":false,"browserName":"firefox","browserVersion":"52.0","moz:accessibilityChecks":false,"moz:processID":15632,"moz:profile":"C:\\Users\\Me\\AppData\\Local\\Temp\\rust_mozprofile.XS9ezQUYQ7um","pageLoadStrategy":"normal","platformName":"windows_nt","platformVersion":"6.1","rotatable":false,"specificationLevel":0,"timeouts":{"implicit":0,"page load":300000,"script":30000}}}}
[09:37:35] E/launcher - WebDriverError: Unable to parse new session response: {"value": {"sessionId":"b00ee8b7-434e-48e6-83a6-3bca08caba31","value":{"acceptInsecureCerts":false,"browserName":"firefox","browserVersion":"52.0","moz:accessibilityChecks":false,"moz:processID":15632,"moz:profile":"C:\\Users\\Me\\AppData\\Local\\Temp\\rust_mozprofile.XS9ezQUYQ7um","pageLoadStrategy":"normal","platformName":"windows_nt","platformVersion":"6.1","rotatable":false,"specificationLevel":0,"timeouts":{"implicit":0,"page load":300000,"script":30000}}}}
    at __dirname.execute.request.then.doSend.then.response (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\http.js:445:19)
    at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.createSession()
    at Function.createSession (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\lib\webdriver.js:777:24)
    at Function.createSession (c:\Projects\Project\ProtractorTests\node_modules\selenium-webdriver\firefox\index.js:640:55)
    at Direct.getNewDriver (c:\Projects\Project\ProtractorTests\node_modules\protractor\built\driverProviders\direct.js:95:33)
    at Runner.createBrowser (c:\Projects\Project\ProtractorTests\node_modules\protractor\built\runner.js:194:43)
    at events_1.EventEmitter.run.q.then.then (c:\Projects\Project\ProtractorTests\node_modules\protractor\built\runner.js:338:29)
    at _fulfilled (c:\Projects\Project\ProtractorTests\node_modules\q\q.js:834:54)
    at Promise.then.Q.nextTick.self.promiseDispatch.done (c:\Projects\Project\ProtractorTests\node_modules\q\q.js:863:30)
    at Promise.__dirname.Promise.promise.promiseDispatch (c:\Projects\Project\ProtractorTests\node_modules\q\q.js:796:13)
    at c:\Projects\Project\ProtractorTests\node_modules\q\q.js:556:49
    at runSingle (c:\Projects\Project\ProtractorTests\node_modules\q\q.js:137:13)
[09:37:35] E/launcher - Process exited with error code 199

不知道从哪里开始!

版本

  • Angular:2.4.6
  • 量角器:5.1.1
  • Selenium独立服务器:3.3.1
  • GeckoDriver:0.15.0
  • Firefox浏览器:52.0

1 个答案:

答案 0 :(得分:2)

Permission denied to access property "invoke"是Zone.js中的known issue,特定于Zone.js和使用WebDriver运行的Firefox。它在0.8.7版本中得到修复。问题涉及Zone.js如何修补浏览器,唯一的解决方法是升级。

Unable to parse new session response也是known issue,其中包含Firefox 52和directConnect: true。不幸的是,唯一的解决方案是使用Selenium Standalone。