IOS test take 2 hours before throwing any exception

During IOS tests using XCUITest driver and WDA protocol, there’s 1 test where app crashes (we know about the crash) but Appium is behaving so strange, it keeps running for at least 1h 30 mins before throwing an error:

org.openqa.selenium.StaleElementReferenceException: The previously found element "Application 'com.test.app.test'" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: XCTPerformOnMainRunLoop work timed out after 60.0s
For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception

This happens despite us having set **"newCommandTimeout", 180**; and despite us using a Webdriver wait condition that throws an exception if element isn’t found after 1 minute.

Any idea why appium keeps running for 1 hour without throwing any exception to stop the test?

Appium dependency version:
io.appium
java-client
9.2.2

Appium version: 2.5.4, Xcuitest driver version: 5.0.0

Please provide the server and device log to see what exactly was happening after the app has crashed.
Also, please use the most recent xcuitest driver version. We do not apply patches to older versions.

@mykola-mokhnach From logs, it seems that newCommandTimeout Doesn’t work because WDA is actually not idle after the app Freezes, it keeps searching for elements hence it keeps going for hours.
The main issue is, after app Freezes, findElement endpoint suddenly takes too long to query it takes about 2 mins to query for a simple element. This only happens after app freezes.
Actual code snippet to test this issue:

   int x = 0;
        System.out.println("Searching for Ratings Popup or Order Details Page");
        while (x<9){
            if (!findAll(AppiumBy.iOSNsPredicateString("name == \"test_ids.components.navigation.close\"")).isEmpty()) {
                click(AppiumBy.iOSNsPredicateString("name == \"test_ids.components.navigation.close\""));
                try {
                    waitForInVisibilityOf(AppiumBy.iOSNsPredicateString("name == \"test_ids.components.navigation.close\""));
                }catch (NoSuchElementException ignored){}
                System.out.println("Closed Ratings Popup");
                break;
            } else if (!findAll(AppiumBy.iOSNsPredicateString("name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'")).isEmpty()) {
                System.out.println("Didn't find Ratings Popup, went straight to Order details page");
                break;
            } else {
                System.out.println("Cannot find neither Order Details Page nor Ratings Popup after Attempts: "+x);
                Thread.sleep(1000);
            }
            x++;
        }

Logs:

[Appium] Welcome to Appium v2.5.4
[Appium] Non-default server args:
[Appium] { address: '127.0.0.1',
[Appium]   allowCors: true,
[Appium]   allowInsecure: [ 'chromedriver_autodownload' ],
[Appium]   basePath: '/wd/hub/',
[Appium]   relaxedSecurityEnabled: true,
[Appium]   sessionOverride: true }
[Appium] The autodetected Appium home path: /Users/derrickhavrysh/.appium
[Appium] Attempting to load driver uiautomator2...
[Appium] Attempting to load driver chromium...
[Appium] Attempting to load driver xcuitest...
[Appium] Requiring driver at /Users/derrickhavrysh/.appium/node_modules/appium-uiautomator2-driver/build/index.js
[Appium] Requiring driver at /Users/derrickhavrysh/.appium/node_modules/appium-chromium-driver/index.js
[Appium] Requiring driver at /Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/build/index.js
[Appium] AndroidUiautomator2Driver has been successfully loaded in 4.636s
[Appium] ChromiumDriver has been successfully loaded in 4.636s
[Appium] XCUITestDriver has been successfully loaded in 4.636s
[Appium] You have enabled CORS requests from any host. Be careful not to visit sites which could maliciously try to start Appium sessions on your machine
[Appium] Appium REST http interface listener started on http://127.0.0.1:4723/wd/hub
[Appium] Available drivers:
[Appium]   - [email protected] (automationName 'UiAutomator2')
[Appium]   - [email protected] (automationName 'Chromium')
[Appium]   - [email protected] (automationName 'XCUITest')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[AppiumDriver@5374] Calling AppiumDriver.getStatus() with args: []
[AppiumDriver@5374] Responding to client with driver.getStatus() result: {"ready":true,"message":"The server is ready to accept new connections","build":{"version":"2.5.4"}}
[HTTP] <-- GET /wd/hub/status 200 10 ms - 110
[HTTP] 
Starting IOS Driver

