[Katalon mobile IOS] Unable to launch WebDriverAgent

hello, in chapter 1-setting up a mobile testing project with simulators, I get the same error as at minute 14:30. How do I fix it?

`java.util.concurrent.ExecutionException: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent. Original error: Unable to start WebDriverAgent: Error: We were not able to retrieve the /status response from the WebDriverAgent server after 60000ms timeout.Try to increase the value of ‘appium:wdaLaunchTimeout’ capability as a possible workaround.

Host info: host: ‘MacBook-Air-de-Pruebas.local’, ip: ‘fe80:0:0:0:5e:b760:bb43:9a68%en0’

Build info: version: ‘4.22.0’, revision: ‘c5f3146703’

System info: os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘12.7.6’, java.version: ‘17.0.13’

Driver info: io.appium.java_client.ios.IOSDriver

Command: [null, newSession {capabilities=[Capabilities {appium:app: /Users/pruebasvvcc/Library/…, appium:automationName: XCUITest, appium:deviceId: B81957D7-9FA4-485D-9B5D-22F…, appium:deviceName: iPad (10th generation), appium:fullReset: false, appium:newCommandTimeout: 1800, appium:noReset: true, appium:platformVersion: 16.2, appium:realDeviceLogger: /Applications/Katalon Studi…, appium:udid: B81957D7-9FA4-485D-9B5D-22F…, appium:waitForAppScript: true;, appium:wdaLocalPort: 49411, platformName: IOS}]}]

Capabilities {appium:app: /Users/pruebasvvcc/Library/…, appium:automationName: XCUITest, appium:deviceId: B81957D7-9FA4-485D-9B5D-22F…, appium:deviceName: iPad (10th generation), appium:fullReset: false, appium:newCommandTimeout: 1800, appium:noReset: true, appium:platformVersion: 16.2, appium:realDeviceLogger: /Applications/Katalon Studi…, appium:udid: B81957D7-9FA4-485D-9B5D-22F…, appium:waitForAppScript: true;, appium:wdaLocalPort: 49411, platformName: IOS}

at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.runAndWait(ProgressMonitorDialogWithThread.java:49)

at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite$12.run(MobileLocalAppComposite.java:491)

at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)

Caused by: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent. Original error: Unable to start WebDriverAgent: Error: We were not able to retrieve the /status response from the WebDriverAgent server after 60000ms timeout.Try to increase the value of ‘appium:wdaLaunchTimeout’ capability as a possible workaround.

Host info: host: ‘MacBook-Air-de-Pruebas.local’, ip: ‘fe80:0:0:0:5e:b760:bb43:9a68%en0’

Build info: version: ‘4.22.0’, revision: ‘c5f3146703’

System info: os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘12.7.6’, java.version: ‘17.0.13’

Driver info: io.appium.java_client.ios.IOSDriver

Command: [null, newSession {capabilities=[Capabilities {appium:app: /Users/pruebasvvcc/Library/…, appium:automationName: XCUITest, appium:deviceId: B81957D7-9FA4-485D-9B5D-22F…, appium:deviceName: iPad (10th generation), appium:fullReset: false, appium:newCommandTimeout: 1800, appium:noReset: true, appium:platformVersion: 16.2, appium:realDeviceLogger: /Applications/Katalon Studi…, appium:udid: B81957D7-9FA4-485D-9B5D-22F…, appium:waitForAppScript: true;, appium:wdaLocalPort: 49411, platformName: IOS}]}]

Capabilities {appium:app: /Users/pruebasvvcc/Library/…, appium:automationName: XCUITest, appium:deviceId: B81957D7-9FA4-485D-9B5D-22F…, appium:deviceName: iPad (10th generation), appium:fullReset: false, appium:newCommandTimeout: 1800, appium:noReset: true, appium:platformVersion: 16.2, appium:realDeviceLogger: /Applications/Katalon Studi…, appium:udid: B81957D7-9FA4-485D-9B5D-22F…, appium:waitForAppScript: true;, appium:wdaLocalPort: 49411, platformName: IOS}

at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)

at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)

at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)

at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:176)

at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:237)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518)

at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:270)

at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:161)

at io.appium.java_client.AppiumDriver.(AppiumDriver.java:91)

at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:91)

at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:572)

at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:551)

at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startLocalMobileDriver(MobileDriverFactory.java:597)

at com.kms.katalon.composer.mobile.objectspy.dialog.MobileInspectorController.startMobileApp(MobileInspectorController.java:207)

at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite.startLocalAppAsNormal(MobileLocalAppComposite.java:564)

at com.kms.katalon.composer.mobile.objectspy.components.MobileLocalAppComposite$12$1.call(MobileLocalAppComposite.java:499)

at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.startThreadAndWait(ProgressMonitorDialogWithThread.java:36)

at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.runAndWait(ProgressMonitorDialogWithThread.java:48)

… 2 more`

