Appium terminates session abruptly

i am trying to run tests for real device on sauce labs and there are few issues i am facing

  1. Appium abruptly gets stuck in between appears to have stopped without any failure and it tries to wait for some alert? but in our application we are not waiting for any alert

for example after looking for an element it has to tap on that element so it tries to find the location but suddenly it is looking for alert modal window which we have not scripted.

here are the logs

00:43:57 V [debug] [MJSONWP (e592bfa5)] Calling AppiumDriver.getLocation() with args: [“5158”,“e592bfa5-bec8-4e8a-b7f6-65e9b6cd4147”]
00:43:57 V [debug] [XCUITest] Executing command ‘getLocation’
00:43:57 V [debug] [RemoteDebugger] Executing atom ‘get_top_left_coordinates’ with ‘args=[{“ELEMENT”:":wdc:1645404121898"}]; frames=’
00:43:57 V [debug] [RemoteDebugger] Executing ‘get_top_left_coordinates’ atom in default context
00:43:57 V [debug] [RemoteDebugger] Sending javascript command: ‘(function(){return function(){var h,l=this;func…’
00:43:57 V [debug] [RemoteDebugger] Sending ‘_rpc_forwardSocketData:’ message to app ‘PID:69738’, page ‘1’, target ‘page-12’ (id: 830): ‘Runtime.evaluate’
00:43:58 V [debug] [XCUITest] Setting custom timeout to 60000 ms for ‘getAlertText’ command
00:43:58 V [debug] [WD Proxy] Matched ‘/alert/text’ to command name ‘getAlertText’
00:43:58 V [debug] [WD Proxy] Proxying [GET /alert/text] to [GET http://127.0.0.1:5711/session/B2DB2ED9-720E-4888-98B7-E586471744F9/alert/text] with no body
00:43:58 V [WD Proxy] Got response with status 404: {“value”:{“error”:“no such alert”,“message”:“An attempt was made to operate on a modal dialog when one was not open”,“traceback”:""},“sessionId”:“B2DB2ED9-720E-4888-98B7-E586471744F9”}
00:43:58 V [debug] [W3C] Matched W3C error code ‘no such alert’ to NoSuchAlertError

is this internally from appium? how can we avoid this?

  1. When i try to run with latest appium version 1.21.1 or 1.22.2

i get Appium did not get any response from ‘getScreenInfo’ command in 60000 ms (WARNING: The server did not provide any stack trace information)

i am passing capabilities like
{
“platformName”: “iOS”,
“platformVersion”: “14”,
“deviceName”: “(iPhone)(((?!(?i)SE).)*$)”,
“deviceOrientation”: “portrait”,
“app”: “storage:filename=SAPAnalyticiOS-Debug-2022.04.ipa”,
“appiumVersion”: “1.21.1”,
“autoAcceptAlerts”: true,
“tunnelIdentifier”: “",
“parentTunnel”: "
***”,
“commandTimeout”: 600,
“idleTimeout”: 1000
}
some info has been hidden due to privacy concern

please help this has been causing flaky tests :frowning:
Thanks in advance!

what is it :slight_smile: ? check it.

Hello, thank you for response. commandTimeout was set to resolve this problem, i was suggested to keep it maximum than default and from documents i saw max was 600 still i see this issue.

Just cant find it here https://github.com/appium/appium-xcuitest-driver#desired-capabilities

But is see ‘commandTimeouts’ where e.g. 1000 = 1sec

ohh ok thank you very much, i think i checked sauce labs documentation were they mentioned it is in seconds and they say max seconds is 600 so i will try this one now. thanks a lot! i think this got me confused because there document talks of different values.

https://github.com/appium/appium/issues/16222 contains an explanation of the alert checking requests

Thank you for this explaination, one question the completion time of atom suppose - findElements if one single findElements command is not completed in a second then this alert issue happens? what if i have explicit waits to keep waiting for elements in that case this should not occur right? does one way to avoid this problem would be to increase timeouts