Protractor 在firefox中运行量角器测试时,无法分析新会话响应

Protractor 在firefox中运行量角器测试时,无法分析新会话响应,protractor,Protractor,量角器版本:5.1.1,Firefox版本:47,webdriver版本:v0.15.0 尝试在Firefox中运行量角器测试时,出现以下错误: [15:13:47] I/launcher - Running 1 instances of WebDriver [15:13:47] I/direct - Using FirefoxDriver directly... [15:13:53] E/launcher - Unable to parse new session response: {"va

量角器版本:5.1.1,Firefox版本:47,webdriver版本:v0.15.0 尝试在Firefox中运行量角器测试时,出现以下错误:

[15:13:47] I/launcher - Running 1 instances of WebDriver
[15:13:47] I/direct - Using FirefoxDriver directly...
[15:13:53] E/launcher - Unable to parse new session response: {"value": {"sessionId":"e8dc5d2f-a3bd-45db-89c1-a023e31e08e6","value":{"XULappId":"{ec80
30f7-c20a-464f-9b0e-13a3a9e97384}","acceptSslCerts":false,"appBuildId":"20160604131506","browserName":"Firefox","browserVersion":"47.0","command_id":1
,"count":1,"device":"desktop","platform":"WINDOWS_NT","platformName":"Windows_NT","platformVersion":"6.3","proxy":{},"raisesAccessibilityExceptions":f
alse,"rotatable":false,"specificationLevel":0,"takesElementScreenshot":true,"takesScreenshot":true,"version":"47.0"}}}
[15:13:53] E/launcher - WebDriverError: Unable to parse new session response: {"value": {"sessionId":"e8dc5d2f-a3bd-45db-89c1-a023e31e08e6","value":{"
XULappId":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","acceptSslCerts":false,"appBuildId":"20160604131506","browserName":"Firefox","browserVersion":"47.0
","command_id":1,"count":1,"device":"desktop","platform":"WINDOWS_NT","platformName":"Windows_NT","platformVersion":"6.3","proxy":{},"raisesAccessibil
ityExceptions":false,"rotatable":false,"specificationLevel":0,"takesElementScreenshot":true,"takesScreenshot":true,"version":"47.0"}}}
    at WebDriverError (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\selenium-webdriver\lib\error.js:27:5)
    at doSend.then.response (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\selenium-webdriver\lib\http.js:445:19)
    at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: WebDriver.createSession()
    at Function.createSession (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\selenium-webdriver\lib\webdriver.js:777:24)
    at Function.createSession (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\selenium-webdriver\firefox\index.js:640:55)
    at Direct.getNewDriver (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\protractor\lib\driverProviders\direct.ts:112:25)

    at Runner.createBrowser (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\protractor\lib\runner.ts:225:39)
    at q.then.then (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\protractor\lib\runner.ts:391:27)
    at _fulfilled (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\q\q.js:834:54)
    at self.promiseDispatch.done (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\q\q.js:863:30)
    at Promise.promise.promiseDispatch (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\q\q.js:796:13)
    at C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\q\q.js:556:49
    at runSingle (C:\DG_Selenium\analytics-qa\TestAutomation\SeleniumFramework\node_modules\q\q.js:137:13)
[15:13:53] E/launcher - Process exited with error code 199
配置文件:

    capabilities : {
        'browserName' : 'firefox',
     },
   directConnect : true,
已尝试运行以下命令:

java -jar "C:\Users\testuser\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager\selenium\s
elenium-server-standalone-3.3.1.jar" -Dwebdriver.firefox.bin="c:\Program Files\Mozilla Firefox\firefox.exe"
Exception in thread "main" com.beust.jcommander.ParameterException: Unknown option: -Dwebdriver.firefox.bin=c:\Program Files\Mozilla Firefox\firefox.e
xe
        at com.beust.jcommander.JCommander.parseValues(JCommander.java:742)
        at com.beust.jcommander.JCommander.parse(JCommander.java:282)
        at com.beust.jcommander.JCommander.parse(JCommander.java:265)
        at com.beust.jcommander.JCommander.<init>(JCommander.java:210)
        at org.openqa.grid.selenium.GridLauncherV3$1.setConfiguration(GridLauncherV3.java:227)
        at org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.java:155)
        at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:75)
java-jar“C:\Users\testuser\AppData\Roaming\npm\node\u modules\dragrator\node\u modules\webdriver manager\selenium\s
elenium-server-standalone-3.3.1.jar“-Dwebdriver.firefox.bin=“c:\Program Files\Mozilla firefox\firefox.exe”
线程“main”com.beust.jcommander.ParameterException中出现异常:未知选项:-Dwebdriver.firefox.bin=c:\Program Files\Mozilla firefox\firefox.e
氙
位于com.beust.jcommander.jcommander.parseValues(jcommander.java:742)
位于com.beust.jcommander.jcommander.parse(jcommander.java:282)
位于com.beust.jcommander.jcommander.parse(jcommander.java:265)
在com.beust.jcommander.jcommander上(jcommander.java:210)
位于org.openqa.grid.selenium.GridLauncherV3$1.setConfiguration(GridLauncherV3.java:227)
位于org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.java:155)
位于org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:75)

directConnect
不适用于Firefox 52+和Digrator 5.1.1。()您是否尝试使用独立版本的
webdriver manager
来消除
directConnect
问题

如何使用webdriver管理器:

  • npm安装webdriver管理器-g
  • webdriver管理器更新
  • webdriver管理器启动
它将在
localhost:4444/wd/hub
上启动服务器。使用
seleniumAddress:'将其添加到您的配置中http://localhost:4444/wd/hub“


您还使用了旧版本的Firefox(47)和新的webdriver版本。我不知道这是否会引起问题。你真的需要47,还是可以升级?如果是这样,请注意51是“稳定的”,52可能会带来一些麻烦。

您好,即使我也面临同样的问题。你找到解决办法了吗?可能是因为这个-谢谢这解决了我的问题。我将firefox更新为51,并运行了独立版本的
webdriver manager
“directConnect有一些问题”“-您能更具体一点吗?链接到某个问题可能?但这是“如果是,请注意51是“稳定的”,52可能会带来一些麻烦。”-您是否碰巧也有这方面的链接?:)我只是不喜欢对“麻烦”的无法证实的提及。有些东西要么坏了要么不坏!