Validating date format

Hi!

I want to validate a given date’s format, like if it is YYYY-MM-DD, and stop the test case execution if it is false.

Any suggestions?

Thanks!

You could use regex if the date is given as String:

WebUI.verifyMatch(dateToCheck, "[0-9]{4}-[0-9]{2}-[0-9]{2}", true, FailureHandling.STOP_ON_FAILURE)

Great!

Thanks for the fast help! :slight_smile: