How to select date from date picker?


Is it this?

this looks like a reactjs. you can build a utility like this below.

public static void setDateUsingFlatPicker(String Locator,String NewDate) {

	String ExtractLocatorXpath = ('document.evaluate(' + Locator) + ', document , null ,XPathResult.FIRST_ORDERED_NODE_TYPE,null,).singleNodeValue'

	String DateManipulation = '"' + NewDate + '"'

	String SetDate = ExtractLocatorXpath + '._flatpickr.setDate('+ DateManipulation +',true);'

	System.out.println('New SetdataJs : ' + SetDate)

	WebUI.executeJavaScript(SetDate, null)

	WebUI.waitForJQueryLoad(GlobalVariable.Timeout)

	String TriggerRuleAction = ('jQuery(' + ExtractLocatorXpath) + ').trigger({ type: \'datetimechange\', isManualTrigger: true });'

	WebUI.executeJavaScript(TriggerRuleAction, null)

	WebUI.waitForJQueryLoad(GlobalVariable.Timeout)
}

String Locator = ‘xpathofwebelement’

Utility.setDateUsingFlatPicker(Locator, ‘2022-04-25 12:30:00’)

How do I use them? I’m new so I don’t know how to use it

Create a Custom Keyword inside Keywords section and then use the above method implemented method into your testcases in script window and pass the date value as arguments.

Please refer this below.

Introduction to Custom Keywords | Katalon Docs

I tried to open the mht file you provided. But I saw just a blank window. My Chrome browser could not render the mht file at all. I do not know why.

I could not see the page on my PC, so that I have no idea about your issue. I will quit, sorry.

The only thing I could found was that your target web page is a javascript driven Single Page Application.

@phanuyend Check the <iframe>-s, because it might ruin all your other approaches toward the datepicker.

Thanks for helping me!

How to check it?




Check to see if your datepicker widget lives within an <iframe>.