# Alternative approaches to Smart Wait for Edge InPrivate

**URL:** <https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [June 19, 2025, 10:41am UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524 "2025-06-19T10:41:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaneloftus](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/shaneloftus/32/23869_2.png) [@shaneloftus](https://forum.katalon.com/u/shaneloftus)\
**Post date:** [June 19, 2025, 10:41am UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524/1 "2025-06-19T10:41:19Z")

</div>

We use Microsoft single sign-on for most of our web applications. This means we need to launch Edge in InPrivate mode so that we’re prompted for username and password (we use a variety of active directory accounts for testing).

Launching Edge in InPrivate mode comes with the significant drawback of not being able to utilise Smart Wait.

Is there any alternative approaches that could be used, besides adding ‘WebUI.waitForElementVisible’, ‘WebUI.waitForElementClickable’ etc. test steps?

To be honest, we find these types of methods fairly flaky for waiting for a webpage to be fully loaded, compared to Smart Wait.

---

<div class="post-metadata">

**Author:** ![Monty\_Bagati](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/monty_bagati/32/33047_2.png) [@Monty\_Bagati](https://forum.katalon.com/u/Monty_Bagati)\
**Post date:** [June 19, 2025, 10:43am UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524/2 "2025-06-19T10:43:06Z")

</div>

try to open edge in guestmode

options.addArguments(“–guest”)

---

<div class="post-metadata">

**Author:** ![dineshh](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dineshh/32/24488_2.png) [@dineshh](https://forum.katalon.com/u/dineshh)\
**Post date:** [June 20, 2025, 5:55am UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524/3 "2025-06-20T05:55:40Z")

</div>

## **1. Enhanced Explicit Waits with Fluent Conditions**

Instead of generic `waitForElementVisible`, create **custom wait methods** that combine multiple conditions for robustness:

```auto
// Custom wait for critical elements to be fully interactive
def waitForPageStability(TestObject to, int timeout = 30) {
    WebUI.waitForElementPresent(to, timeout)
    WebUI.waitForElementClickable(to, timeout)
    WebUI.waitForElementNotHasAttribute(to, "disabled", timeout)
}

```

**Usage:**  
`waitForPageStability(findTestObject('LoginPage/btnSubmit'), 45)`

* * *

## **2. Page Ready State + Network Idle Detection**

Use JavaScript to monitor both DOM readiness **and** network activity:

groovy

```auto
@Keyword
def waitForPageComplete(int timeout = 30) {
    WebDriver driver = DriverFactory.getWebDriver()
    WebUI.waitForCondition(
        { 
            ((JavascriptExecutor) driver).executeScript(
                "return document.readyState === 'complete' && " +
                "window.performance.getEntriesByType('navigation')[0].responseEnd > 0 && " +
                "window.performance.getEntriesByType('resource').filter(r => r.requestStart > (performance.now() - 1000)).length === 0"
            ) == true
        }, 
        timeout
    )
}

```

**Triggers when:**

- DOM is fully loaded
- No network calls in last 1 second
- Page rendering is complete

* * *

## **3. Application-Specific Load Triggers**

Leverage your app’s unique indicators:

groovy

```auto
// Wait for Angular apps
WebUI.waitForAngularLoad(30)

// Wait for React hydration
WebUI.waitForElementHasAttribute(findTestObject('AppRoot'), 'data-hydrated', 30)

// Wait for loader disappearance
WebUI.waitForElementNotPresent(findTestObject('Spinner'), 30)

```

* * *

## **4. Dynamic Polling with Retry Logic**

Implement adaptive waits with exponential backoff:

groovy

```auto
@Keyword
def smartWaitForElement(TestObject to, int maxTimeout = 60) {
    int attempts = 0
    int delay = 2
    while (attempts < (maxTimeout/delay)) {
        try {
            WebUI.verifyElementPresent(to, 1)
            return
        } catch (Exception e) {
            sleep(delay * 1000)
            delay = Math.min(delay * 1.5, 5) // Cap at 5s intervals
            attempts++
        }
    }
    throw new Exception("Element not found after ${maxTimeout} seconds")
}

```

* * *

## **5. Browser-Level Monitoring**

Force-enable Smart Wait compatibility via Edge policies (requires admin rights):

1. Create Registry Key:  
`HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionSettings`
2. Add policy to allow extensions in InPrivate:

json

```auto
{
  "*": {
    "allowed_in_incognito": true,
    "runtime_allowed_hosts": ["*"]
  }
}

```

1. Re-launch Edge with `--enable-extensions` flag in Katalon:

groovy

```auto
EdgeOptions options = new EdgeOptions()
options.addArguments("inprivate", "enable-extensions", "load-extension=/path/to/katalon/smartwait")
WebUI.openBrowser('', options)

```

* * *

## **6. Hybrid Wait Strategy**

Combine multiple approaches for maximum reliability:

groovy

```auto
def safeInteraction(TestObject to) {
    waitForPageComplete(20) // JS-level readiness
    waitForPageStability(to, 10) // Element-specific checks
    WebUI.click(to) // Final action
}

```

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [June 21, 2025, 2:04pm UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524/5 "2025-06-21T14:04:38Z")

</div>

> [@shaneloftus](#):
>
> Excellent suggestion

Which one was excellent?

Monty’s suggestion?

or any of dineshh’s suggestions?

---

<div class="post-metadata">

**Author:** ![shaneloftus](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/shaneloftus/32/23869_2.png) [@shaneloftus](https://forum.katalon.com/u/shaneloftus)\
**Post date:** [June 23, 2025, 11:36am UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524/7 "2025-06-23T11:36:24Z")

</div>

After a bit more investigation, it doesn’t seem the Smart Wait extension works properly in guest mode. Certain test steps still attempt to execute before the page is fully loaded. The same test scripts work perfectly in a normal browser window (i.e. not using In Private mode).

---

<div class="post-metadata">

**Author:** ![shaneloftus](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/shaneloftus/32/23869_2.png) [@shaneloftus](https://forum.katalon.com/u/shaneloftus)\
**Post date:** [June 25, 2025, 9:42am UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524/8 "2025-06-25T09:42:59Z")

</div>

Bit more information here. As you can see, ‘Extensions’ is disabled in Edge guest mode:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/8/b/8b93573ad1a6e874b66f9ef6e116b09629d39654.png)

We’re not opposed to using Chrome in incognito mode, and extensions do seem to be enabled in that mode, but we still see flakiness with our tests in this mode:

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/4/1/41093ed881cfecb545cb087574587fa9ebefe01e.png)

---

<div class="post-metadata">

**Author:** ![depapp](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/depapp/32/29178_2.png) [@depapp](https://forum.katalon.com/u/depapp)\
**Post date:** [October 1, 2026, 4:08am UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524/9 "2026-10-01T04:08:36Z")

</div>

@shaneloftus which studio version are you on? the extension limitation you hit in inprivate / guest is a 9.x thing. from 10.0.0 smart wait talks to chrome and edge over webdriver bidi, no unpacked extension anymore, so a private window does not disable it. katalon docs say this on the smart wait page, with one caveat: it needs the `webSocketUrl` capability on, so make sure nobody set `"webSocketUrl": false` in your desired capabilities.

if you have to stay on 9.x, the other trick is to not use inprivate at all and give every run a throwaway profile instead:

```groovy
import com.kms.katalon.core.configuration.RunConfiguration
import com.kms.katalon.core.webui.driver.DriverFactory

File tmp = File.createTempDir()
RunConfiguration.setWebDriverPreferencesProperty('args', ['--user-data-dir=' + tmp.absolutePath])
WebUI.openBrowser('')

```

a fresh user-data-dir has no sso cookies, so you still get the username and password prompt for whichever ad account you want, and extensions load normally because it is a regular window. you can delete the folder in a teardown.

---

<div class="post-metadata">

**Author:** ![dineshh](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dineshh/32/24488_2.png) [@dineshh](https://forum.katalon.com/u/dineshh)\
**Post date:** [October 27, 2026, 6:21am UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524/10 "2026-10-27T06:21:01Z")

</div>

hope you are able to find any workaround?

---

<div class="post-metadata">

**Author:** ![arvind.choudhary](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arvind.choudhary/32/33165_2.png) [@arvind.choudhary](https://forum.katalon.com/u/arvind.choudhary)\
**Post date:** [October 27, 2026, 7:57am UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524/11 "2026-10-27T07:57:01Z")

</div>

Hi @shaneloftus whether any of the suggested solutions provided in the thread worked?

---

<div class="post-metadata">

**Author:** ![arvind.choudhary](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arvind.choudhary/32/33165_2.png) [@arvind.choudhary](https://forum.katalon.com/u/arvind.choudhary)\
**Post date:** [October 27, 2026, 7:57am UTC](https://forum.katalon.com/t/alternative-approaches-to-smart-wait-for-edge-inprivate/176524/12 "2026-10-27T07:57:36Z")

</div>

Please share the feedback as it helps other who come across the same issue
