appium: Always Getting 'createSession' Error When Popup Alert Appears Before Installing WDA

Do I have the most recent component updates?

  • I use the most recent available driver/plugin and server versions

Is the component officially supported by the Appium team?

  • I have verified the component repository is present under the Appium organization in GitHub

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I always get the following error: java.lang.RuntimeException: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 408. Message: Appium did not get any response from the 'createSession' command in 30000 ms

when the WebDriverAgent is trying to install and when the permission dialog is showing.

Expected Behavior

When installing WDA, it will install normally, and the scenarios can run well.

Minimal Reproducible Example

  1. Keep the Popup Alert still showing
  2. Run Appium and Run the scenario’s
  3. When WDA Trying to install, it will blank screen or in several cases it will also open the apps but cannot interact with the PopUp Alerts (I also using autoAcceptAlerts) and then get createSession errors

Environment

  • Operating system: MacOS Sonoma
  • Appium server version (output of appium --version): 2.9.0
  • Appium driver(s) and their version(s) (appium driver list): XCUITest 7.17.4
  • Appium plugin(s) and their version(s) (appium plugin list):
  • Node.js version (output of node --version): 16.5.1
  • npm version (output of npm --version): 8.11.0
  • Last component(s) version which did not exhibit the problem:
  • Platform and version under test: iPhone iOS 16 and iOS 17
  • Real device or emulator/simulator: Real Devices

Link to Appium Logs

No response

Further Information

The popup alerts look like:

Screenshot 2024-06-20 at 1 16 09 PM

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

It looks like UI testing process itself failed to initialize by the system. It could be not Appimm WDA specific but more general UI testing related behavior, I guess.

3|appium bibit 3  | [IOSDeviceLog] Jun 24 10:04:11 iPhone-2 WebDriverAgentRunner-Runner(XCUIAutomation)[24467] <Error>: Failed to initialize for UI testing: Error Domain=com.apple.dt.xctest.ui-testing.error Code=10300 "Failed to background test runner within 30.0s." UserInfo={screenshot-data={length = 7507, bytes = 0x00000024 66747970 68656963 00000000 ... 02a60000 03000724 }, NSLocalizedDescription=Failed to background test runner within 30.0s.}
3|appium bibit 3  | [IOSDeviceLog] Jun 24 10:04:11 iPhone-2 WebDriverAgentRunner-Runner(CoreAnalytics)[24467] <Notice>: Entering exit handler.
3|appium bibit 3  | [IOSDeviceLog] Jun 24 10:04:11 iPhone-2 WebDriverAgentRunner-Runner(CoreAnalytics)[24467] <Notice>: Queueing exit procedure onto XPC queue. Any further messages sent will be discarded. activeSendTransactions=0
3|appium bibit 3  | [IOSDeviceLog] Jun 24 10:04:11 iPhone-2 WebDriverAgentRunner-Runner(CoreAnalytics)[24467] <Notice>: Cancelling XPC connection. Any further reply handler invocations will not retry messages
3|appium bibit 3  | [IOSDeviceLog] Jun 24 10:04:11 iPhone-2 WebDriverAgentRunner-Runner(libxpc.dylib)[24467] <Notice>: [0x2810b0000] invalidated on xpc_connection_cancel()
3|appium bibit 3  | [IOSDeviceLog] Jun 24 10:04:11 iPhone-2 WebDriverAgentRunner-Runner(CoreAnalytics)[24467] <Notice>: Exiting exit handler.

Not clear since the log itself is huge, but I wondered if some system popup or something blocked the UI testing initialization process. Then unfortunately nothing could do as Appium.