gpt4 book ai didi

selenium - 无法将 Firefox v52.0 与 Protractor 一起使用

转载 作者:行者123 更新时间:2023-12-04 08:47:45 24 4
gpt4 key购买 nike

我目前在使用 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

不知道从这里去哪里!

版本
  • 角度:2.4.6
  • Protractor :5.1.1
  • Selenium 独立服务器:3.3.1
  • 壁虎驱动程序:0.15.0
  • 火狐浏览器:52.0
  • 最佳答案

    Permission denied to access property "invoke"known issue在 Zone.js 中,特定于 Zone.js 和使用 WebDriver 运行的 Firefox。它在 0.8.7 版本中得到修复。问题涉及 Zone.js 如何修补浏览器,唯一的解决方法是升级。
    Unable to parse new session response也是known issue使用 Firefox 52 和 directConnect: true .不幸的是,唯一的解决方案是使用 Selenium Standalone。

    关于selenium - 无法将 Firefox v52.0 与 Protractor 一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42760973/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com