Set Page load timeout for IOS Devices

Hello everyone!
When executing tests, I need to stop page loading as soon as it begins in order to avoid redirection and set cookies on the website domain for further session.
On android devices it works perfectly well with classic driver.manage().timeouts().pageLoadTimeout(), however it seems that on IOS devices that method does not work, and what is more interesting, cookies can be set on another domain without throwing exception as it happens on android/desktop chrome.
Are there any alternatives to that method for IOS devices? Setting appium:commandTimeouts capability won’t help here as I need to set page load timeout only for one particular method call (for the first website opening). Thanks in advance!

If you are only interested in web pages automation using iOS Safari browser then you could try https://github.com/appium/appium-safari-driver

Hi, Mykola! Thank you for the reply. As far I understand, SafariDriver can only be launched on Mac OS. If so, that is not acceptable as our project uses Windows 10, any alternatives?

You need a Mac to automate iOS devices because Apple requires it.

xcuitest driver works only on macOS as well. So there is not much choice.

Thanks for the reply, but it seems that SafariDriver is not the best choice in my situation, because I use SauceLabs for remote automation runs, and therefore Appium with xcuitestdriver is required.

if (BrowserUtils.isBrowserSafari()) {
            driver.navigate().to(url);
            seleniumCookies.forEach(cookie -> driver.manage().addCookie(cookie));
            waitFor(5);
        } else {
            try {
                driver.manage().timeouts().pageLoadTimeout(timeout, TimeUnit.MILLISECONDS);
            } catch (TimeoutException e) {
                seleniumCookies.forEach(cookie -> driver.manage().addCookie(cookie));
                LOGGER.info("Cookies were successfully added to {} domain", url);
            }
            driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS);
        }

here is a sample code I use so that you can understand what I desire to do. This code snippet works perfecrly well on android, however on Iphone page simply does not stop loading in spite of page load timeout set to 1 second.

Hi, tried upgrading to selenium 4 and appium 8 beta. However, the issue is still relevant. When using IosDriver, driver.manage().timeouts().pageLoadTimeout() method does not actuaaly work and driver does not throw TimeoutException, page loads as normal. Using SafariDriver isn’t relevant because it is not supported by saucelabs.