Getting issue || Requested device was not found

  • 15 Replies
  • 839 Views
*

sadik

  • *
  • 12
Getting issue || Requested device was not found
« on: July 30, 2018, 20:28:40 pm »
I have setup TestProject.

1. Install TestProject successfully
2. Register Agent with Wep SDK.
3. Created Appium Test java file and added required jar files
4. Created Test Runner file.
5. Connected device with System.
6. Added devToken in Test Runner.

Run TestRunner using eclipse: Getting below exception:

19:53:37.404 [main] DEBUG io.testproject.java.sdk.v2.Runner - Starting development session...
19:53:41.088 [main] ERROR io.testproject.java.sdk.v2.Runner - Requested device was not found
java.lang.InstantiationException: Failed to start development session!
   at io.testproject.java.sdk.v2.Runner.<init>(Runner.java:161)
   at io.testproject.java.sdk.v2.Runner.<init>(Runner.java:121)
   at com.test.runner.TestRunner.main(TestRunner.java:14)


Environment:

Widow 8.1
Adnroid 7.1

Please suggest on above issue

Re: Getting issue || Requested device was not found
« Reply #1 on: July 30, 2018, 21:13:42 pm »
Please note example's class io.testproject.examples.sdk.java.SessionHelper
https://github.com/testproject-io/java-sdk-examples/blob/master/Android/Runners/src/main/java/io/testproject/examples/sdk/java/SessionHelper.java#L18

Code
// Specify target device UUID
// This information is conveniently visible at https://app.testproject.io/#/agents
// Under your connected agent on the devices tab
driverSettings.setDeviceUdid("YOUR_DEVICE_UDID");

Please follow the instruction above.
« Last Edit: July 30, 2018, 21:36:52 pm by Marat Strelets »

*

sadik

  • *
  • 12
Re: Getting issue || Requested device was not found
« Reply #2 on: July 31, 2018, 17:07:18 pm »
I have already updated device id in "SessionHelper" file.


Re: Getting issue || Requested device was not found
« Reply #3 on: July 31, 2018, 18:16:55 pm »
Can you please post a snippet of your code and a screenshot of your Agent's devices list?

*

sadik

  • *
  • 12
Re: Getting issue || Requested device was not found
« Reply #4 on: July 31, 2018, 18:40:46 pm »
I debug more verify, able to view devices screen from  Agent tab of Web SDK.
Executed test now getting below screen:

22:06:00.550 [main] DEBUG io.testproject.java.sdk.v2.Runner - Starting development session...
22:06:07.034 [main] INFO  io.testproject.java.sdk.v2.Runner - Development session initialized
22:06:07.103 [main] INFO  io.testproject.java.sdk.v2.Runner - Development session connection established via local.rdr.tpagent.io:9201
22:06:11.280 [main] ERROR io.testproject.java.sdk.v2.Runner - Failed to execute codeblock class com.test.demo.ExtendedTest
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot stop and clear com.kayak.android. Original error: Error executing adbExec. Original error: 'Command ''C:\\Program Files\\TestProject Agent\\android-sdk\\platform-tools\\adb.exe' -P 5037 -s 35c14c220104 shell pm clear com.kayak.android' exited with code 1'; Stderr: 'Error: java.lang.SecurityException: PID 23615 does not have permission android.permission.CLEAR_APP_USER_DATA to clear data of package com.kayak.android'; Code: '1' (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.44 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'SADIKA', ip: '192.168.99.1', os.name: 'Windows 8.1', os.arch: 'x86', os.version: '6.3', java.version: '1.8.0_101'
Driver info: io.testproject.java.sdk.v2.drivers.AndroidDriver
Capabilities [{capabilities={appPackage=com.kayak.android, noReset=true, skipWaitAppStart=true, deviceName=xiaomi-redmi_note_4-35c14c220104, platform=ANY, appActivity=com.kayak.android.Splash, newCommandTimeout=0.0, automationName=uiautomator2, skipUnlock=true, browserName=, javascriptEnabled=true, platformName=Android, udid=35c14c220104}, javascriptEnabled=true, platform=ANY}]
Session ID: 5d0bb12e-1394-4407-a20d-885f01fb19c6
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_101]
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_101]
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_101]
   at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_101]
   at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215) ~[io.testproject.sdk.java.jar:na]
   at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167) ~[io.testproject.sdk.java.jar:na]
   at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:671) ~[io.testproject.sdk.java.jar:na]
   at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46) ~[io.testproject.sdk.java.jar:na]
   at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) ~[io.testproject.sdk.java.jar:na]
   at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) ~[io.testproject.sdk.java.jar:na]
   at io.appium.java_client.InteractsWithApps.resetApp(InteractsWithApps.java:65) ~[io.testproject.sdk.java.jar:na]
   at com.test.demo.ExtendedTest.execute(ExtendedTest.java:37) ~[bin/:na]
   at io.testproject.java.sdk.v2.Runner.execute(Runner.java:195) [io.testproject.sdk.java.jar:na]
   at io.testproject.java.sdk.v2.Runner.run(Runner.java:420) [io.testproject.sdk.java.jar:na]
   at io.testproject.java.sdk.v2.Runner.run(Runner.java:386) [io.testproject.sdk.java.jar:na]
   at com.test.runner.TestRunner.main(TestRunner.java:26) [bin/:na]



