private void launchBrowser(
      Browser browserType,
      HttpGetEndpoint httpEP,
      PlayerEndpoint playerEP,
      RecorderEndpoint recorderEP)
      throws InterruptedException {
    try (BrowserClient browser =
        new BrowserClient.Builder().browser(browserType).client(Client.PLAYER).build()) {
      browser.setURL(httpEP.getUrl());
      browser.subscribeEvents("playing", "ended");
      playerEP.play();
      if (recorderEP != null) {
        recorderEP.record();
      }
      browser.start();

      // Assertions
      Assert.assertTrue("Timeout waiting playing event", browser.waitForEvent("playing"));
      Assert.assertTrue("Timeout waiting ended event", browser.waitForEvent("ended"));
      Assert.assertTrue(
          "Play time must be at least " + VIDEO_LENGTH + " seconds",
          browser.getCurrentTime() >= VIDEO_LENGTH);
      Assert.assertTrue(
          "The color of the video should be green", browser.colorSimilarTo(Color.GREEN));

      // Assess video/audio codec of the recorded video
      AssertMedia.assertCodecs(
          getDefaultFileForRecording(), EXPECTED_VIDEO_CODEC, EXPECTED_AUDIO_CODEC);
    }
  }