How to set the correct timezone of Chrome in TestOps?

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:

{

  "TESTCLOUD_DRIVER": {
    "katalon:options": {
       "timezone": "UTC+01:00",
       "region": "eu-west-1",
       "geoLocation": "NL"
    }
  }
}

It is still not working. Anyone has any idea how to fix this?

2 Likes

hey @maurits.lourens

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)

or if you’re using Desired Capabilities:

goog:chromeOptions = {
  "env": {
    "TZ": "Europe/Amsterdam"
  }
}

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

1 Like

1. Confirm TestCloud Environment Timezone

  • Ensure the underlying machine (not just browser capabilities) is set to UTC+01:00 before test execution.
  • Katalon’s "timezone" dictionary should look like:
{
  "TESTCLOUD_DRIVER": {
    "katalon:options": {
      "timezone": "Europe/Amsterdam"
    }
  }
}
  • 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):
import org.openqa.selenium.chrome.ChromeDriver

Map<String, Object> params = new HashMap<>()
params.put("timezoneId", "Europe/Amsterdam")
((ChromeDriver) DriverFactory.getWebDriver()).executeCdpCommand("Emulation.setTimezoneOverride", params)
  • Place this code after browser is launched, before interacting with the web app.
  • This sets the timezone for all JS Date operations (what Intl.DateTimeFormat().resolvedOptions().timeZone and new Date() will see).​
1 Like

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]]