Take screenshot with stamp

Hi there.
Could you please help me ?
I wanna take a screenshot with stamp (Date and time),

Thanks in advance :smiley:

Abdullah Al-Tamimi said:

Hi there.
Could you please help me ?
I wanna take a screenshot with stamp (Date and time),

Thanks in advance :smiley:

use it

Date today = new Date()String todaysDate = today.format('MM_dd_yy');String nowTime = today.format('hh_mm_ss');WebUI.takeScreenshot("C:\\screens\\screenshot_"+ todaysDate +"-" + nowTime +".PNG");

for example result: screenshot_04_02_18-03_00_17.PNG

pay attention MM should be capital in todaysDate

3 Likes

Thanks a lot.
It’s work with me :smiley:

I’m use

try {    Date data = new Date(System.currentTimeMillis())    SimpleDateFormat formatarDate = new SimpleDateFormat('yyyyMMddHHmmss')    WebUI.takeScreenshot(('C:\\screenshot\\screenshot_' + formatarDate.format(data)) + '.png')
}catch (Exception e) {    e.printStackTrace()} 

Result: screenshot_20180410135703.png

1 Like