Configure Timezones

In case your website changes depending on your end-users’s timezone, you might want to test that functionality by specifying a time zone you want to test in. You can configure your tests to run on a custom time zone by using the browserstack.timezone capability.

Capability Description Expected values
browserstack.timezone The time zone you want to run the test in A string.

New_York for America/New_York,
La_Rioja for America/Argentina/La_Rioja

See the complete list of time zones on Wikipedia

Here is the sample code that sets the time zone to America/New_York:

// Testing with time zone set to New York

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browserstack.timezone", "New_York");
// ... other capabilities
// Testing with time zone set to New York

var capabilities = {
 "browserstack.timezone" : "New_York"
 // ... other capabilities
}
// Testing with time zone set to New York

DesiredCapabilities caps = new DesiredCapabilities();
caps.SetCapability("browserstack.timezone", "New_York");
// ... other capabilities
# Testing with time zone set to New York

$caps = array(
 "browserstack.timezone" => "New_York"
 # ... other capabilities
);
# Testing with time zone set to New York

capabilities = {
 "browserstack.timezone" : "New_York"
 # ... other capabilities
}
# Testing with time zone set to New York

caps = Selenium::WebDriver::Remote::Capabilities.new
caps["browserstack.timezone"] = "New_York"
# ... other capabilities
# Testing with time zone set to New York

my $capabilities = {
 "browserstack.timezone" => "New_York"
 # ... other capabilities
}

We're sorry to hear that. Please share your feedback so we can do better






Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback