Hi,
The following code which is written in Selenium is responsible for selecting a date from the Calendar:
SeleniumWebDriver webDriver = new SeleniumWebDriver(WebBrowser.GOOGLE_CHROME, true);
webDriver.openUrl(“https://some URL”);
webDriver.login(webDriver);
Thread.sleep(5000);
//Click on calendar
webDriver.clickOn(WebElementIdentifierType.ID,“headerTimeLable”);
//Navigate to the left date picker
webDriver.clickOn(WebElementIdentifierType.ID,“calenderLeftCustomDatePicker”);
//Get all td of tables using findElements method receiving XPATH as a parameter
List allDates = webDriver.findElements(“//table[1]//td”);
//using for loop to get text of all elements
for(WebElement ele:allDates) {
String date=ele.getText();
//If the date is matches “28” then click
if(date.equalsIgnoreCase(“28”)) {
ele.click();
break;
}
}
I want to accomplish the same with Katalon, but I’m unable to convert the List of WebElements into a List of TestObjects recognizable by Katalon API (the following part):
List allDates = webDriver.findElements(“//table[1]//td”);
for(WebElement ele:allDates) {
String date=ele.getText();
if(date.equalsIgnoreCase(“28”)) {
ele.click();
break;
}
}
Looking forward to hear back from you.
Kind regards,