Unable to start application when try to do object spy in remote device

Hi
I’m trying to use Katalon Studio’s mobile spy feature to do object spy in a remote cloud Device(Pcloudy).
when i try to do mobile spy I get the following error.

i followed the steps provided in Katalon docs
https://docs.katalon.com/docs/integrations/katalon-studio---pcloudy-integration#:~:text=Katalon%20Studio%20enables%20you%20to,5000%2B%20browser%20and%20device%20combinations.


Log for the same

java.util.concurrent.ExecutionException: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Original error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘LT-LZ-0220’, ip: ‘192.168.0.106’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_282’
Driver info: driver.version: SwipeableAndroidDriver
at com.kms.katalon.composer.components.impl.dialogs.ProgressMonitorDialogWithThread.runAndWait(ProgressMonitorDialogWithThread.java:49)
at com.kms.katalon.composer.mobile.objectspy.components.RemoteAppComposite$1.run(RemoteAppComposite.java:114)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Original error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘LT-LZ-0220’, ip: ‘192.168.0.106’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_282’
Driver info: driver.version: SwipeableAndroidDriver
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:208)
at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:217)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at com.kms.katalon.core.appium.driver.SwipeableAndroidDriver.execute(SwipeableAndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:84)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:85)
at com.kms.katalon.core.appium.driver.SwipeableAndroidDriver.(SwipeableAndroidDriver.java:24)
at com.kms.katalon.core.appium.driver.AppiumDriverManager.createMobileDriver(AppiumDriverManager.java:510)
at com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory.startRemoteMobileDriver(MobileDriverFactory.java:575)
at com.kms.katalon.composer.mobile.objectspy.dialog.MobileInspectorController.startMobileAppOnCloudDevices(MobileInspectorController.java:239)
at com.kms.katalon.composer.mobile.objectspy.components.RemoteAppComposite$1$1.call(RemoteAppComposite.java:117)
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
Caused by: java.lang.reflect.InvocationTargetException
at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:186)
… 21 more
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:318)
at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:282)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:167)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:257)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:103)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:105)
… 22 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
… 43 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
… 43 more

1 Like

Hi,

Thank you for letting us know your issue. I will take time to review it and back to you soon if any update.

1 Like

Hi @Elly_Tran
Thank you for the response

@Elly_Tran
Any update on the issue?

Got a solution for this issue after spending my whole day.

After spending a day, I did it phew.

Solution:
After updating/installing (now katalon is downloading as an exe) to the new katalon version in the JRE file under the C:\Users\userName.katalon\packages\Katalon_Studio_Windows_64-8.6.8\Katalon_Studio_Windows_64-8.6.8\jre\lib\security\cacerts SSL Certificate is missing

To add that if you are using lambda test/ Pcloudy/ Browser stack/Kobiton/sauce labs you need to add the certificate to connect to the remote Device.

Please follow the following steps

  1. open the cloud device provider URL in your Chrome browser

  2. click on the lock icon on the left side of your URL

  3. click Connection is secure
    image

  4. click on Certificate is valid you will get the following window opened

  5. click on the Details Tab at the top of the window you will get the following screen

  6. you will get the file explorer to save the file save it with .cer Extension

  1. check the Katalon version you are using in the IDE

  2. Go to the following location C:\Users\userName.katalon\packages\ select the version of the IDE you are using \jre\bin

9.copy the path

  1. open your command prompt

  2. cd paste the copied path by right click on the command prompt
    give enter and enter the following

  3. keytool -importcert -file “path of the exported.cer File with file name with.cer extension” –alias anyaliasname –keystore “C:\Users\userName.katalon\packages\ select the version of the IDE you are using \jre\lib\security\cacerts”

eg:
C:\Users\bharathi.a\.katalon\packages\Katalon_Studio_Windows_64-8.6.8\Katalon_Studio_Windows_64-8.6.8\jre\lib\security\cacerts

13 press the Enter Button
14. you will be prompted to enter a password give the password as changeit
15. you will be prompted to confirm type enter yes or y
16. the certificate will be added.

Thats’all

Method 2

  1. Download keystore explorer from here

  2. install the application

  3. click on Open
    image

  4. Select File of types as all files

5… browser for this file `
C:\Users*your system User Name here*.katalon\packages\Katalon_Studio_Windows_64-8.6.8\Katalon_Studio_Windows_64-8.6.8\jre\lib\security\cacerts

  1. click on open

  2. you will asked to enter a password give the password as changeit and click on ok

  3. Mouse over to this icon you will get the tool tip as click on thisimage
    image

  4. you will get an explorer window to search for certificates search for the saverd .cer file in method 1 click on it and click the open button

10 you may get the following window to enter an alias name just give some name to it and click ok button
image

  1. you will get the following pop-up click ok button
    image

12 save the changes using the save icon on the toolbar
image

13 close the application you are all set to start testing on the cloud.

i hope this will help you to overcome the java.util.concurrent.ExecutionException: org.openqa.selenium.SessionNotCreatedException: Unable to create a new remote session. Original error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target error

3 Likes

Hi @bharathi.a, I tried what you said. Now It’s working perfectly. Thank you so much!

1 Like

ou will get an explorer window to search for certificates search for the saverd .cer file in method 1 click on it and click the open button
I am not able to find the Cer file

which file you are asking ?
and at which step?