We have a Katalon test which tests the Date selected by the user and checks if the date is stored correctly. The web application used is written in React 19. When selecting the date, a Javascript Date object is used to show the selected date, but when stored in the database, a string representation of the Date object is shown.
When selecting the date, the time is 11:00 o’clock, but when displaying the stored date, the tine is 9:00 o’clock. We are running the application in The Netherlands (UTC + 1 using daylight saving time). We have configured Katalon TestOps to use this timezone and geoLocation NL like so: Desired Capabilities → TestOps:
I think the TestOps timezone setting doesn’t actually affect the Chrome browser that launches during tests. it seems you need to pass the timezone directly to Chrome. try to add this to your test setup:
ChromeOptions options = new ChromeOptions()
Map<String, String> env = new HashMap<>()
env.put("TZ", "Europe/Amsterdam")
options.setExperimentalOption("env", env)
WebDriver driver = new ChromeDriver(options)
DriverFactory.changeWebDriver(driver)
Chrome defaults to the system timezone (probably UTC), which is why you’re seeing that 2-hour difference. I think this should force it to use the correct timezone
Some sources suggest using Olson names (e.g. "Europe/Amsterdam") instead of "UTC+01:00", as this is more widely supported in browser/Selenium settings.
2. Use Chrome DevTools API to Set Timezone
Directly apply a timezone override using Chrome DevTools Protocol (CDP):
I tried both the Desired Capabilities and the ChromeDriver approach, but neither seems to have the desired effect. Locally my tests succeed (because it is run in the right timezone), but on TestOps they always fail. When I try to change the timezone in my Chrome sensors, I see the same behavior as in TestOps, so it should work by setting the timezone.
When trying to set the experimentalOption, I get this error message: “unrecognized chrome option: env” and when trying to set the timezoneOverride, I get this error message in TestOps: “No signature of method: org.openqa.selenium.remote.RemoteWebDriver$ByteBuddy$POaKSCv5.executeCdpCommand() is applicable for argument types: (String, HashMap) values: [Emulation.setTimezoneOverride, [timezoneId:Europe/Amsterdam]]”