Searching for Ratings Popup or Order Details Page
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == \"test_ids.components.navigation.close\"","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == \"test_ids.components.navigation.close\"","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == \"test_ids.components.navigation.close\""}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 304 ms - 12
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 249 ms - 12
[HTTP] 
Cannot find neither Order Details Page nor Ratings Popup after Attempts: 0
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == \"test_ids.components.navigation.close\"","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == \"test_ids.components.navigation.close\"","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == \"test_ids.components.navigation.close\""}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60037 ms - 12
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60032 ms - 12
[HTTP] 
Cannot find neither Order Details Page nor Ratings Popup after Attempts: 1
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == \"test_ids.components.navigation.close\"","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == \"test_ids.components.navigation.close\"","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == \"test_ids.components.navigation.close\""}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60025 ms - 12
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60039 ms - 12
[HTTP] 
Cannot find neither Order Details Page nor Ratings Popup after Attempts: 2
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == \"test_ids.components.navigation.close\"","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == \"test_ids.components.navigation.close\"","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == \"test_ids.components.navigation.close\""}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60028 ms - 12
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60036 ms - 12
[HTTP] 
Cannot find neither Order Details Page nor Ratings Popup after Attempts: 3
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == \"test_ids.components.navigation.close\"","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == \"test_ids.components.navigation.close\"","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == \"test_ids.components.navigation.close\""}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60046 ms - 12
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Cannot interrupt ffmpeg. Original error: Process didn't end after 10000ms (cmd: 'ffmpeg -f mjpeg -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 601 -i http\://127.0.0.1\:9100 -vcodec mpeg4 -y /var/folders/6x/w3zfdlys6ts9qm3182gnr9n40000gn/T/2024415-22076-1w2pbov.z1oz/appium_29e919.mp4')
[DevCon Factory] Releasing connections for C3F8AA12-6899-4A2C-907D-1E4E4E746762 device on 9100 port number
[DevCon Factory] Found cached connections to release: ["C3F8AA12-6899-4A2C-907D-1E4E4E746762:9100"]
[DevCon Factory] Cached connections count: 1
[XCUITestDriver@969f (70c5c57a)] Cannot finish the active screen recording on the device 'C3F8AA12-6899-4A2C-907D-1E4E4E746762' after 600000ms timeout
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60043 ms - 12
[HTTP] 
Cannot find neither Order Details Page nor Ratings Popup after Attempts: 4
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == \"test_ids.components.navigation.close\"","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == \"test_ids.components.navigation.close\"","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == \"test_ids.components.navigation.close\""}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60030 ms - 12
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60036 ms - 12
[HTTP] 
Cannot find neither Order Details Page nor Ratings Popup after Attempts: 5
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == \"test_ids.components.navigation.close\"","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == \"test_ids.components.navigation.close\"","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == \"test_ids.components.navigation.close\""}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60026 ms - 12
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60036 ms - 12
[HTTP] 
Cannot find neither Order Details Page nor Ratings Popup after Attempts: 6
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == \"test_ids.components.navigation.close\"","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == \"test_ids.components.navigation.close\"","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == \"test_ids.components.navigation.close\""}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60026 ms - 12
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60027 ms - 12
[HTTP] 
Cannot find neither Order Details Page nor Ratings Popup after Attempts: 7
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == \"test_ids.components.navigation.close\"","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == \"test_ids.components.navigation.close\"","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == \"test_ids.components.navigation.close\""}
[ffmpeg] [out#0/mp4 @ 0x7fcf3c906d40] video:26670kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.022662%
[ffmpeg] frame= 1141 fps=1.1 q=31.0 Lsize=   26676kB time=00:00:45.60 bitrate=4792.4kbits/s speed=0.0455x    
[ffmpeg] 
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60043 ms - 12
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElements() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElements'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/elements' to command name 'findElements'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /elements] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/elements] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 200: {"value":[],"sessionId":"D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC"}
[XCUITestDriver@969f (70c5c57a)] Responding to client with driver.findElements() result: []
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/elements 200 60032 ms - 12
[HTTP] 
Cannot find neither Order Details Page nor Ratings Popup after Attempts: 8
Exited Rating Popup Search
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/element
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElement() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElement'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/element' to command name 'findElement'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/element] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'predicate string', value 'name == 'test_ids.screens.checkout_confirmation.components.payment_address_value''","traceback":"(\n\t0   WebDriverAgentLib                   0x000000010dbb9fa2 FBNoSuchElementErrorResponseForRequest + 290\n\t1   WebDriverAgentLib                   0x000000010dbb9d84 +[FBFindElementCommands handleFindElement:] + 356\n\t2   WebDriverAgentLib                   0x000000010db7a78c -[FBRoute_TargetAction mountRequest:intoResponse:] + 172\n\t3   WebDriverAgentLib                   0x000000010db62de3 __37-[FBWebServer registerRouteHandlers:]_block_invoke + 499\n\t4   WebDriverAgentLib                   0x000000010db9da9d -[RoutingHTTPServer handleRoute:withRequest:response:] + 189\n\t5   WebDriverAgentLib                   0x000000010db9e891 __72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 65\n\t6   libdispatch.dylib                   0x00007ff80013ca3a _dispatch_cli...
[W3C] Matched W3C error code 'no such element' to NoSuchElementError
[XCUITestDriver@969f (70c5c57a)] Matched '/source?format=xml&scope=AppiumAUT' to command name 'getPageSource'
[XCUITestDriver@969f (70c5c57a)] Proxying [GET /source?format=xml&scope=AppiumAUT] to [GET http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/source?format=xml&scope=AppiumAUT] with no body
[ffmpeg] Exiting normally, received signal 2.
[ffmpeg] 
[XCUITestDriver@969f (70c5c57a)] Got response with status 404: {"value":{"error":"stale element reference","message":"The previously found element \"Application 'com.typology.app.preview'\" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: XCTPerformOnMainRunLoop work timed out after 60.0s","traceback":"(\n\t0   CoreFoundation                      0x00007ff8004288ab __exceptionPreprocess + 242\n\t1   libobjc.A.dylib                     0x00007ff80004dba3 objc_exception_throw + 48\n\t2   WebDriverAgentLib                   0x000000010dba9aa3 -[XCUIElement(FBUtilities) fb_takeSnapshot] + 723\n\t3   WebDriverAgentLib                   0x000000010dba9d57 -[XCUIElement(FBUtilities) fb_snapshotWithAttributes:maxDepth:] + 183\n\t4   WebDriverAgentLib                   0x000000010db5ab3a +[FBXPath writeXmlWithRootElement:indexPath:elementStore:includedAttributes:writer:] + 778\n\t5   WebDriverAgentLib                   0x000000010db5a17c +[FBXPath xmlRepresentationWithRootElement:writer:elementStore:query:excludin...
[W3C] Matched W3C error code 'stale element reference' to StaleElementReferenceError
[XCUITestDriver@969f (70c5c57a)] Encountered internal error running command: StaleElementReferenceError: The previously found element "Application 'com.typology.app.preview'" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: XCTPerformOnMainRunLoop work timed out after 60.0s
[XCUITestDriver@969f (70c5c57a)]     at errorFromW3CJsonCode (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/protocol/errors.js:1085:25)
[XCUITestDriver@969f (70c5c57a)]     at ProxyRequestError.getActualError (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/protocol/errors.js:954:14)
[XCUITestDriver@969f (70c5c57a)]     at JWProxy.command (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:353:19)
[XCUITestDriver@969f (70c5c57a)]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.proxyCommand (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:109:35)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.mobileGetSource (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/lib/commands/source.js:50:35)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.getPageSource (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/lib/commands/source.js:25:9)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.findElOrElsWithProcessing (/Users/derrickhavrysh/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:63:19)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.findElement (/Users/derrickhavrysh/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:75:12)
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/element 404 183206 ms - 1821
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/element
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElement() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElement'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/element' to command name 'findElement'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/element] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'predicate string', value 'name == 'test_ids.screens.checkout_confirmation.components.payment_address_value''","traceback":"(\n\t0   WebDriverAgentLib                   0x000000010dbb9fa2 FBNoSuchElementErrorResponseForRequest + 290\n\t1   WebDriverAgentLib                   0x000000010dbb9d84 +[FBFindElementCommands handleFindElement:] + 356\n\t2   WebDriverAgentLib                   0x000000010db7a78c -[FBRoute_TargetAction mountRequest:intoResponse:] + 172\n\t3   WebDriverAgentLib                   0x000000010db62de3 __37-[FBWebServer registerRouteHandlers:]_block_invoke + 499\n\t4   WebDriverAgentLib                   0x000000010db9da9d -[RoutingHTTPServer handleRoute:withRequest:response:] + 189\n\t5   WebDriverAgentLib                   0x000000010db9e891 __72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 65\n\t6   libdispatch.dylib                   0x00007ff80013ca3a _dispatch_cli...
[W3C] Matched W3C error code 'no such element' to NoSuchElementError
[XCUITestDriver@969f (70c5c57a)] Matched '/source?format=xml&scope=AppiumAUT' to command name 'getPageSource'
[XCUITestDriver@969f (70c5c57a)] Proxying [GET /source?format=xml&scope=AppiumAUT] to [GET http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/source?format=xml&scope=AppiumAUT] with no body
[XCUITestDriver@969f (70c5c57a)] Got response with status 404: {"value":{"error":"stale element reference","message":"The previously found element \"Application 'com.typology.app.preview'\" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: XCTPerformOnMainRunLoop work timed out after 60.0s","traceback":"(\n\t0   CoreFoundation                      0x00007ff8004288ab __exceptionPreprocess + 242\n\t1   libobjc.A.dylib                     0x00007ff80004dba3 objc_exception_throw + 48\n\t2   WebDriverAgentLib                   0x000000010dba9aa3 -[XCUIElement(FBUtilities) fb_takeSnapshot] + 723\n\t3   WebDriverAgentLib                   0x000000010dba9d57 -[XCUIElement(FBUtilities) fb_snapshotWithAttributes:maxDepth:] + 183\n\t4   WebDriverAgentLib                   0x000000010db5ab3a +[FBXPath writeXmlWithRootElement:indexPath:elementStore:includedAttributes:writer:] + 778\n\t5   WebDriverAgentLib                   0x000000010db5a17c +[FBXPath xmlRepresentationWithRootElement:writer:elementStore:query:excludin...
[W3C] Matched W3C error code 'stale element reference' to StaleElementReferenceError
[XCUITestDriver@969f (70c5c57a)] Encountered internal error running command: StaleElementReferenceError: The previously found element "Application 'com.typology.app.preview'" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: XCTPerformOnMainRunLoop work timed out after 60.0s
[XCUITestDriver@969f (70c5c57a)]     at errorFromW3CJsonCode (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/protocol/errors.js:1085:25)
[XCUITestDriver@969f (70c5c57a)]     at ProxyRequestError.getActualError (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/protocol/errors.js:954:14)
[XCUITestDriver@969f (70c5c57a)]     at JWProxy.command (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:353:19)
[XCUITestDriver@969f (70c5c57a)]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.proxyCommand (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:109:35)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.mobileGetSource (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/lib/commands/source.js:50:35)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.getPageSource (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/lib/commands/source.js:25:9)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.findElOrElsWithProcessing (/Users/derrickhavrysh/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:63:19)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.findElement (/Users/derrickhavrysh/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:75:12)
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/element 404 122154 ms - 1821
[HTTP] 
[HTTP] --> POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/element
[HTTP] {"value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","using":"-ios predicate string"}
[XCUITestDriver@969f (70c5c57a)] Calling AppiumDriver.findElement() with args: ["-ios predicate string","name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'","70c5c57a-1e35-4b91-93c2-80678d12f730"]
[XCUITestDriver@969f (70c5c57a)] Executing command 'findElement'
[XCUITestDriver@969f (70c5c57a)] Valid locator strategies for this request: xpath, id, name, class name, -ios predicate string, -ios class chain, accessibility id, css selector
[XCUITestDriver@969f (70c5c57a)] Waiting up to 0 ms for condition
[XCUITestDriver@969f (70c5c57a)] Matched '/element' to command name 'findElement'
[XCUITestDriver@969f (70c5c57a)] Proxying [POST /element] to [POST http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/element] with body: {"using":"predicate string","value":"name == 'test_ids.screens.checkout_confirmation.components.payment_address_value'"}
[XCUITestDriver@969f (70c5c57a)] Got response with status 404: {"value":{"error":"no such element","message":"unable to find an element using 'predicate string', value 'name == 'test_ids.screens.checkout_confirmation.components.payment_address_value''","traceback":"(\n\t0   WebDriverAgentLib                   0x000000010dbb9fa2 FBNoSuchElementErrorResponseForRequest + 290\n\t1   WebDriverAgentLib                   0x000000010dbb9d84 +[FBFindElementCommands handleFindElement:] + 356\n\t2   WebDriverAgentLib                   0x000000010db7a78c -[FBRoute_TargetAction mountRequest:intoResponse:] + 172\n\t3   WebDriverAgentLib                   0x000000010db62de3 __37-[FBWebServer registerRouteHandlers:]_block_invoke + 499\n\t4   WebDriverAgentLib                   0x000000010db9da9d -[RoutingHTTPServer handleRoute:withRequest:response:] + 189\n\t5   WebDriverAgentLib                   0x000000010db9e891 __72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 65\n\t6   libdispatch.dylib                   0x00007ff80013ca3a _dispatch_cli...
[W3C] Matched W3C error code 'no such element' to NoSuchElementError
[XCUITestDriver@969f (70c5c57a)] Matched '/source?format=xml&scope=AppiumAUT' to command name 'getPageSource'
[XCUITestDriver@969f (70c5c57a)] Proxying [GET /source?format=xml&scope=AppiumAUT] to [GET http://127.0.0.1:8100/session/D65C6FD6-393D-497B-9DA5-3FBA6E66E6DC/source?format=xml&scope=AppiumAUT] with no body
[XCUITestDriver@969f (70c5c57a)] Got response with status 404: {"value":{"error":"stale element reference","message":"The previously found element \"Application 'com.typology.app.preview'\" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: XCTPerformOnMainRunLoop work timed out after 60.0s","traceback":"(\n\t0   CoreFoundation                      0x00007ff8004288ab __exceptionPreprocess + 242\n\t1   libobjc.A.dylib                     0x00007ff80004dba3 objc_exception_throw + 48\n\t2   WebDriverAgentLib                   0x000000010dba9aa3 -[XCUIElement(FBUtilities) fb_takeSnapshot] + 723\n\t3   WebDriverAgentLib                   0x000000010dba9d57 -[XCUIElement(FBUtilities) fb_snapshotWithAttributes:maxDepth:] + 183\n\t4   WebDriverAgentLib                   0x000000010db5ab3a +[FBXPath writeXmlWithRootElement:indexPath:elementStore:includedAttributes:writer:] + 778\n\t5   WebDriverAgentLib                   0x000000010db5a17c +[FBXPath xmlRepresentationWithRootElement:writer:elementStore:query:excludin...
[W3C] Matched W3C error code 'stale element reference' to StaleElementReferenceError
[XCUITestDriver@969f (70c5c57a)] Encountered internal error running command: StaleElementReferenceError: The previously found element "Application 'com.typology.app.preview'" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: XCTPerformOnMainRunLoop work timed out after 60.0s
[XCUITestDriver@969f (70c5c57a)]     at errorFromW3CJsonCode (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/protocol/errors.js:1085:25)
[XCUITestDriver@969f (70c5c57a)]     at ProxyRequestError.getActualError (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/protocol/errors.js:954:14)
[XCUITestDriver@969f (70c5c57a)]     at JWProxy.command (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:353:19)
[XCUITestDriver@969f (70c5c57a)]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.proxyCommand (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/lib/commands/proxy-helper.js:109:35)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.mobileGetSource (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/lib/commands/source.js:50:35)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.getPageSource (/Users/derrickhavrysh/.appium/node_modules/appium-xcuitest-driver/lib/commands/source.js:25:9)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.findElOrElsWithProcessing (/Users/derrickhavrysh/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:63:19)
[XCUITestDriver@969f (70c5c57a)]     at XCUITestDriver.findElement (/Users/derrickhavrysh/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:75:12)
[HTTP] <-- POST /wd/hub/session/70c5c57a-1e35-4b91-93c2-80678d12f730/element 404 122075 ms - 1821
[HTTP]

I think there is no way to detect this situation from the WDA side. The lookup is performed by XCTest. We also confirm the app is running state, there is no flag to know that it’s frozen. And XCTest must wait until the app is in idle state.

Probably the only thing you can do to workaround it would be to analyse the actual error message and fail early if it contains XCTPerformOnMainRunLoop

in general these 2 min responses looks very slow…

1 Like

@Aleksei True, the 2 min responses are very strange only happen in this particular situation.
@mykola-mokhnach I can look for XCTPerformOnMainRunLoop message in the logs and throw an exception to stop the test but unfortunately that message is only displayed in the logs after exiting the loop meaning I will still need to wait for at least 20 mins before throwing the exception.

p.s
Thank you so much for responding and paying attention.

  1. what is your capabilities?
  2. do you have large page with many elements? take page source to see it

@Aleksei I can’t get the page source because this happens when the app is frozen and when I use iosDriver.getPageSource() i get this error:

org.openqa.selenium.StaleElementReferenceException: The previously found element "Application 'com.typography.app.preview'" is not present in the current view anymore. Make sure the application UI has the expected state. Original error: XCTPerformOnMainRunLoop work timed out after 60.0s

Capabilities:

DesiredCapabilities cap = new DesiredCapabilities();
        String udid = "C3F8AA12-6899-4A2C-907D-1E4E4E746762"; 
        cap.setCapability("deviceName","iPhone 12");
        cap.setCapability("udid",udid);
        cap.setCapability("platformVersion","16.2");

        cap.setCapability("deviceName","iPhone");
        cap.setCapability("udid",udid);
        cap.setCapability("platformVersion","16.2");

        cap.setCapability("platformName","IOS");
        cap.setCapability("bundleId",bundleID);
        cap.setCapability ("automationName", AutomationName.IOS_XCUI_TEST);
        cap.setCapability("connectHardwareKeyboard", true);
        cap.setCapability("maxTypingFrequency", 7);
        cap.setCapability("settings[reduceMotion]",true);
        List<String> argsArray = List.of("--args", "-CurrentDeviceUDID", udid,
                "defaults", "write", "com.apple.iphonesimulator", "UIAnimationCurveAnimationsEnabled","-bool","NO",
                "defaults", "write", "com.apple.iphonesimulator", "ReduceMotion", "-bool", "YES"); //- reduce motion
        cap.setCapability("processArguments", new ProcessArguments(argsArray, null));
        cap.setCapability("simpleIsVisibleCheck",true);
        cap.setCapability("noReset",true);
        cap.setCapability("newCommandTimeout", 180);
        cap.setCapability("includeSafariInWebviews",true);
        cap.setCapability("showXcodeLog",false);
        cap.setCapability("waitForQuiescence",false);
        cap.setCapability("printPageSourceOnFindFailure",true);
        cap.setCapability("shouldTerminateApp",true);

try:

  1. remove printPageSourceOnFindFailure. Why you need pagesource with EVERY!!! find element fail?
  2. remove simpleIsVisibleCheck → per doc In some cases this takes a long time
  3. waitForQuiescence' migrate to settings -> per doc: Consider using waitForIdleTimeout capability instead for this purpose since Appium 1.20.0`
  4. Just in case I use following settings which applying after driver started
    Settings - Appium XCUITest Driver
Map<String, Object> mapSettings = new HashMap<>();
mapSettings.put("animationCoolOffTimeout", 0); // default: 2 sec
mapSettings.put("snapshotMaxDepth", 42); // default: 50
mapSettings.put("waitForIdleTimeout", 0); // default: 10 sec
mapSettings.put("reduceMotion", true); // default: false
mapSettings.put("customSnapshotTimeout", 20); // default: 15 sec
driver.setSettings(mapSettings);
  1. change logic how you find that element visible!
    5.1 do not user findAll cause it times slower. user simple find instead
    5.2 user better logic fast try to tap on ...close and fast check ...payment_address_value loaded
    how I do it
        long startTime = System.currentTimeMillis();
        do {
            setLookTiming(1);
            // here fast check that something needed loaded
            if (super.isLoaded(mainContainer))
                break;
            // here something roadblocking to tap and close it
            if (isIOS)
                permissionPage.allowPermission(1);
        } while (System.currentTimeMillis() < (startTime + sec * 1000)); // sec
1 Like

@Aleksei Thank you so much I will try your approach and let you know how it. Once more thank you and man I am a big fan of your work. Keep it up!