title: Printing screenshot within ExtentReport
body: <p>I don't understand why my screenshots are not appearing in my ExtentReport locally (I haven't tried from a build server yet). Here is the TestNG @AfterMethod where the takeScreenShot method is called:-</p>
  <pre><code>@AfterMethod
  public void afterMethod(ITestResult result) throws IOException {
      APPLICATION_LOGS.debug(&quot;Running @AfterMethod&quot;);
      switch (result.getStatus()) {
          case ITestResult.FAILURE:
              childTest.fail(result.getThrowable())
                      .addScreenCaptureFromPath((takeScreenShot(result.getMethod().getMethodName())));
              try {
                  childTest.info(&quot;&lt;a href='https://mywebsite.com/fabrix/logs/s/&quot; + webSessionId + &quot;'&quot; + &quot;target=_'blank'&gt;Data control logs&lt;/a&gt;&quot;);
              } catch (Exception e) {
                  childTest.info(&quot;Unable to get Session ID&quot;);
              }//.....more code
  </code></pre>
  <p>And here is the called method:</p>
  <pre><code>private String takeScreenShot(String methodName) {
      String path = System.getProperty(&quot;user.dir&quot;) + &quot;\\target\\reports\\screenshots\\&quot; + methodName + &quot;.png&quot;;
      try {
          File screenshotFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
          FileUtils.copyFile(screenshotFile, new File(path));
      } catch (Exception e) {
          APPLICATION_LOGS.error(&quot;Could not write screenshot&quot; + e);
      }
      return path;
  }
  </code></pre>
  <p>And the report:</p>
  <p>[![enter image description here][1]][1]</p>
  <p>I examine the image using Chrome developer tools and the path is perfect and image is saved in the same directory as the report. So why not showing?</p>
  <p>From IntelliJ:</p>
  <p><a href="https://i.stack.imgur.com/KMmOi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KMmOi.png" alt="enter image description here" /></a></p>