硒测试中铬与铬浏览器的比较

时间:2019-02-14 05:25:37

标签: selenium-webdriver protractor debian selenium-chromedriver

我试图在Docker中运行一些Selenium测试。我从ubuntu:bionic移到bitnami:jessie,发现chromium-browser中有bionic,而chromium中有jessie

这两个软件包之间有什么区别?如果我安装了chromium,则在运行量角器测试时出现以下错误。

[05:03:38] E/launcher - unknown error: Devtools port number file contents <45289> were in an unexpected format
  (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.9.125-linuxkit x86_64)
[05:03:38] E/launcher - WebDriverError: unknown error: Devtools port number file contents <45289> were in an unexpected format
  (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.9.125-linuxkit x86_64)
    at Object.checkLegacyResponse (/root/testing/node_modules/selenium-webdriver/lib/error.js:546:15)
    at parseHttpResponse (/root/testing/node_modules/selenium-webdriver/lib/http.js:509:13)                                                                                                                    
    at doSend.then.response (/root/testing/node_modules/selenium-webdriver/lib/http.js:441:30)                                                                                                                  
    at <anonymous>                                                                                                                                                                                              
    at process._tickCallback (internal/process/next_tick.js:189:7)                                                                                                                                              
From: Task: WebDriver.createSession()               
    at Function.createSession (/root/testing/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
    at Function.createSession (/root/testing/node_modules/selenium-webdriver/chrome.js:761:15)
    at Direct.getNewDriver (/root/testing/node_modules/protractor/built/driverProviders/direct.js:77:33)
    at Runner.createBrowser (/root/testing/node_modules/protractor/built/runner.js:195:43)
    at q.then.then (/root/testing/node_modules/protractor/built/runner.js:339:29)   

1 个答案:

答案 0 :(得分:0)

什么是铬版本?

在这里您会看到类似的问题:Chromedriver Devtools port number error

现在您正在使用chromedriver 2.46.628388。它支持Chrome v71-v73(http://chromedriver.chromium.org/downloads

如果您的chromedriver比较老:

a)更新它,或

b)降级chromedriver