Taking entire page screenshot using AShot in Katalon Studio

I did a workaround.

WebUI.takeScreenshot(RunConfiguration.getReportFolder()+ “\filename.png”)
WebDriver driver = DriverFactory.getWebDriver()
Screenshot screenshot = new AShot().
coordsProvider(new WebDriverCoordsProvider()).
shootingStrategy(ShootingStrategies.viewportPasting(timeout)).
takeScreenshot(driver)
//Just printing
println( RunConfiguration.getReportFolder()+"\filename.png")

	ImageIO.write(screenshot.getImage(), "PNG", new File(RunConfiguration.getReportFolder()+ "\\filename.png"))
1 Like

I do not think it is possible, as Katalon team has not disclosed a way how to customize the report.

1 Like

is it possible to use the ashot plugin with mobile elements? I want to get a small element in my app page and then to be able to extract the color of that element or the pixel in the center of that mobile app element…

Not sure if it will help at all but I wrote a robot method that can be utilized with chrome to take a screenshot of the entire page. I’ve included a sub-method needed as well. Since it’s a robot, it’ll simulate using keystrokes so using this method means you can’t be touching your keyboard while it runs, that’s if you’re running the script on your own terminal.

You’ll need some imports for the robot stuff:

import java.awt.Robot
import java.awt.event.KeyEvent

/**KEYSTROKE
 * A method that combines keyPress and keyRelease to form one keystroke
 * @param Robot bot is the robot that is generated from the top level method
 * @param int keyCode is the key that we want to press and release to simulate typing it a KeyEvent is being passed in and converted to a code
 * */
static void keyStroke(Robot bot, int keyCode){
	bot.keyPress(keyCode)
	bot.keyRelease(keyCode)
	bot.delay(200)
}

/**CAPTURE SCREEN
 * Use robot to open the Google Chrome console and use the capture full screen command
 * NOTE: This can only be used when executing tests with Google Chrome
 * */
@Keyword
void captureScreen(){
	Robot Automatron = new Robot()

	try{

		//open chrome console
		Automatron.keyPress(KeyEvent.VK_CONTROL)
		Automatron.keyPress(KeyEvent.VK_SHIFT)
		keyStroke(Automatron, KeyEvent.VK_J)

		Automatron.delay(1500)

		//open chrome commands
		keyStroke(Automatron, KeyEvent.VK_P)

		Automatron.delay(1500)

		Automatron.keyRelease(KeyEvent.VK_CONTROL)
		Automatron.keyRelease(KeyEvent.VK_SHIFT)

		//capture screenshot
		keyStroke(Automatron, KeyEvent.VK_C)

		keyStroke(Automatron, KeyEvent.VK_A)

		keyStroke(Automatron, KeyEvent.VK_P)

		keyStroke(Automatron, KeyEvent.VK_DOWN)

		keyStroke(Automatron, KeyEvent.VK_DOWN)

		keyStroke(Automatron, KeyEvent.VK_ENTER)

		Automatron.delay(3000)

		//close chrome console
		Automatron.keyPress(KeyEvent.VK_CONTROL)
		Automatron.keyPress(KeyEvent.VK_SHIFT)
		keyStroke(Automatron, KeyEvent.VK_J)

		Automatron.delay(1000)

		Automatron.keyRelease(KeyEvent.VK_CONTROL)
		Automatron.keyRelease(KeyEvent.VK_SHIFT)

	}finally{
		//if something fails then don't keep the ctrl or shift keys held down. That super sucks
		Automatron.keyRelease(KeyEvent.VK_CONTROL)
		Automatron.keyRelease(KeyEvent.VK_SHIFT)
	}
}

Please find out the answer in the AShot’s documentation at