[WebUI] Take Screenshot


This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/webui-take-screenshot.html

Hi,

There is any script how to make sure the takeScreenshot is called after the page fully loaded?

Thanks

Add WebUI.waitForPageLoad() before taking screenshot.

Is there a way to take a full-page screenshot by scrolling down?

Have a look at this:

3 Likes

How for taking screenshoot on mobile testing when execution failed?

Try googling with key "Appium screenshot " and read resources found.

As Appium doc tells, you can take a screenshot of the current viewport/window/page.

Howerver there seems to be no library in Java which enables to take entire-page screenshot of mobile pages.

aShot enables you to take entire page screenshot of web pages via WebDriver, but it does not support Appium.

Please create a separate topic - it will help more people see your question.

OK. Thanks a lot. but i think the screenhoot include to report that katalon given on pdf/hmtl. Not on local folder.

I used the same script … it is shwoing cannot take screen shot

Guys , how to take screen shot fully page , not at entire page ??

its important :slight_smile:

i thought is was stored in local folder

Do you know where the screen get stored too? need help

By default it should be stored in temp folder.

Try %temp% in run command and check whether the screenshot is taken. Please check the documents,

  1. default temp location storage.
'Take screenshot after logging in'
WebUI.takeScreenshot()
  1. custom location store.
'Take screenshot after logging in'
WebUI.takeScreenshot('E:\\screenshot.png')
  1. relative path storage which will be stored under your katalon studio folders in tests explorer.
'Take screenshot after logging in'
WebUI.takeScreenshot('Test/Demo.png')

Hello,
do you have a solution if I have a case, when making a screenshot but the storage folder is created directly. without the need to create a manual folder on my computer.

Thankss

How can one add a time stamp / Test name to the name of the screen shot?

Date today = new Date()

String todaysDate = today.format(‘ddMMMyyyy’)

String nowTime = today.format(‘HHmmss’)

you can use this in script mode. then apppend this todaysDate+nowTime to your screenshot name

sorry for late reply. I’m little busy with my works. Please check whether this thread could help you

@kazurayam
@devalex88

I am trying to capture screenshot using selenium screenshot function,

byte[] scrBytes =((TakesScreenshot)DriverFactory.getWebDriver()).getScreenshotAs(OutputType.BYTES)
ByteArrayInputStream bytePartImage = new ByteArrayInputStream(scrBytes)
partImage[i]=ImageIO.read(bytePartImage)

It works fine with Windows browsers, but when I am trying capture screenshot on Mac browsers, it returns image with bigger dimension than viewport dimension as follows,

image

Kindly suggest some way (except Ashot)to solve it.

Are you using MacOS Catalina (current version)?

Are you using a notebook type (MacBook, MacBook Air), or using 2nd Display device?

I ask this because the screenshot depends on the resolution you choose for the display.


On Windows 10 + 4K display, I had a problem of taking screenshot by Ashot:

On Windows 10 , we can choose scaling setting to 100% to avoid problem.

However, as far as I know, on Mac notebook with built-in display, it is impossible to scale the display to 100%. Therefore the screenshot taken on it becomes problematic.