In mabl, you can override the default settings for browser locale and timezone in cloud runs, local runs, and training sessions. Setting a specific browser locale and/or timezone is useful for:
-
Multi-locale testing - Some web apps settings like language, currency, date format, and numbers depending on the browser locale. For example, a web app may display the currency in US Dollars when the locale is
en-USand in British pounds if the locale isen-GB. Or if you are testing a restaurant delivery application in Japan, you can set the locale tojaand the timezone toUTC+9so that prices and delivery times are consistent during training and execution. -
Reducing discrepancies in test behavior during training and execution - If a test passes locally but fails in the cloud and the difference involves dates, times, currency, or language, the issue may be a timezone mismatch between training and execution environments. By default, cloud runs default to
en-USandUTC+0, while trainer and local runs use your machine’s settings. Setting the browser locale and timezone can address this discrepancy.
What is browser locale?
Browser locales are a combination of language and regional identifiers that can affect the language used by webpages and the displayed values for currencies, date formats, and numbers. You may also know this as the browser language settings.
Cloud runs
Plan runs
Locale and timezone settings configured on a plan apply to every test and every DataTable scenario in that plan run. To edit the browser locale and timezone for a specific plan, take the following steps:
- Click on the pencil icon on the plan details page
- In the Browser device settings section, click on Additional settings
- Select the desired browser locale and/or timezone from the dropdowns.
- Save your plan.
Setting browser locale and timezone for plan runs
Ad hoc runs
To edit the browser locale and timezone for ad hoc cloud runs, take the following steps:
- On the test details page, click on the Run test button.
- On the Cloud run tab, toggle on “Customize localization options”
- Select the desired browser locale and/or timezone from the dropdowns.
- Click on the Start run button.
Local runs and training sessions
To set the browser locale and/or timezone for local runs and training sessions in the mabl Trainer, use the preferences menu:
- Go to Edit > Preferences in the menu bar.
- Click on the Browser tab.
- Select the desired browser locale and/or timezone from the dropdowns.
- Save your settings.
Test runs initiated via the CLI
To set the browser locale and/or timezone for tests initiated using the mabl CLI, use the --locale or --timezone-id flags:
mabl tests run-cloud --locale ja-JP --timezone-id Asia/TokyoIf you trigger a plan run with --from-plan-id, locale and timezone configured on the plan in the UI do not apply. --from-plan-id runs execute locally. Pass --locale and --timezone-id directly on the CLI command.
mabl tests run --from-plan-id [plan-id] --locale ja-JP --timezone-id Asia/Tokyo