Forum Discussion

Hyung-Mok-LEE's avatar
Hyung-Mok-LEE
Occasional Contributor
3 years ago

An Appium server error occurred: Failed to create a new session

Hello.

I'm making the first attempt for a mobile test.

So I'm studying Smartbear's Academy course - TestComplete Mobile Automation Engineer.

I try to run the sample file while watching the video, but I can't access the Appium Server due to the following error.

(For your information, I downloaded the sample file from the site below.

https://support.smartbear.com/testcomplete/downloads/samples/)

 

Please Help me..

 

My Appium Server Information

in TestComplete

 

  • Hi Hyung-Mok-LEE 

     

    The error is a little cryptic. 


    I would start looking at the device you are trying to connect to and the device you have specified in the capabilities aswell as your ADB setup. 

     

    run 'adb devices' in command line client, if your phone has been connected adb, it will show up here but more importantly it will display the correct device name you need to reference in your capabilities.

     

    From here I would compare and see if they match, if they dont use what is found for the device name in your capabilities. 

    note: if you have not configured the 'adb' environment path, cd to android-sdk/platform-tools/, then run it.

     

    KR

    Vinnie

  • Additionally Hyung-Mok-LEE 

     

    If you do not wish to set up local Appium or if find it too tricky. 

     

    Why not use BitBar Appium in TestComplete, its very easy to set up, no local appium server is needed, and to connect to a device is also very easy and straightforward. 

     

    Check out the video here in the documentation (you will need a BitBar Trial) 

     

    https://support.smartbear.com/testcomplete/docs/app-testing/mobile/device-cloud/index.html

     

    KR

    Vinnie 

  • It's going really well as you said. Thank you.
    One thing I missed was that I didn't install JDK. After installing JDK, I added JAVA_HOME to the environmental variable, and it works properly.

     

     

  • Hyung-Mok-LEE's avatar
    Hyung-Mok-LEE
    3 years ago

    Finally, the environment should be set up as follows.

    1. setup JDK and add Environmental variable "JAVA_HOME" 

    2. Appium server setup

    3. Android Studio setup

    4. download and setup the mobile sample from smartbear website

    5. connect the mobile phone to my computer.

    6. Execute testComplete 15.30

    7. Create project suite and project

    8. Check the current project properties - Mobile devices > General > Mobile device cloud (BitBar and local Appium)

    9. Click "Show Mobile Screen"  

    10. Input Server URL, Application path, and Parameters (JSON)

    11. Finally, I clicked the OK button.

     

    Set up Appium on Windows for Testing Android Devices | TestComplete Documentation (smartbear.com)

  • Hi Hyung-Mok-LEE 

     

    The error is a little cryptic. 


    I would start looking at the device you are trying to connect to and the device you have specified in the capabilities aswell as your ADB setup. 

     

    run 'adb devices' in command line client, if your phone has been connected adb, it will show up here but more importantly it will display the correct device name you need to reference in your capabilities.

     

    From here I would compare and see if they match, if they dont use what is found for the device name in your capabilities. 

    note: if you have not configured the 'adb' environment path, cd to android-sdk/platform-tools/, then run it.

     

    KR

    Vinnie

    • Hyung-Mok-LEE's avatar
      Hyung-Mok-LEE
      Occasional Contributor

      It's going really well as you said. Thank you.
      One thing I missed was that I didn't install JDK. After installing JDK, I added JAVA_HOME to the environmental variable, and it works properly.

       

       

      • Hyung-Mok-LEE's avatar
        Hyung-Mok-LEE
        Occasional Contributor

        Finally, the environment should be set up as follows.

        1. setup JDK and add Environmental variable "JAVA_HOME" 

        2. Appium server setup

        3. Android Studio setup

        4. download and setup the mobile sample from smartbear website

        5. connect the mobile phone to my computer.

        6. Execute testComplete 15.30

        7. Create project suite and project

        8. Check the current project properties - Mobile devices > General > Mobile device cloud (BitBar and local Appium)

        9. Click "Show Mobile Screen"  

        10. Input Server URL, Application path, and Parameters (JSON)

        11. Finally, I clicked the OK button.

         

        Set up Appium on Windows for Testing Android Devices | TestComplete Documentation (smartbear.com)

  • You could also try to increase the "newCommandTimeout": "600"

    Increasing the newCommandTimeout from "120" to "600" may allow the needed extra time for the application to load fully on the device.

    • Hyung-Mok-LEE's avatar
      Hyung-Mok-LEE
      Occasional Contributor

      As you said, I tried to increase the "newCommandTimeout": "600", but the same error occurs.

      Please check if I'm doing something wrong.

      I worked as follows and I didn't connect the mobile phone to my computer.

      1. Appium server setup

      2. Android Studio setup

      3. download and setup the mobile sample from smartbear website

      4. Execute testComplete 15.30

      5. Create project suite and project

      6. Check the current project properties - Mobile devices > General > Mobile device cloud (BitBar and local Appium)

      7. Click "Show Mobile Screen"  

      8. Input Server URL, Application path, and Parameters (JSON)

      9. Finally, I clicked the OK button.

       

      Did I do anything wrong among the activities above?

      Please let me know.

       

      • vinniew's avatar
        vinniew
        Staff

        Hi Hyung-Mok-LEE 

         

        Did you follow what I said in my response? 

         

        This should have given you a clue about the issue. 


        Also before running your appium server a device needs to be connected. 

         

        If your testing using local appium you will need to connect to a local device or emulator. 

         

        Either way this device needs to be specified in the capabilities using the same device name found by the abd 

         

        KR 

        Vinnie