Example usage for org.openqa.selenium WebDriverException WebDriverException

List of usage examples for org.openqa.selenium WebDriverException WebDriverException

Introduction

In this page you can find the example usage for org.openqa.selenium WebDriverException WebDriverException.

Prototype

public WebDriverException(Throwable cause) 

Source Link

Usage

From source file:org.uiautomation.ios.webInspector.DOM.Page.java

License:Apache License

public static JSONObject navigate(String url) {
    try {/*from w w w.j  a va 2  s. c om*/
        JSONObject cmd = new JSONObject();
        cmd.put("method", "Page.navigate");
        cmd.put("params", new JSONObject().put("url", url));
        return cmd;
    } catch (JSONException e) {
        throw new WebDriverException(e);
    }
}

From source file:org.uiautomation.ios.webInspector.DOM.Page.java

License:Apache License

public static JSONObject enablePageEvent() {
    try {//from  ww  w. jav a2  s  . com
        JSONObject cmd = new JSONObject();
        cmd.put("method", "Page.enable");
        return cmd;
    } catch (JSONException e) {
        throw new WebDriverException(e);
    }
}

From source file:org.uiautomation.ios.webInspector.DOM.Page.java

License:Apache License

public static JSONObject getResourceTree() {
    try {/*w w  w.  j av a  2  s.c o  m*/
        JSONObject cmd = new JSONObject();
        cmd.put("method", "Page.getResourceTree");
        return cmd;
    } catch (JSONException e) {
        throw new WebDriverException(e);
    }
}

From source file:org.uiautomation.ios.webInspector.DOM.RemoteObject.java

License:Apache License

public String stringify() {
    try {//from w w w.  j a  v a2  s . c om
        JSONObject cmd = new JSONObject();
        cmd.put("method", "Runtime.callFunctionOn");

        JSONArray args = new JSONArray();

        cmd.put("params",
                new JSONObject().put("objectId", this.getId())
                        .put("functionDeclaration",
                                "(function() { var res = " + IosAtoms.STRINGIFY + "(this); return res;})")
                        .put("arguments", args).put("returnByValue", true));

        JSONObject response = inspector.sendCommand(cmd);
        return inspector.cast(response);
    } catch (JSONException e) {
        throw new WebDriverException(e);
    }

}

From source file:org.uiautomation.ios.webInspector.DOM.RemoteWebElement.java

License:Apache License

public RemoteWebElement(NodeId id, BaseWebInspector inspector) {
    if (inspector == null) {
        throw new WebDriverException("inspector cannot be null.");
    }// www. j  a va2s  . c om
    this.inspector = inspector;
    this.nodeId = id;
}

From source file:org.uiautomation.ios.webInspector.DOM.RemoteWebNativeBackedElement.java

License:Apache License

public void nativeClick() {
    try {// w w w  . j  a v  a 2s .co  m
        ((JavascriptExecutor) nativeDriver).executeScript(getNativeElementClickOnIt());
        inspector.checkForPageLoad();
    } catch (Exception e) {
        throw new WebDriverException(e);
    }
}

From source file:org.uiautomation.ios.wkrdp.command.Console.java

License:Apache License

public static JSONObject enable() {
    try {//  ww w.j a  v a  2  s. c om
        JSONObject cmd = new JSONObject();
        cmd.put("method", "Console.enable");
        return cmd;
    } catch (JSONException e) {
        throw new WebDriverException(e);
    }
}

From source file:org.uiautomation.ios.wkrdp.command.Console.java

License:Apache License

public static JSONObject disable() {
    try {// w ww .  j  ava  2  s  .  c o  m
        JSONObject cmd = new JSONObject();
        cmd.put("method", "Console.disable");
        return cmd;
    } catch (JSONException e) {
        throw new WebDriverException(e);
    }
}

From source file:org.uiautomation.ios.wkrdp.command.Network.java

License:Apache License

public static JSONObject canClearBrowserCache() {
    try {//from   w w  w . j a  v  a  2  s . com
        JSONObject cmd = new JSONObject();
        cmd.put("method", "Network.canClearBrowserCache");
        return cmd;
    } catch (JSONException e) {
        throw new WebDriverException(e);
    }
}

From source file:org.uiautomation.ios.wkrdp.command.Network.java

License:Apache License

public static JSONObject enable() {
    try {//from   w  ww. j  a  v  a 2s . c om
        JSONObject cmd = new JSONObject();
        cmd.put("method", "Network.enable");
        return cmd;
    } catch (JSONException e) {
        throw new WebDriverException(e);
    }
}