code: @Override
    public Response handle() throws Exception {
      Object p = getRequest().getPayload().get("id");
  
      if (JSONObject.NULL.equals(p)) {
        getWebDriver().getContext().setCurrentFrame(null, null, null);
      } else {
        RemoteWebElement iframe;
        if (p instanceof String) {
          iframe = getIframe((String) p);
        } else if (p instanceof Integer) {
          iframe = getIframe((Integer) p);
        } else if (p instanceof JSONObject) {
          String id = ((JSONObject) p).getString("ELEMENT");
          iframe = getWebDriver().createElement(id);
        } else {
          throw new UnsupportedCommandException("not supported : frame selection by " + p.getClass());
        }
  
        RemoteWebElement document = iframe.getContentDocument();
        RemoteWebElement window = iframe.getContentWindow();
        getWebDriver().getContext().setCurrentFrame(iframe, document, window);
      }
  
      Response res = new Response();
      res.setSessionId(getSession().getSessionId());
      res.setStatus(0);
      res.setValue(new JSONObject());
      return res;
    }
docs: NoSuchFrame - If the frame specified by id cannot be found.