How to handle Date Pickers

Do you really have to do it?

Are you a developer of the data picker GUI. Do you want to test that GUI library in JavaScript? — I guess, you aren’t.

I guess, you want to test a web app that employs someDate Picker libaray. In this case, you would be happy if you could enter a date string (yyyyMMdd) into the target HTML element. You do not need to interact with the GUI of Date Picker.

You just want to set a text of date (‘2022/09/10’ for example) into a <input type="text"> element. You can just call WebUI.setText(testObjOfTheDateFiled, '2022/09/10'). You do not even need the “Calendar Keywords” to do that.

A working example is here :https://docs.katalon.com/docs/katalon-studio-enterprise/get-started/sample-projects/sample-webui-tests-project-healthcare-sample

The target page has a Date Picker

You can read the script source that sets a date by a single line of code:

  WebUI.setText(findTestObject('Page_CuraAppointment/txt_VisitDate'), '27/12/2016')

The sample does not use any external keyword.