1

i'm trying to set a devtool preference for the chrome webdriver in .net, with the following code (Selenium)

ChromeOptions opts = new ChromeOptions();
opts.AddUserProfilePreference("devtools.preferences.Inspector.drawerSplitViewState", "{\"horizontal\":{\"size\":378,\"showMode\":\"OnlyMain\"}}");

Uri HubUri = new Uri(ConfigBrowser.HubUrl + "/wd/hub");
IWebDriver chrome = new RemoteWebDriver(HubUri, opts.ToCapabilities(), Timeout);

but it does not get it, since the "Inspector.drawerSplitView" should remain as a property, but the AddUserProfilePreference is making a child json from it because of a dot. like

"devtools": {
    "preferences": {
      "Inspector": {
        "drawerSplitViewState": "{\"horizontal\":{\"size\":363,\"showMode\":\"Both\"}}"
      }
    }
  }

but actually it should be:

"devtools": {
    "preferences": {
      "Inspector.drawerSplitViewState": "{\"horizontal\":{\"size\":363,\"showMode\":\"Both\"}}",
    }
  }

is there a way to overcome this?

0 Answers0