Webdriver-manager错误:无法使用* my config *创建会话

时间:2019-06-19 13:28:00

标签: selenium selenium-webdriver protractor

更新webdriver-manager后遇到以下问题:

  

E /启动程序-SessionNotCreatedError:无法从

创建会话

我的配置打印在这里

webdriver-manager版本:12.1.5
节点版本:10.15.3
量角器版本:5.4.2
浏览器:Chrome
操作系统和版本:Win 7 / Ubuntu

这是我使用了1.5年的配置文件:

exports.config = {
    "seleniumAddress": "http://localhost:4444/wd/hub",
    "seleniumPort": "4444",
    "capabilities": {
        "browserName": "chrome",
        "unexpectedAlertBehaviour": "accept",
        "perform": "ANY",
        "version": "ANY",
        "chromeOptions": {
            "perfLoggingPrefs": {
               "traceCategories": "blink.console,devtools.timeline,disabled-by-default-devtools.timeline,toplevel,disabled-by-default-devtools.timeline.frame,benchmark"
           },
            "prefs": {
                "credentials_enable_service": false
            },
            "args": ["--headless", "--window-size=800,1080", "--disable-blink-features=BlockCredentialedSubresources", "--no-sandbox", "--test-type=browser", "--disable-dev-shm-usage", "--enable-gpu-benchmarking", "--enable-thread-composting" , "--start-maximized"]
        },
        "loggingPrefs": { "performance": "ALL" }
    },
    "jasmineNodeOpts": {
        "showColors": true,
        "defaultTimeoutInterval": 9999999
    },
    "allScriptsTimeout": 200000,
    "params": {
        "perf": {
            "selenium": { "protocol": "http:", "slashes": true, "auth": null, "host": "localhost:4444", "port": 4444, "hostname": "localhost", "hash": null, "search": null, "query": null, "pathname": "/wd/hub", "path": "/wd/hub", "href": "http://localhost:4444/wd/hub" },
            "browsers": [{
                "browserName": "chrome", 
                "chromeOptions": { 
                    "perfLoggingPrefs": { 
                        "traceCategories": "blink.console,devtools.timeline,disabled-by-default-devtools.timeline,toplevel,disabled-by-default-devtools.timeline.frame,benchmark" 
                        },
                    "args": ["--headless", "--disable-gpu", "--disable-blink-features=BlockCredentialedSubresources", "--no-sandbox", "--test-type=browser", "--disable-dev-shm-usage"]         
                },
                "loggingPrefs": { "performance": "ALL" }
            }],
            "debugBrowser": false, 
            "actions": ["scroll"],
            "metrics": ["TimelineMetrics", "ChromeTracingMetrics", "RafRenderingStats", "NetworkTimings", "NetworkResources"],
            "metricOptions": {}
        },
        "warmup": false,
        "agilar" : false
    }
}

我知道该文件是一团糟,或多或少都用谷歌搜索,但是可以用。您能指出导致此问题的原因吗?

1 个答案:

答案 0 :(得分:0)

硒服务器是否已在默认地址启动并运行  “ http://localhost:4444/wd/hub”。如果不是,请通过运行以下命令启动它:webdriver-manager start。假设您已经安装了webdriver-manager。

我也不认为当配置中已经提供了硒地址属性时,您不需要定义seleniumPort。因此,请从配置中删除此属性“ seleniumPort”:“ 4444”。