appium-device-farm icon indicating copy to clipboard operation
appium-device-farm copied to clipboard

Unable to create session for iOS test on LambdaTest

Open alokkr016 opened this issue 1 year ago • 12 comments

The issue pertains to an error encountered while attempting to create a session using Appium, specifically involving the createSession command. Despite the default handlers being registered, the command was instead processed by the device-farm plugin. During this process, an internal error occurred, indicated by the message: "Unknown error while creating session."

Link to Appium logs

https://gist.github.com/alokkr016/7e1462dbc3285c42a7b546cb06e34d4c

Environment

  1. Appium version: 2.2.2
  2. Node.js version (unless using Appium.app|exe): 20.12.2
  3. Npm or Yarn package manager: 10.5.0
  4. Mobile platform/version under test: iOS-16
  5. Real device

alokkr016 avatar May 28 '24 06:05 alokkr016

@alokkr016 Looks like the request to lambdatest server are failing due to timeout which is default to 60s. Can you increase the timeout to some higher value using the plugin argument --plugin-device-farm-remote-connection-timeout 120000 (in MilliSeconds)

sudharsan-selvaraj avatar May 28 '24 17:05 sudharsan-selvaraj

Still getting the same error : https://gist.github.com/alokkr016/d05a2936ceb5ce7cc525cd60629b4cd4 Even when I am able to create a session, the commands are not being sent. CleanShot 2024-05-28 at 23 46 53@2x Could you please tell me which new capabilities I should add or remove from the current ones?

alokkr016 avatar May 28 '24 18:05 alokkr016

@alokkr016 looks like your machine is unable to connect lambdatest hub. Can you check if your behind proxy

saikrishna321 avatar May 29 '24 01:05 saikrishna321

I am able to connect after increasing the remote connection timeout, but I am not able to Send Commands

alokkr016 avatar May 29 '24 11:05 alokkr016

What is the error ?

saikrishna321 avatar May 29 '24 14:05 saikrishna321

CleanShot 2024-05-29 at 20 03 14@2x

Logs : https://gist.github.com/alokkr016/d05a2936ceb5ce7cc525cd60629b4cd4

alokkr016 avatar May 29 '24 14:05 alokkr016

@alokkr016 Can you try making the request from postman

https://username:[email protected]/wd/hub/session

{
    "capabilities": {
        "firstMatch": [
            {}
        ],
        "alwaysMatch": {
            "appium:autoAcceptAlerts": true,
            "appium:idleTimeout": 300,
            "appium:newCommandTimeout": 30,
            "platformName": "IOS",
            "appium:build": "Lambda IOS suite",
            "appium:app": "lt://APP1016055611715975022871754",
            "appium:platformVersion": "16",
            "appium:isRealMobile": "True",
            "appium:appiumVersion": "2.0",
            "appium:wdaLaunchTimeout": 60000,
            "appium:automationName": "XCuiTest",
            "appium:deviceName": "iPhone 14 Pro Max",
            "appium:platform": "ios"
        },
        "pendingSessionId": "71b994c7-685e-4ae1-a2a1-f276cc0a0203"
    },
    "desiredCapabilities": {
        "appium:autoAcceptAlerts": true,
        "appium:idleTimeout": 300,
        "appium:newCommandTimeout": 30,
        "platformName": "IOS",
        "appium:build": "Lambda IOS suite",
        "appium:app": "lt://APP1016055611715975022871754",
        "appium:platformVersion": "16",
        "appium:isRealMobile": "True",
        "appium:appiumVersion": "2.0",
        "appium:wdaLaunchTimeout": 60000,
        "appium:automationName": "XCuiTest",
        "appium:deviceName": "iPhone 14 Pro Max",
        "appium:platform": "ios"
    }
}


can you share the output of this request ? 

saikrishna321 avatar May 29 '24 16:05 saikrishna321

@saikrishna321

CleanShot 2024-05-29 at 22 40 01@2x

Output :

{
  "value": {
    "capabilities": {
      "autoAcceptAlerts": true,
      "automationName": "XCUITest",
      "browserName": "",
      "bundleID": "com.ninja.dream.qa",
      "bundleId": "com.ninja.dream.qa",
      "databaseEnabled": false,
      "derivedDataPath": "/Users/ltadmin/Documents/appium/2.0-10-8-23-mac/build/",
      "deviceName": "iPhone 14 Pro Max",
      "headless": false,
      "javascriptEnabled": true,
      "locationContextEnabled": false,
      "nativeWebScreenshot": true,
      "networkConnectionEnabled": false,
      "newCommandTimeout": 0,
      "noReset": false,
      "orientation": "PORTRAIT",
      "platform": "MAC",
      "platformName": "ios",
      "platformVersion": "16",
      "takesScreenshot": true,
      "udid": "00008120-000C581C0244C01E",
      "uiautomator2ServerLaunchTimeout": "60000",
      "usePrebuiltWDA": true,
      "waitForQuiescence": false,
      "wdaLaunchTimeout": 60000,
      "wdaLocalPort": 11011,
      "wdaStartupRetries": 3,
      "webStorageEnabled": false,
      "webkitResponseTimeout": 20000
    },
    "sessionId": "3c2b2323-2cd1-43fa-af11-8655af4b6dd4"
  }
}




alokkr016 avatar May 29 '24 17:05 alokkr016

@alokkr016 Are you behind a corporate proxy ?

saikrishna321 avatar May 30 '24 00:05 saikrishna321

@saikrishna321 No, I am not using any proxy.

alokkr016 avatar May 30 '24 09:05 alokkr016

Hi @alokkr016

Did you solve this problem?

Glaycongx avatar Oct 11 '24 18:10 Glaycongx

@Glaycongx haven't tried with the latest version

alokkr016 avatar Oct 11 '24 18:10 alokkr016

@alokkr016 Hello! I have the same issue with iOS; sometimes a session is created, but the commands are not run. How did you solve this issue? Please let me know

YuliiaMilian avatar Feb 17 '25 15:02 YuliiaMilian

Hi @YuliiaMilian! I hope this message finds you well! Which framework are you using?

Glaycongx avatar Feb 20 '25 13:02 Glaycongx

I used WDIO and Appium v.2.15.0

YuliiaMilian avatar Feb 20 '25 13:02 YuliiaMilian