public function createScreenshot($file_name, $message, $ext = TRUE) {
    if ($this->getSession()->getDriver() instanceof Selenium2Driver) {
      if ($ext) {
        $file_name .= '.png';
      }
      $screenshot = $this->getSession()->getDriver()->getScreenshot();
      file_put_contents($file_name, $screenshot);
    }
    else {
      if ($ext) {
        $file_name .= '.html';
      }
      $html_data = $this->getSession()->getDriver()->getContent();
      file_put_contents($file_name, $html_data);
    }
    if ($message) {
      print strtr($message, ['@file_name' => $file_name]);
    }
  }