code: public boolean selectAll() {
          boolean result = false;
          WebElement element = getActiveElement();
          if (element != null) {
              if (connectedToMac()) {
                  executeJavascript("arguments[0].select()", element);
              } else {
                  element.sendKeys(Keys.CONTROL, "a");
              }
              result = true;
          }
          return result;
      }
docs: Simulates 'select all' (e.g. Ctrl+A on Windows) on the active element.
  @return whether an active element was found.