code: @Override
      public <X> X getScreenshotAs(OutputType<X> target) {
          // Get the screenshot as base64 and convert it to the requested type (i.e. OutputType<T>)
          String base64 = (String) execute(DriverCommand.SCREENSHOT).getValue();
          return target.convertFromBase64Png(base64);
      }
docs: Take screenshot of the current window.
  
  @param target The target type/format of the Screenshot
  @return Screenshot of current window, in the requested format