[Studio] How do I verify Match Of Date that contain strings?

I would like to verify the submission date match with today’s date. But the submission date contain string. I already add the code for the date to be verified. But since the submission date contain string so the results came out false. How to verify the two date despite the string in submission date?

Example :
Submission Date - “Submitted today, 20/05/2024”
Today’s date - “20/05/2024”

The code :

The results :

Thanks in advanced!

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.


You can add (concatenate) the String part to the comparison and then verify if they match
WebUI.verifyMatch(submitDate, "Submitted: Today, ${now}", false)

or a number of variations that do the same thing:

WebUI.verifyMatch(submitDate, "Submitted: Today, " + now, false)

or even

WebUI.verifyMatch(submitDate, ".*" + now, true) // this uses RegEx

1 Like