无法为接口org.openqa.selenium.Capabilities调用no-args构造函数

时间:2019-02-16 03:25:58

标签: java json selenium gson

我无法获得这个Json,似乎代码无法获得这些功能。也许是数组?

我试图获取有关硒打开的浏览器的信息,以供重复使用。

{
  "status": 0,
  "value": [
    {
      "id": "62d5837e-0d4b-4f3a-9655-b7e0d8b5932e",
      "capabilities": {
        "acceptInsecureCerts": false,
        "browserName": "internet explorer",
        "browserVersion": "11",
        "pageLoadStrategy": "normal",
        "platformName": "windows",
        "proxy": {
        },
        "se:ieOptions": {
          "browserAttachTimeout": 0,
          "elementScrollBehavior": 0,
          "enablePersistentHover": true,
          "ie.browserCommandLineSwitches": "",
          "ie.ensureCleanSession": false,
          "ie.fileUploadDialogTimeout": 3000,
          "ie.forceCreateProcessApi": false,
          "ignoreProtectedModeSettings": false,
          "ignoreZoomSetting": false,
          "initialBrowserUrl": "http:\u002f\u002flocalhost:42654\u002f",
          "nativeEvents": true,
          "requireWindowFocus": false
        },
        "setWindowRect": true,
        "timeouts": {
          "implicit": 0,
          "pageLoad": 300000,
          "script": 30000
        }
      }
    }
  ]
}

//调用Sessions.class
infoSessions = gson.fromJson(content,Sessions.class);

public class Sessions {
    private int                                     status;
    private List < ValueSession >   value;

    public Sessions () {
        // Constructor. Do nothing
    }
// getters and setters
}

public class ValueSession {
    private String              id;
    private Capabilities    capabilities;

    public ValueSession () {
        // Constructor. Do nothing
    }
// getters and setters
}

0 个答案:

没有答案