No such property: today for class


I am trying to take screenshots with the date and timestamp, and I am getting an error after I run my script. “No such property: today for class”.

Hoping can someone who look into this. Thank you!

My code

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 static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject

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

import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW

import as Mobile

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

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

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

import com.kms.katalon.core.testng.keyword.TestNGBuiltinKeywords as TestNGKW

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

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

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

import as Windows

import internal.GlobalVariable as GlobalVariable

import org.openqa.selenium.Keys as Keys



Date tody = new Date()

String todaysDate = today.format('MM_dd_yy') <-- there was an under line in today.format

String nowTime = today.format('hh_mm_ss') <-- there was an under line in today.format


WebUI.takeScreenshot(((('/Users/Folder1/Folder2/Folder3' + todaysDate) + '_') + nowTime) + '.png')

You have a typo.


(should rather be)

Thank you so much @kazurayam! I didn’t notice my typo, and it’s working now :slight_smile: