This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using Mobile Center for working with Appium Inspector

Appium Desktop (https://github.com/appium/appium-desktop) provides Appium Server and Inspector in Desktop GUIs for Mac, Windows, and Linux.  The post below explains how to use Appium inspector together with the devices hosted by Mobile Center.

  • Launch Appium Desktop app
  • Open New Session from Appium menu
  • Navigate to Custom Server tab
  • Setup the needed parameters (see attachment)
  1. Mobile Center FQDN/IP and Port
  2. Remote path: /wd/hub
  3. Proxy (if used)
  4. Desired capabilities:

Screen Shot 2019-08-31 at 20.04.37.png

 

  • Please be sure to add browserName capability as empty, otherwise Appium will add the default browser name.
  • It is highly recommended to use OATH Client ID and Secret instead of username/password for the user
  • If you set Anonymous Access option for Appium to NO, please provide userName and password capabilities as well. If it is set to YES - no needed, it will work anonymously.Screen Shot 2018-06-07 at 11.08.04.png

     

 

 

  • Done - Appium Inspector is launched with device hosted by Mobile Center.Screen Shot 2018-06-07 at 11.07.44.png

     

 

 

Parents
  • 0

    Hi 
    This worked for me on appium desktop server but when i am trying to use these capabilities in my selenium/appium code and execute the script.

    Error:

    sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

    Can anyone please help?
  • 0 in reply to 

    Hi Ishan,
    If you are testing with an instance of UFTM with SSL (https), this may be an issue with the certificate. For example, if your local computer attempts to connect to a remote server and the security certificates in your Local Computer Keystore, do not match. To solve this issue, you have to import the certificate into the Java Keystore.

  • 0 in reply to 

    I tried solutions available on google for importing certificate(https://stackoverflow.com/questions/21076179/pkix-path-building-failed-and-unable-to-find-valid-certification-path-to-requ) but it didn't work for me.

    I am getting same error.

  • 0 in reply to 

    Hello Ishan,

    I would suggest verifying if you have more than one JRE/JDK installed, that you imported the certificate to the "cacerts" fille corresponding to the version you are using in your test. 
    What I usually do is:
    1) From the UFTM site, export the certificate (as a .cer file)
    2) Then, to import it on the cacerts: 

    Update keystore with the new certificate.

    • Copy the cacerts file to a temporary location. This file is usually under the \security folder of your JRE path. This step is important. In some cases updating directly to Program Files is restricted, and you will receive the keytool error "Access is denied". In this case, you will need to involve your local IT team.

    Example:

    copy "C:\Program Files\Java\jre1.8.0_151\jre\lib\security\cacerts" "C:\temp\cacerts"

    • From a command prompt, run the importcert command.

    Example:

    keytool -importcert -file C:\temp\new.cer -keystore "C:\temp\cacerts" -alias uftmcert

    Note: If you haven't changed it, the default keystore password is: changeit

    • Copy the cacerts file back to the original location.

     

    Validating the Certificate

    • From the command prompt, navigate to the Java installation folder, and run the keytool.exe to extract a newListOutput.txt file with the list command.

    Example:

    keytool -list -keystore "C:\temp\cacerts" > C:\temp\newListOutput.txt

    • Open the newListOutput.txt file and search for the certificate thumbprint
Reply
  • 0 in reply to 

    Hello Ishan,

    I would suggest verifying if you have more than one JRE/JDK installed, that you imported the certificate to the "cacerts" fille corresponding to the version you are using in your test. 
    What I usually do is:
    1) From the UFTM site, export the certificate (as a .cer file)
    2) Then, to import it on the cacerts: 

    Update keystore with the new certificate.

    • Copy the cacerts file to a temporary location. This file is usually under the \security folder of your JRE path. This step is important. In some cases updating directly to Program Files is restricted, and you will receive the keytool error "Access is denied". In this case, you will need to involve your local IT team.

    Example:

    copy "C:\Program Files\Java\jre1.8.0_151\jre\lib\security\cacerts" "C:\temp\cacerts"

    • From a command prompt, run the importcert command.

    Example:

    keytool -importcert -file C:\temp\new.cer -keystore "C:\temp\cacerts" -alias uftmcert

    Note: If you haven't changed it, the default keystore password is: changeit

    • Copy the cacerts file back to the original location.

     

    Validating the Certificate

    • From the command prompt, navigate to the Java installation folder, and run the keytool.exe to extract a newListOutput.txt file with the list command.

    Example:

    keytool -list -keystore "C:\temp\cacerts" > C:\temp\newListOutput.txt

    • Open the newListOutput.txt file and search for the certificate thumbprint
Children
  • 0 in reply to 

    Hi Maria Rolfe

    Finally i am able to run my script. Thanks for the solution.
    But I am not able to see mobile UI while running my appium script. I can only see that one device got reserved in from the lab during execution.
    How can I see the execution on mobile device. Please help me in this.