Best regards

1 Like

To resolve the WebDriverAgent (WDA) launch failure in Katalon for iOS testing:

1. Fix WebDriverAgent Signing Issues

  • Problem: WDA requires valid code signing to run on simulators or real devices.
  • Solution:
    a. Open the WDA project in Xcode:
    • Navigate to Applications/Katalon Studio.app/Contents/Resources/appium/WebDriverAgent.
    • Open WebDriverAgent.xcodeproj in Xcode.
      b. Select your team in Xcode:
    • Go to Signing & Capabilities → Select your Apple Developer account for WebDriverAgentLib and WebDriverAgentRunner targets.
    • Ensure “Automatically manage signing” is enabled.
      c. Build and run WDA manually in Xcode to confirm it works (Debug on Simulator/Device).

2. Adjust Capabilities in Katalon

  • Add these capabilities to your mobile setup:
'appium:wdaLaunchTimeout': 120000, // Increase timeout to 120 seconds  
'appium:useNewWDA': true, // Force fresh WDA instance  
'appium:wdaStartupRetries': 4, // Add retries  
'appium:showXcodeLog': true, // Enable Xcode logs  
'appium:simpleIsVisibleCheck': true, // Simplify visibility checks  
  • Remove conflicting flags: Disable noReset or fullReset temporarily for testing.

3. Use a Unique WDA Port

  • Problem: Port conflicts (e.g., 49411) can block WDA startup.
  • Workaround: Assign a unique unused port (e.g., 8200):
'appium:wdaLocalPort': 8200  

4. Update Dependencies

  • Update Appium:
npm install -g appium@latest  
  • Install Carthage: WDA requires Carthage dependencies.
brew install carthage  
cd /Applications/Katalon\ Studio.app/Contents/Resources/appium/WebDriverAgent  
carthage bootstrap --platform iOS  

5. Verify Simulator/Device Setup

  • For Simulators:
    • Reset the simulator via Hardware → Erase All Content and Settings.
    • Ensure the correct iOS version (e.g., 16.2) is installed in Xcode → Preferences → Components.
  • For Real Devices:
    • Trust the device on your Mac: Enter the device passcode when prompted.
    • Ensure the device UDID is correct (check via xcrun instruments -s devices).

6. Check Environment Permissions

  • Grant Full Disk Access to Terminal, Xcode, and Katalon in System Settings → Security & Privacy.
  • For macOS Ventura+, allow “Allow Remote Automation” in Settings → Developer on the iOS device/simulator.

7. Troubleshoot via Appium Logs

  • Enable verbose logging in Katalon:
'appium:showIOSLog': true,  
'appium:logLevel': 'debug'  
  • Look for errors like Failed to launch WDA or code signing blocked in Console.app logs.

8. Switch to WDA v4+ (Manual Installation)

If Katalon’s bundled WDA is outdated:

  1. Clone the latest WDA:
git clone https://github.com/appium/WebDriverAgent.git  
  1. Follow Appium’s WDA setup guide to install and link it to Katalon.

Alternative Solutions

  • Use Appium Desktop to manually test WDA connectivity first.
  • Try a lower iOS version (e.g., 15.7) if issues persist with iOS 16+.

Final Checks:

  1. Retry the test after closing/reopening Xcode and Katalon.
  2. Ensure your Java environment variables are properly set.
  3. Reinstall Katalon Studio if the issue persists.

If the problem continues, share logs from Xcode and Katalon’s Console tab for specific error analysis

1 Like