Published on

Getting Started with Katalon Studio + Bootstrap Date Picker Automation (Demo-003)

Authors
  • avatar
    Name
    Loc Truong
    Twitter

Getting Started with Katalon Studio (Linux)

Katalon Studio is an all-in-one automation testing tool built on top of Selenium and Appium, designed for both beginners and professionals.
In this post, we’ll go through:

  1. Installing Katalon Studio on Linux
  2. Fixing JVM launch issues
  3. Running a real web automation test — Demo-003: Date Picker (Bootstrap)

1. Install Katalon Studio on Linux

Download

Get the latest version of Katalon Studio Enterprise for Linux from the official website.

Example (as of writing):

wget https://download.katalon.com/10.3.2/Katalon_Studio_Enterprise_Linux_64-10.3.2.tar.gz
tar -xvzf Katalon_Studio_Enterprise_Linux_64-10.3.2.tar.gz
cd Katalon_Studio_Enterprise_Linux_64-10.3.2

Launch:

./katalon

If you see an error like:

Unrecognized option: --add-opens=java.base/java.lang=ALL-UNNAMED
Error: Could not create the Java Virtual Machine.

It means your Java version is too old or incompatible.

2. Fix JVM Termination issue

Solution 1 - Install the correct Java version

Katalon 10.x requires Java 17 or newer.

sudo apt install openjdk-17-jdk
java -version

Then, re-launch Katalon using that JVM:

/usr/lib/jvm/java-17-openjdk-amd64/bin/java -jar katalon

Solution 2 - Modify the Katalon launcher file

Edit katalon.ini inside the Katalon folder:

-vm
/usr/lib/jvm/java-17-openjdk-amd64/bin/java

Save and restart.

3. Date Picker Test (Bootstrap)

We'll automate HP LP3065 product page from TutorialsNinja Demo

Test scenario

StepDescription
A1Search "HP LP3065" in search bar
A2Choose "HP LP3065" device
A3In Delivery Date, choose date 04/Jan/2021
A4Then choose today's date
E3Verify chosen date is displayed correctly

4. Object Repository Setup

In Katalon's Object Repository, create:

Page_Home/input_Search
Page_Product/picker_Header
Page_Product/picker_Year
Page_Product/picker_Month
Page_Product/picker_Day

Example XPath locators:

ObjectXPath
input_Search//input[@name='search']
picker_Header//div[contains(@class, 'bootstrap-datetimepicker-widget')]//*
picker_Year//span[text()='${year}']
picker_Month//span[text()='${month}']
picker_Day//td[@class='day' and text()='${day}']

5. Katalon Test Script

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

WebUI.openBrowser('')
WebUI.navigateToUrl('http://tutorialsninja.com/demo/')

// Search product
WebUI.setText(findTestObject('Page_Home/input_Search'), 'HP LP3065')
WebUI.click(findTestObject('Page_Home/button_Search'))
WebUI.click(findTestObject('Page_Product/link_HP_LP3065'))

// Open date picker
WebUI.click(findTestObject('Page_Product/input_DeliveryDate'))

// Click header twice to reach year view
WebUI.click(findTestObject('Page_Product/picker_Header'))
WebUI.waitForElementVisible(findTestObject('Page_Product/picker_Header'), 2)
WebUI.click(findTestObject('Page_Product/picker_Header'))

// Select year, month, and day dynamically
def targetYear = '2021'
def targetMonth = 'Jan'
def targetDay = '4'

WebUI.click(findTestObject('Page_Product/picker_Year', [('year') : targetYear]))
WebUI.click(findTestObject('Page_Product/picker_Month', [('month') : targetMonth]))
WebUI.click(findTestObject('Page_Product/picker_Day', [('day') : targetDay]))

// Verify date chosen
String chosenDate = WebUI.getAttribute(findTestObject('Page_Product/input_DeliveryDate'), 'value')
WebUI.verifyMatch(chosenDate, '04/01/2021', false)

6. Handle Non-Visible or Out-of-Range Years

Sometimes the target year is not visible. Use navigation arrows (< / >) with dynamic waiting:

while (!WebUI.verifyElementPresent(findTestObject('Page_Product/picker_Year', [('year') : targetYear]), 1, FailureHandling.OPTIONAL)) {
    WebUI.click(findTestObject('Page_Product/button_Next'))
}
WebUI.click(findTestObject('Page_Product/picker_Year', [('year') : targetYear]))

7. Run the test

Click ▶ Run in Katalon → Choose Chrome.

Expected:

  • The script opens TutorialNinja site.
  • Selects the correct product.
  • Opens the date picker and chooses the correct date.
  • Verifies it in the input field.