*

sadik

  • *
  • 12
Re: Getting issue || Requested device was not found
« Reply #5 on: July 31, 2018, 18:49:13 pm »
One more thing I observe that if I run manually app and close during execution of test then application launch by test script, following steps:

1. Run test
2. launch and close app manually
3. After closing app application launch automatically.

Can you suggest now what permission I need to give.

Thanks

Re: Getting issue || Requested device was not found
« Reply #6 on: July 31, 2018, 18:59:42 pm »
Please make sure the following are enabled in Developer Options screen of your device:

1. USB Debugging
2. Install via USB

Thanks.

*

sadik

  • *
  • 12
Re: Getting issue || Requested device was not found
« Reply #7 on: July 31, 2018, 22:02:13 pm »
Both are enabled

Re: Getting issue || Requested device was not found
« Reply #8 on: July 31, 2018, 22:16:14 pm »
Do you have an option "USB debugging (Security Settings)- Allow granting permissions"?
If yes, is it enabled ?

*

sadik

  • *
  • 12
Re: Getting issue || Requested device was not found
« Reply #9 on: August 01, 2018, 07:45:20 am »
Yes, I have option. will enable and check.

*

sadik

  • *
  • 12
Re: Getting issue || Requested device was not found
« Reply #10 on: August 01, 2018, 19:27:19 pm »
I enabled "USB debugging (Security Settings)- Allow granting permissions" option

but not able to run test getting below issue :

22:55:44.541 [main] DEBUG io.testproject.java.sdk.v2.Runner - Starting development session...
22:56:18.665 [main] ERROR io.testproject.java.sdk.v2.Runner - Application error occurred during the request processing, please try again
java.lang.InstantiationException: Failed to start development session!

I tried with two devices.

I am debugging issue and will keep update here.

Re: Getting issue || Requested device was not found
« Reply #11 on: August 01, 2018, 20:44:59 pm »
Please post your driverSettings object you pass to the Runner.

*

sadik

  • *
  • 12
Re: Getting issue || Requested device was not found
« Reply #12 on: August 01, 2018, 22:23:41 pm »
Please find below detail:

   
Quote
public static DriverSettings getDriverSettings() {
        DriverSettings driverSettings = new DriverSettings();

        // Declare that Android driver is required
        driverSettings.setDriverType(DriverType.Appium_Android);

        driverSettings.setDeviceUdid("85d7e4e97ce5");

        MobileDriverSettings mobileSettings = new MobileDriverSettings();
        mobileSettings.setAndroidPackage("com.kayak.android");
        mobileSettings.setAndroidActivity(".Splash");
        driverSettings.setMobileSettings(mobileSettings);

        return driverSettings;
    }

Re: Getting issue || Requested device was not found
« Reply #13 on: August 01, 2018, 23:07:10 pm »
All seems accurate.
But I can see from the logs on our end that your device is still restricted.
Errors such as INSTALL_FAILED_USER_RESTRICTED: Install canceled by user
Can you please remove any kind of blocking software, permissions guards, etc... and remove PIN/pattern locks?
You can also use an emulator as an alternative.

*

sadik

  • *
  • 12
Re: Getting issue || Requested device was not found
« Reply #14 on: August 06, 2018, 19:52:25 pm »
I did some observation and given permission in auto launch to app.

Now I noticed that test started running ..

23:03:39.537 [main] DEBUG io.testproject.java.sdk.v2.Runner - Starting development session...
23:04:30.206 [main] INFO  io.testproject.java.sdk.v2.Runner - Development session initialized
23:04:30.228 [main] INFO  io.testproject.java.sdk.v2.Runner - Development session connection established via local.rdr.tpagent.io:3047

 

Sitemap 1 2 3 4 5 6 7 8