Hey Team,
I have been working on Appium based test automation suite. I have been successfully able to run automation tests on Sauce labs on iOS & Android with no issues before. But this week, for some reason, the tests on Sauce Labs iOS (real devices) is timing out whereas Android is working fine. The same error is replicated whether I initiate the tests locally or through Github actions.
I made no code changes nor updates. Not sure why the code stopped working. I have been browsing for any known issues, but couldnât find any.
Hereâs a snippet of the driver factory code,
case "sauce_iOS":
capabilities = new MutableCapabilities();
capabilities.setCapability("appium:automationName", "XCUITEST");
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("appium:platformVersion", "17");
capabilities.setCapability("appium:deviceName", "iPhone 14 Plus");
//capabilities.setCapability("appium:udid", AppConstants.IOS.SAUCE_IOS_REAL_DEVICE_UDID);
capabilities.setCapability("appium:deviceOrientation", "PORTRAIT");
capabilities.setCapability("appium:fullReset", true);
capabilities.setCapability("appium:waitForIdleTimeout", 300);
capabilities.setCapability("appium:wdaLaunchTimeout", 50000);
capabilities.setCapability("appium:shouldUseSingletonTestManager", false);
capabilities.setCapability("appium:showXcodeLog", true);
capabilities.setCapability("appium:showIOSLog", true);
// capabilities.setCapability("appium:systemPort", 8209);
capabilities.setCapability("appium:commandTimeouts", 120000);
capabilities.setCapability("appium:newCommandTimeout", 90);
if (AppConstants.MOBILEEXECUTIONTYPE.equalsIgnoreCase("App")) {
capabilities.setCapability("appium:useNativeCachingStrategy", false);
if(AppConstants.IOS.SAUCE_IOS_APP.equalsIgnoreCase("latest")) {
capabilities.setCapability("appium:app", "storage:filename=**-beta.ipa");
} else {
capabilities.setCapability("appium:app", AppConstants.IOS.SAUCE_IOS_APP);
}
capabilities.setCapability("appium:includeSafariInWebviews", true);
capabilities.setCapability("appium:webviewConnectTimeout", 30000);
capabilities.setCapability("appium:fullContextList", true);
capabilities.setCapability("appium:webkitResponseTimeout", 60000);
} else {
capabilities.setCapability("browserName", "safari");
switch (AppConstants.IOS.SAUCE_IOS_BROWSERNAME.toLowerCase()) {
case "safari":
WebDriverManager.safaridriver().clearResolutionCache().setup();
break;
default:
System.out.println("Incorrect web browser for iOS");
}
}
sauceOptions = new HashMap<String, Object>();
sauceOptions.put("appiumVersion","latest");
sauceOptions.put("username", AppConstants.SauceLabs.SAUCE_USERNAME);
sauceOptions.put("accessKey", AppConstants.SauceLabs.SAUCE_ACCESS_KEY);
sauceOptions.put("build", "appium-build-***");
capabilities.setCapability("sauce:options", sauceOptions);
try {
driver = new IOSDriver(new URI("https://ondemand.us-west-1.saucelabs.com:443/wd/hub").toURL(), capabilities);
} catch (Exception e) {
System.out.println("*** Problem to create the IOS driver " + e.getMessage());
throw e;
}
break;
Following is the error,
Jun 13, 2024 12:16:10 PM org.openqa.selenium.remote.ErrorCodes toStatus
INFO: HTTP Status: '408' -> incorrect JSON status mapping for 'timeout' (500 expected)
Then user sees Digital Ordering Sales metric on Metrics Summary Page # stepdefinitions.CFANowMetricsTestSteps.scrollToDigitalOrderingSalesMetricTest()
org.openqa.selenium.TimeoutException: Appium did not get any response from 'findElement' command in 90000 ms
Build info: version: '4.16.1', revision: '9b4c83354e'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.5', java.version: '22.0.1'
Driver info: io.appium.java_client.ios.IOSDriver
Command: [c8cd5f9a-7cdc-4811-8c0d-16609457a72b, findElement {using=xpath, value=//XCUIElementTypeWindow[1]//XCUIElementTypeScrollView//XCUIElementTypeStaticText[last()-1]}]
Capabilities {appium:additionalWebviewBundleIds: [M89Z3BYKYV.M89Z3BYKYV*], appium:appiumData: {appiumVersion: latest, automationName: XCUITEST}, appium:automationName: XCUITEST, appium:bundleId: com.cfahome.atcfanow.test, appium:commandTimeouts: {default: 90000}, appium:databaseEnabled: false, appium:deviceContextId: 2b659077-c425-4af2-9b09-e34..., appium:deviceName: 00008110-00092CAA1E09401E, appium:deviceOrientation: PORTRAIT, appium:fullContextList: true, appium:includeSafariInWebviews: true, appium:javascriptEnabled: true, appium:jobUuid: 80eac71a7cfd4d66a05044d014a..., appium:language: en, appium:locale: en_GB, appium:locationContextEnabled: false, appium:networkConnectionEnabled: false, appium:newCommandTimeout: 90, appium:noReset: true, appium:orientation: PORTRAIT, appium:platformVersion: 17.3, appium:processArguments: {args: [], env: {}}, appium:shouldUseSingletonTestManager: false, appium:showIOSLog: true, appium:showXcodeLog: true, appium:takesScreenshot: true, appium:testobject_device: iPhone_14_Plus_17_real_sjc1_1, appium:testobject_device_name: iPhone 14 Plus, appium:testobject_device_session_id: a323e87c-55d1-4f84-b3b2-1d5..., appium:testobject_test_report_api_url: https://api.us-west-1.sauce..., appium:testobject_test_report_url: https://app.saucelabs.com/t..., appium:testobject_user_id: chickfila_admin, appium:udid: 00008110-00092CAA1E09401E, appium:useNativeCachingStrategy: false, appium:usedCachedDevice: false, appium:waitForIdleTimeout: 300, appium:wdaLaunchTimeout: 50000, appium:webDriverAgentUrl: http://127.0.0.1:5721, appium:webStorageEnabled: false, appium:webkitResponseTimeout: 60000, appium:webviewConnectTimeout: 30000, platformName: IOS, sauce:options: {accessKey: 8606cbaf-4bdb-4510-ad80-dde..., appLaunchStateTimeoutSec: 50, appiumVersion: latest, build: appium-build-6YOQR, realDevice: true, username: sso-chick-fil-a-nitya.jakkam1}}
Session ID: c8cd5f9a-7cdc-4811-8c0d-16609457a72b
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:52)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:191)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:238)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:523)
at org.openqa.selenium.remote.ElementLocation$ElementFinder$2.findElement(ElementLocation.java:165)
at org.openqa.selenium.remote.ElementLocation.findElement(ElementLocation.java:59)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:354)
at org.cfa.cfanow.pages.BasePage.scrollToElement(BasePage.java:442)
at org.cfa.cfanow.pages.BasePage.scrollToElement(BasePage.java:427)
at org.cfa.cfanow.pages.MetricsPage.scrollToDigitalOrderingSalesCell(MetricsPage.java:957)
at stepdefinitions.CFANowMetricsTestSteps.scrollToDigitalOrderingSalesMetricTest(CFANowMetricsTestSteps.java:443)
at â˝.user sees Digital Ordering Sales metric on Metrics Summary Page(file:///Users/nityajaakkam/eclipse-workspace/cfaNow-AppiumTests/src/test/resources/Features/Metrics.feature:1376)
And verify Digital Ordering Sales metric tile elements # stepdefinitions.CFANowMetricsTestSteps.verifyDigitalOrderingSalesMetricTile()
org.openqa.selenium.NoSuchSessionException: A session is either terminated or not started
Build info: version: '4.16.1', revision: '9b4c83354e'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.5', java.version: '22.0.1'
Driver info: io.appium.java_client.ios.IOSDriver
Command: [c8cd5f9a-7cdc-4811-8c0d-16609457a72b, screenshot {}]
Capabilities {appium:additionalWebviewBundleIds: [M89Z3BYKYV.M89Z3BYKYV*], appium:appiumData: {appiumVersion: latest, automationName: XCUITEST}, appium:automationName: XCUITEST, appium:bundleId: com.cfahome.atcfanow.test, appium:commandTimeouts: {default: 90000}, appium:databaseEnabled: false, appium:deviceContextId: 2b659077-c425-4af2-9b09-e34..., appium:deviceName: 00008110-00092CAA1E09401E, appium:deviceOrientation: PORTRAIT, appium:fullContextList: true, appium:includeSafariInWebviews: true, appium:javascriptEnabled: true, appium:jobUuid: 80eac71a7cfd4d66a05044d014a..., appium:language: en, appium:locale: en_GB, appium:locationContextEnabled: false, appium:networkConnectionEnabled: false, appium:newCommandTimeout: 90, appium:noReset: true, appium:orientation: PORTRAIT, appium:platformVersion: 17.3, appium:processArguments: {args: [], env: {}}, appium:shouldUseSingletonTestManager: false, appium:showIOSLog: true, appium:showXcodeLog: true, appium:takesScreenshot: true, appium:testobject_device: iPhone_14_Plus_17_real_sjc1_1, appium:testobject_device_name: iPhone 14 Plus, appium:testobject_device_session_id: a323e87c-55d1-4f84-b3b2-1d5..., appium:testobject_test_report_api_url: https://api.us-west-1.sauce..., appium:testobject_test_report_url: https://app.saucelabs.com/t..., appium:testobject_user_id: chickfila_admin, appium:udid: 00008110-00092CAA1E09401E, appium:useNativeCachingStrategy: false, appium:usedCachedDevice: false, appium:waitForIdleTimeout: 300, appium:wdaLaunchTimeout: 50000, appium:webDriverAgentUrl: http://127.0.0.1:5721, appium:webStorageEnabled: false, appium:webkitResponseTimeout: 60000, appium:webviewConnectTimeout: 30000, platformName: IOS, sauce:options: {accessKey: 8606cbaf-4bdb-4510-ad80-dde..., appLaunchStateTimeoutSec: 50, appiumVersion: latest, build: appium-build-6YOQR, realDevice: true, username: sso-chick-fil-a-nitya.jakkam1}}
Session ID: c8cd5f9a-7cdc-4811-8c0d-16609457a72b
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:52)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:191)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:238)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:523)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:596)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:307)
at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:326)
at io.appium.java_client.AppiumDriver.getScreenshotAs(AppiumDriver.java:316)
at stepdefinitions.CommonSteps.takeScreenshotOnFailure(CommonSteps.java:119)
org.openqa.selenium.NoSuchSessionException: A session is either terminated or not started
Build info: version: '4.16.1', revision: '9b4c83354e'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.5', java.version: '22.0.1'
Driver info: io.appium.java_client.ios.IOSDriver
Command: [c8cd5f9a-7cdc-4811-8c0d-16609457a72b, quit {}]
Capabilities {appium:additionalWebviewBundleIds: [M89Z3BYKYV.M89Z3BYKYV*], appium:appiumData: {appiumVersion: latest, automationName: XCUITEST}, appium:automationName: XCUITEST, appium:bundleId: com.cfahome.atcfanow.test, appium:commandTimeouts: {default: 90000}, appium:databaseEnabled: false, appium:deviceContextId: 2b659077-c425-4af2-9b09-e34..., appium:deviceName: 00008110-00092CAA1E09401E, appium:deviceOrientation: PORTRAIT, appium:fullContextList: true, appium:includeSafariInWebviews: true, appium:javascriptEnabled: true, appium:jobUuid: 80eac71a7cfd4d66a05044d014a..., appium:language: en, appium:locale: en_GB, appium:locationContextEnabled: false, appium:networkConnectionEnabled: false, appium:newCommandTimeout: 90, appium:noReset: true, appium:orientation: PORTRAIT, appium:platformVersion: 17.3, appium:processArguments: {args: [], env: {}}, appium:shouldUseSingletonTestManager: false, appium:showIOSLog: true, appium:showXcodeLog: true, appium:takesScreenshot: true, appium:testobject_device: iPhone_14_Plus_17_real_sjc1_1, appium:testobject_device_name: iPhone 14 Plus, appium:testobject_device_session_id: a323e87c-55d1-4f84-b3b2-1d5..., appium:testobject_test_report_api_url: https://api.us-west-1.sauce..., appium:testobject_test_report_url: https://app.saucelabs.com/t..., appium:testobject_user_id: chickfila_admin, appium:udid: 00008110-00092CAA1E09401E, appium:useNativeCachingStrategy: false, appium:usedCachedDevice: false, appium:waitForIdleTimeout: 300, appium:wdaLaunchTimeout: 50000, appium:webDriverAgentUrl: http://127.0.0.1:5721, appium:webStorageEnabled: false, appium:webkitResponseTimeout: 60000, appium:webviewConnectTimeout: 30000, platformName: IOS, sauce:options: {accessKey: 8606cbaf-4bdb-4510-ad80-dde..., appLaunchStateTimeoutSec: 50, appiumVersion: latest, build: appium-build-6YOQR, realDevice: true, username: sso-chick-fil-a-nitya.jakkam1}}
Session ID: c8cd5f9a-7cdc-4811-8c0d-16609457a72b
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:200)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:133)
at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:52)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:191)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:238)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:523)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:596)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:307)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:438)
at stepdefinitions.CommonSteps.afterScenario(CommonSteps.java:106)
In addition to the automation test failing, I notice that the Appium Inspector session with Sauce Labs iOS is timing out within 2 minutes. This was not the case before.
Not sure why this issue is only on iOS and suddenly showing up despite no code change.
Only notable changes were:
- Appium version update - [[email protected]] but when downgraded to [email protected], still facing the issue
- Enabled Zscaler on our systems that initially caused SSL errors which were rectified by the team