# How to take a full-page screenshot of mobile & pc

**URL:** <https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [June 15, 2017, 7:13am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706 "2017-06-15T07:13:17Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sangmook.kim](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sangmook.kim](https://forum.katalon.com/u/sangmook.kim)\
**Post date:** [June 15, 2017, 7:13am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/1 "2017-06-15T07:13:17Z")

</div>

same as title

---

<div class="post-metadata">

**Author:** ![Lala](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@Lala](https://forum.katalon.com/u/Lala)\
**Post date:** [August 7, 2018, 6:57am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/2 "2018-08-07T06:57:37Z")

</div>

Hi

I have googled around and finally could take a fullpage screenshot for my project.  
You need to create a custom keyword “ScreenshotHelper” under the project.  
After that copy and paste below code.

Change the file path to a folder path you want to save the screenshot.

===================================================================

package screen

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import static com.kms.katalon.core.testdata.TestDataFactory.findTestData

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.annotation.Keyword

import com.kms.katalon.core.checkpoint.Checkpoint

import com.kms.katalon.core.checkpoint.CheckpointFactory

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords

import com.kms.katalon.core.model.FailureHandling

import com.kms.katalon.core.testcase.TestCase

import com.kms.katalon.core.testcase.TestCaseFactory

import com.kms.katalon.core.testdata.TestData

import com.kms.katalon.core.testdata.TestDataFactory

import com.kms.katalon.core.testobject.ObjectRepository

import com.kms.katalon.core.testobject.TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords

import internal.GlobalVariable

import java.text.SimpleDateFormat

import org.openqa.selenium.WebDriver

import org.openqa.selenium.WebElement

import ru.yandex.qatools.ashot.AShot

import ru.yandex.qatools.ashot.Screenshot

import ru.yandex.qatools.ashot.shooting.ShootingStrategies

import MobileBuiltInKeywords as Mobile

import WSBuiltInKeywords as WS

import WebUiBuiltInKeywords as WebUI

import com.kms.katalon.core.webui.common.WebUiCommonHelper

import com.kms.katalon.core.webui.driver.DriverFactory

import javax.imageio.ImageIO as ImageIO

public class ScreenshotHelper {

@Keyword

public void takeWebElementScreenshot() {

WebDriver driver = DriverFactory.getWebDriver();

Screenshot screenshot = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)).takeScreenshot(driver);

ImageIO.write(screenshot.getImage(), “PNG”, new File(“C:\\\Users\\\UserName\\\Downloads\\\test.png”))

}

}

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [August 7, 2018, 7:28am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/3 "2018-08-07T07:28:58Z")

</div>

I happened to post a similar theme:

> **[Taking entire page screenshot using AShot in Katalon Studio](http://forum.katalon.com/discussion/8733/taking-entire-page-screenshot-using-ashot-in-katalon-studio)**
>
> I have made a demo project here: \* https://github.com/kazurayam/EntirePageScreenshotByAShotInKatalonStudio ------ Problem to solve

-----

update at 2018/11/10

The following post proposes extended version of my custom keyword com.kazurayam.ksbackyard.ScreenshotDriver

- [http://forum.katalon.com/discussion/10505/comparing-screenshots-of-webelement](http://forum.katalon.com/discussion/10505/comparing-screenshots-of-webelement)

---

<div class="post-metadata">

**Author:** ![Alexander\_L\_B](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Alexander\_L\_B](https://forum.katalon.com/u/Alexander_L_B)\
**Post date:** [November 9, 2018, 7:58am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/4 "2018-11-09T07:58:12Z")

</div>

Hi, I have tested this solution and it worked. Thanks!

A question to someone good coding.

Related to the storage:  
ImageIO.write(screenshot.getImage(), “PNG”, new File(“C:\\\Users\\\UserName\\\Downloads\\\test.png”))

Can someone update it so that the file will be saved in the screenshot folder of each test case, like it is being done with the built-in keyword TakeScreenshot?

As it is now no matter in which test case you use the custom define ScreenshotHelper with Ashot, it will always create the same file name in the same folder, so by running this several times in different test cases it will overwrite the file…

Does someone accept the coding challenge? 🙂

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [November 10, 2018, 5:42am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/5 "2018-11-10T05:42:58Z")

</div>

Alexander,

Please have a look at the following post and try my Materials library.

- [Releases · kazurayam/Materials · GitHub](https://github.com/kazurayam/Materials/releases)

An introduction to the library is here:

- [Materials, a library that resolves output file paths in a well-structured folder tree - Miscellaneous - Katalon Community](http://forum.katalon.com/discussion/10211/materials-a-library-that-resolves-output-file-paths-in-a-well-structured-format)

together with my custom keyword com.kazurayam.ksbackyard.ScreenshotDriver which wraps the aShot library

- [Comparing Screenshots of а WebElement - Miscellaneous - Katalon Community](http://forum.katalon.com/discussion/10505/comparing-screenshots-of-webelement)

The Materials library enables you to save screenshots in the following folder structure.

```auto
${projectDir}/Materials/${testSuiteName}/${testSuiteTimestamp}/${testCaseName}/${subdirs}/${fileName}

```

The following picture shows an example.

 ![](https://dub1.discourse-cdn.com/katalon/uploads/default/original/1X/52f05f854a228e88ac55121e54f0ef5241246a9e.png)

I believe the Materials will solve your problem.

[TS07\_tree.png](https://forum.katalon.com/uploads/short-url/bPI9haqMgFoq8oUvUHl6TtzwAbk.png)

---

<div class="post-metadata">

**Author:** ![cavoidc](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@cavoidc](https://forum.katalon.com/u/cavoidc)\
**Post date:** [May 4, 2019, 10:12am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/6 "2019-05-04T10:12:50Z")

</div>

I want to save screen shot on log folder,  
can you tell me how to do it ?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [May 4, 2019, 11:00am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/7 "2019-05-04T11:00:36Z")

</div>

> [@cavoidc](#):
>
> log folder,

What is “log folder”?

---

<div class="post-metadata">

**Author:** ![cavoidc](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@cavoidc](https://forum.katalon.com/u/cavoidc)\
**Post date:** [May 7, 2019, 9:33am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/8 "2019-05-07T09:33:10Z")

</div>

Yeah, I mean when I take a full screen short,  
I want to save to folder test suite reports.

" The report will be named with following the naming convention: _YYYYMMDD\_HHmmss_ , which is the datetime when the test suite starts its execution."  
link: [https://docs.katalon.com/katalon-studio/tutorials/viewing\_test\_suite\_reports.html#report-overview](https://docs.katalon.com/katalon-studio/tutorials/viewing_test_suite_reports.html#report-overview)

I want to save in that folder 🙂

---

<div class="post-metadata">

**Author:** ![gauthamkarthik534](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@gauthamkarthik534](https://forum.katalon.com/u/gauthamkarthik534)\
**Post date:** [December 2, 2020, 5:17am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/9 "2020-12-02T05:17:56Z")

</div>

Please refer below tutorial

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [December 2, 2020, 5:27am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/10 "2020-12-02T05:27:36Z")

</div>

> [@cavoidc](#):
>
> I want to save to folder test suite reports.

You can find the folder path using `Runconfiguration.getReportFolder()`.  
See

> [@ReportName - DateTimestamp](http://forum.katalon.com/t/reportname-datetimestamp/49609):
>
> Hi Still new to Katalon. The Basic Report Plugin is now ‘built-in’ from v7 onwards. I am looking to hook the Name of the report for integration with a local system. The report folder is written immediately the test suite is executed and is a date timestamp. However, this datetimestamp does not match the 1st entry on the LogViewer. Is this information recorded anywhere within Katalon ?

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [August 8, 2022, 7:31am UTC](https://forum.katalon.com/t/how-to-take-a-full-page-screenshot-of-mobile-pc/6706/11 "2022-08-08T07:31:44Z")

</div>

Archived on August 8, 2022, 7:31am UTC


