【问题标题】:Error using geckoddriver : Found argument '--websocket-port' which wasn't expected使用 geckoddriver 时出错:发现意外的参数“--websocket-port”
【发布时间】:2021-12-21 03:07:39
【问题描述】:

我有一个使用 bonigarcia 自动下载 webdriver 项目的 selenium 项目。我上周更新了 selenium 的最后一个版本(4.0.0,maven repo),以及 bonigarcia 项目的最后一个版本(5.0.3)。现在,当我尝试在 Firefox 上启动测试时,我遇到了这个错误:

Found argument '--websocket-port' which wasn't expected, or isn't valid in this context

USAGE:
    geckodriver --port <PORT>

For more information try --help

我没有找到关于这个错误的信息,所以如果有人能解决这个问题,那就太好了。我只看到使用的 geckodriver 是 0.29.0,但如果是 0.30.0,则为最后一个

【问题讨论】:

  • 请升级你的 geckodriver 并尝试

标签: java selenium firefox geckodriver


【解决方案1】:

Geckodriver 0.30.0版本增加了--websocket-port参数,所以必须使用这个版本来避免错误:

geckodriver 0.30.0 (d372710b98a6 2021-09-16 10:29 +0300)
WebDriver implementation for Firefox


USAGE:
    geckodriver [FLAGS] [OPTIONS]

FLAGS:
        --connect-existing    Connect to an existing Firefox instance
    -h, --help                Prints this message
        --jsdebugger          Attach browser toolbox debugger for Firefox
    -v                        Log level verbosity (-v for debug and -vv for trace level)
    -V, --version             Prints version and copying information

OPTIONS:
    -b, --binary <BINARY>           Path to the Firefox binary
        --log <LEVEL>               Set Gecko log level [possible values: fatal, error, warn, info, config, debug, trace]
        --marionette-host <HOST>    Host to use to connect to Gecko [default: 127.0.0.1]
        --marionette-port <PORT>    Port to use to connect to Gecko [default: system-allocated port]
        --host <HOST>               Host IP to use for WebDriver server [default: 127.0.0.1]
    -p, --port <PORT>               Port to use for WebDriver server [default: 4444]
        --websocket-port <PORT>     Port to use to connect to WebDriver BiDi [default: 9222]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-24
    • 1970-01-01
    • 2017-04-30
    • 1970-01-01
    • 2021-09-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多