Question: I have been trying to capture Screenshots for Passed/Failed test in my testNG reports captured in Test-Output folder. I have succeeded in doing so, however I want a bit more improvement in the way things are right now. 

The Screenshot is displayed in full size and covers the whole screen, I would like to make it appear smaller in report and then user can click on it to see the image maximized. 

I am capturing the Screenshot with the help of Reporter.log(ScreenshotPath) in the static TakeScreenshot method which is a part of finally block in my test case.

```
        public static void TakeScreenshotMethod() throws IOException {
        File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
        File ScreenshotName = new File(UtilityClass.ScreenshotPathCustomerPortal + count +".jpg");
        FileUtils.copyFile(scrFile, ScreenshotName);

        String filePath = ScreenshotName.toString();
        String path = "<img src=\"file://" + filePath + "\" alt=\"\"/>";
        Reporter.log(path);
        count++;
        }

```

I would like to control the size of the image being displayed in my report.

Answer: 
You can a bit modify the **`<img>`** tag by adding a `style` like normal html with some property (width, height), like this:

```
String path = "<img src=\"file://" + filePath + "\" alt=\"\" style=\"width: 230px; height :500px;\" />";

```
If you are asking for this behavior in the default TestNG reports, then the answer is **NO its not possible**. TestNG reports are agnostic to the content that gets embedded in them. So TestNG doesn't know if an image or if a video for that matter is being embedded in it. So it also doesn't different on how to get them rendered.

If you would like to control these behaviors, you should do one of the following:

1. Build your own custom reporter that has this behavior by implementing the `org.testng.IReporter` interface and then wiring in this listener via the `<listeners>` tag or via `@Listeners` interface or via a Service Provider Interface mechanism. You can learn about wiring in listeners in general from my blog post [here](https://rationaleemotions.com/testng_listeners/).
2. You can explore some of the reporting solutions that exist already out there such as allure reports (or) extent reports etc., and see if one of them fits your requirement and use them instead.

TestNG doesn't have any role to play in this.