private static void checkGridExtras(String gridUrl, RemoteWebDriver driver) {
   String gridExtras = GridUtils.getNodeExtras(gridUrl, driver);
   if (gridExtras == null) {
     log.info("No grid extras foud");
   } else {
     log.info("Grid extras available at {}", gridExtras);
   }
 }
  private static WebDriver createRemoteDriver() {
    if (ConfigLoader.config().containsKey("noui")) {
      return new HtmlUnitDriver(true);
    }
    log.info("Creating browser for {}", browser.get());
    try {
      if (Strings.isNullOrEmpty(GRID_URL) || !isGridAvailable(GRID_URL)) {
        log.info("Grid not detected");
        String name = browser.get().toLowerCase();
        if (name.equalsIgnoreCase("ie")
            || name.equals("internet_explorer")
            || name.equals("internet explorer")) {
          return new InternetExplorerDriver(getCapabilities(BrowserType.IE));
        }
        String browserName = StringUtils.capitalize(name + "Driver");
        WebDriver res = null;
        try {
          res =
              (WebDriver)
                  Class.forName("org.openqa.selenium." + name + "." + browserName)
                      .getConstructor(Capabilities.class)
                      .newInstance(getCapabilities(name));
        } catch (Exception e) {
          throw new IllegalStateException(
              String.format("Browser for name %s failed to start", name), e);
        }
        return res;
      } else {
        log.info("Using Selenium grid at {}", GRID_URL);
        String browserType = browser.get();
        URL gridUrl = new URL(GRID_URL);
        RemoteWebDriver result = new RemoteWebDriver(gridUrl, getCapabilities(browserType));
        log.info("Driver instance created {}", result);
        log.debug("Test session id {}", result.getSessionId());
        log.info("Executing on node {}", GridUtils.getNode(GRID_URL, result));
        String videoLink =
            String.format(
                "%s/download_video/%s.mp4",
                GridUtils.getNodeExtras(gridUrl.toString(), result),
                result.getSessionId().toString());
        ConfigLoader.config().addProperty("webdriver.video", videoLink);
        List<Object> videos =
            ConfigLoader.config().getList("webdriver.videos", new ArrayList<Map<String, String>>());

        String story = null;
        try {
          if (!Strings.isNullOrEmpty(GenericAllureStoryReporter.storyName())) {
            story = GenericAllureStoryReporter.storyName();
          } else if (!Strings.isNullOrEmpty(AllureStoryReporter.storyName())) {
            story = AllureStoryReporter.storyName();
          }
        } catch (Throwable t) {

        }
        if (Strings.isNullOrEmpty(story)) {
          story = "recording " + result.getSessionId();
        }
        String title = "video_" + story;

        log.info("Session for story {}", title);
        videos.add(Collections.singletonMap(title, videoLink));
        ConfigLoader.config().setProperty("webdriver.videos", videos);
        checkGridExtras(GRID_URL, result);
        return result;
      }
    } catch (MalformedURLException e) {
      throw new RuntimeException("Cannot connect to grid", e);
    }
  }