> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/ai-test-automation/3.0/use-ai-test-automation/test-execution/resilient-mode.md).

# Configure Test Execution Modes

Harness AI Test Automation offers two test execution modes: fast and resilient. Tests run in fast mode by default. Select resilient mode when you need more reliable test execution.

### Use Smart Selector <a href="#smart-selector" id="smart-selector"></a>

Harness AI employs advanced Smart Selector intelligence to accurately locate elements on the page. In resilient mode, it utilizes additional processing and matching techniques to improve the selection process. This includes generating all possible locator matches and selecting candidates with a confidence score of 0.8 or higher.

### Use additional waits and retries <a href="#additional-waits-and-retries" id="additional-waits-and-retries"></a>

To accommodate lazy or deferred element loading in certain applications, AI Test Automation incorporates extra waits and retries during the Smart Selector matching process. It will attempt the selection at least 2 times before proceeding, ensuring that elements are correctly identified.

### Review validation issues <a href="#validation-issues" id="validation-issues"></a>

In case AI Test Automation fails to find an element with a confidence score of at least 0.8, it flags those steps as validation issues. This allows you to examine and address any potential problems that may affect the reliability of your tests.

### Use automatic navigation waits <a href="#automatic-navigation-waits" id="automatic-navigation-waits"></a>

Harness AI Test Automation includes automatic navigation waits to ensure proper page loading and eliminate flaky test execution. It employs the following techniques:

#### Wait for pending network requests <a href="#wait-for-all-network-pending-requests-to-complete" id="wait-for-all-network-pending-requests-to-complete"></a>

Harness AI Test Automation waits for all network pending requests to be completed before proceeding. By waiting for the page to fully load, it prevents the execution of steps that could be affected by incomplete network requests, thus increasing the stability of your tests.

#### Flag pending network validation issues <a href="#flag-network-pending-validation-issues" id="flag-network-pending-validation-issues"></a>

If any network load requests fail to complete within 30 seconds, Harness AIT flags them as validation issues. This allows you to identify potential problems with network dependencies affecting the reliability of your tests.

#### Ignore third-party requests <a href="#ignore-third-party-requests" id="ignore-third-party-requests"></a>

Harness AI Test Automation automatically ignores multiple third-party requests made by applications, such as requests to Google Analytics. However, if your tests encounter navigation pending failures on a third-party site not automatically ignored by Harness AIT, you can manually add it to the ignore list.

### Scroll to elements <a href="#scrolls" id="scrolls"></a>

Harness AI Test Automation ensures that elements being scrolled into view are properly brought into focus, emulating human interaction. To achieve this, Harness AIT may need to locate the element using Smart Selectors, resulting in slightly longer scroll times. This additional work guarantees thorough testing and prevents misleading results.

### Use automatic validation <a href="#automatic-validation" id="automatic-validation"></a>

Automatic Validation, while not exclusively related to Resilient mode, is an important feature that contributes to the reliability of your tests. It involves additional processing time but offers significant benefits. Consider the following best practices:

#### Best practices <a href="#best-practices" id="best-practices"></a>

Follow these practices:

* Create Smaller Tests: Breaking down complex tests into smaller, focused ones improves test maintainability and reduces the likelihood of errors.
* Use Auto-Login: Decouple login steps by utilizing auto-login features. This enables tests to start from a logged-in state consistently, reducing the reliance on login steps and improving test efficiency.

By following these best practices and leveraging the resilience features of Harness AIT, you can create more robust and dependable test scripts that deliver accurate results.
