# Troubleshooting Steps

## What To Do When Tests Pass Locally But Fail In Testery

* **Ensure you're pointing at the same system-under-test when running locally and try again.** Sometimes a test will pass locally because when running locally it's pointed at a web server on a local host or a development environment, and then when running remotely it's pointed at a QA environment. Environment differences can cause test failures (and could even be bugs)!
* **Make sure your timeouts are set appropriately**. All tests that interact with websites have timeouts (even Cypress). When Testery runs a test, you are getting a clean test runner that doesn't have the same items in its browser cache, the same network latency, or likely the same CPU and memory profile as your beefed-up developer workstation. While test run times are generally significantly better than running locally, this is due to parallelization, as individual tests can take longer to run.

## What to do when the client’s time zone is causing errors in your test

If you have been developing and running test code locally and then start using a runner that is in a different time zone, you may come across unexpected errors. Here are a few things to try to address these issues.

* **Ensure tests are time-independent**. Most modern code languages have time/date libraries to convert between time zones easily. It is advisable to standardize the time retrieved from both the application's interface and the runner by converting it to a common time zone.

```
from datetime import datetime
import pytz

# Get the current UTC time (Testery)
utc_now = datetime.now(pytz.UTC)

# Convert to Pacific Time
pacific_timezone = pytz.timezone('America/Los_Angeles')
pacific_time = utc_now.astimezone(pacific_timezone)

# Format the time as a string
formatted_time = pacific_time.strftime("%Y-%m-%d %H:%M:%S %Z")

print(f"Current Pacific Time: {formatted_time}")
```

* **Modify the browser’s time zone**. If your application is limited to operations in certain time zones, changing the browser’s time zone on the test runner may yield beneficial results. You can use browser options when initializing the driver to achieve this.

```python
driver = webdriver.Chrome()
tz_params = {'timezoneId': 'America/Los_Angeles'}
driver.execute_cdp_cmd('Emulation.setTimezoneOverride', tz_params)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.testery.io/misc/troubleshooting-steps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
