# Screeshot

**URL:** <https://forum.katalon.com/t/screeshot/6168>\
**Category:** Miscellaneous\
**Created:** [July 27, 2017, 4:49pm UTC](https://forum.katalon.com/t/screeshot/6168 "2017-07-27T16:49:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhay\_dhongde](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@abhay\_dhongde](https://forum.katalon.com/u/abhay_dhongde)\
**Post date:** [July 27, 2017, 4:49pm UTC](https://forum.katalon.com/t/screeshot/6168/1 "2017-07-27T16:49:06Z")

</div>

String TDate=new Date()

Screen=WebUI.concatenate([TDate, ‘Screen’,‘.png’] as String)

WebUI.takeScreenshot(‘C:\Users\l991256\Katalon Studio\Screeshots\’+Screen)

WebUI.takeScreenshot(WebUI.concatenate(‘C:\Users\l991256\Katalon Studio\Screeshots\’,Screen))

Tried lot o options but did not worked

---

<div class="post-metadata">

**Author:** ![abhay\_dhongde](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@abhay\_dhongde](https://forum.katalon.com/u/abhay_dhongde)\
**Post date:** [July 28, 2017, 1:22pm UTC](https://forum.katalon.com/t/screeshot/6168/2 "2017-07-28T13:22:23Z")

</div>

In that case how i am suppose to create unique screen shot name.I cant’s overwrite the file for every execution

---

<div class="post-metadata">

**Author:** ![Zarashima](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/zarashima/32/928_2.png) [@Zarashima](https://forum.katalon.com/u/Zarashima)\
**Post date:** [July 28, 2017, 3:16am UTC](https://forum.katalon.com/t/screeshot/6168/3 "2017-07-28T03:16:42Z")

</div>

The output of this line Screen=WebUI.concatenate([TDate, ‘Screen’,’.png’] as String[]) contains restricted character for filename (🙂 on Windows, so you can’t save screenshot using this kind of generated filename.

---

<div class="post-metadata">

**Author:** ![K\_Alsemgeest](https://avatars.discourse-cdn.com/v4/letter/k/3e96dc/32.png) [@K\_Alsemgeest](https://forum.katalon.com/u/K_Alsemgeest)\
**Post date:** [September 5, 2017, 1:51pm UTC](https://forum.katalon.com/t/screeshot/6168/4 "2017-09-05T13:51:21Z")

</div>

I was having the same problem. After each test execution my screenshot files were overwritten. I couldn’t find an appropriate solution in Katalon so I came up with a workaround. After each test execution I run a batchfile which replaces the name(s) with a number and date. Like so:

@echo on  
cd\  
cd users\user\mydocuments  
setlocal EnableDelayedExpansion

set Filename=FileTitle  
set suffix=100  
for /F “delims=” %%i in (‘dir /B \*.png’) do (  
set /A suffix+=1  
ren “%%i” “%filename%-!suffix:~1! somename\_%time:~0,2%%time:~3,2%-%DATE:/=%.png”  
)
