Date and time error

Hi, I am getting this error: groovy.lang.MissingPropertyException: No such property: Time for class: 'ClassNotFoundException

This is the line of code it fails on:
assert titles.get(titles.size() - 1).equals(Date & Time)

Extra info:
This line of code precedes the line of code with the date and time. It calls the custom keyword function:

List<String> titles = CustomKeywords.'custom.ff.getTableColumn'(findTestObject('FourteenFish/FF_Trainers/ReviewEducatorsNotes/educatorsNotesTable'), 

This calls on the function in custom.ff:

	def List<String> getTableColumn(TestObject tableObject, int column) {
		List<String> columnValues = new ArrayList<>()
		WebElement table = WebUI.findWebElement(tableObject, 10)
		List<WebElement> tableRows = table.findElements(By.xpath("tr"))
		for(WebElement row: tableRows) {
			WebElement cell = row.findElement(By.xpath("td["+ column +"]"))
		return columnValues

For context, the custom function I reference checks the text in each row of a table under the ‘Title’ column.
(1) It checks that none of the rows in the ‘Title’ column are empty with:
assert !(titles.isEmpty())

(2) It checks the time and date against the expected time and date with:
assert titles.get(titles.size() - 1).equals(Date & Time)

Here is the full error stacktrace:

groovy.lang.MissingPropertyException: No such property: Time for class: Script1582551316022
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(
	at com.kms.katalon.core.main.TestCaseExecutor.execute(
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$ Source)

Any help would be greatly appreciated!

Welcome leyla.hunn,

I think you should check the type of your objects. It may help you.

println titles.get(titles.size() - 1).getClass().getName()

You may need to compare as strings.


Hi @ddanneels thanks for the response,

Can I ask what this line of code does? Would it return the elements in the row under title as strings rather than numbers?
And does this still check that the time and date is correct?