How can I take screenshots in my app testing with Java-TestNG?

How can I take screenshots in my app testing with Java-TestNG?

Hi Mark,

For taking screenshots in Java-TestNG you can add the capability below: capabilities.setCapability("visual", true);