如何在 Chrome webdriver 上设置 devtools 工具箱的高度?

How to set the height for devtools toolbox on Chrome webdriver?

我正在使用以下功能开始会话:

  "capabilities": {
    "alwaysMatch": {
      "browserName": "chrome",
      "browserVersion": "78.0",
      "platformName": "any",
      "goog:chromeOptions": {
        "prefs": {
          "devtools.preferences.currentDockState": "\"bottom\""
        },
        "args": [
          "auto-open-devtools-for-tabs"
        ]
      }
    }
  }

如何最小化工具箱? (设置高度=0)

例如在 Firefox 上我定义了选项:

 'moz:firefoxOptions': {'prefs': {'devtools.toolbox.footer.height': 0}}

有没有办法在 Chrome 上做同样的事情?

{"devtools.preferences": {"InspectorView.splitViewState": "{\"horizontal\":{\"size\":0.1}}"}} - 成功了。

所有 chrome 首选项都可以在 chrome://prefs-internals/ (应在 chrome 浏览器中给出)。 我们可以将 currentDockState 设置为 'undocked' 而 dev-tools 将不会成为 chrome 浏览器 window.

的一部分

对于任何想要在 yaml 文件中使用这些首选项的人,最好使用 tool 将 json 转换为 yaml 文件。这样就可以很容易地以 yaml 格式传递首选项。