googleid_109625
11 years agoNew Contributor
Android device is getting unplugged when executing InstallPackage or RemovePackage, unable to execute fully automated tests.
Hello.
I'm executing my newly created test on real Android device through USB cable. Everything works fine, but I have one problem that have to be solved or SmartBear TestComplete is going to be useless for me.
I've added a LOOP in front and end of testcase, so it's running full test whole time untill I stop it manually.
Right now it's working like that:
- Install apk on real device (RunTestedApp function)
- Run test (runs apk and go through registration process)
- At the end of test, go to label that's at start of testcase
- Uninstall apk on real device (RunTestedApp function)
- Install apk on real device again and test goes on again (RunTestedApp function)
My problem is:
After it complete my whole testcase 100% successfully, it goes to the start of testcase. When it goes to the start of testcase, it's executing RunTestedApp function again, what makes my application data clear (because of RemovePackage function before InstallPackage, and yes, I want that this way because I can't find other way to clear application data). And now, on this step, when it's uninstalling apk or installing apk (problem exists when installing and uninstalling, totally randomized, occurs more often when uninstalling) my Android device is getting UNPLUGGED in TestComplete. To make it visible again I have to plug it off and plug it on again.
This problem causes very big issue for me, I'm not able to run fully automated tests.
If that problem exists because some sort of "new files" are added when registration process goes on and later TestComplete is having problems uninstalling apk, it needs to be fixed, because like I said earlier, that problem is a serious problem for me.
Also I have a simple JScript that calls InstallPackage, LaunchPackage and RemovePackage.
Here's it:
After running my script, It looks like this:
1. Installs apk (InstallPackage)
2. Runs apk (LaunchPackage)
3. Closes apk (RemovePackage)
4. Test stops with an error "The Android device was disconnected. Failed to remove package~."
Important note in this point: Application on Mobile Device is getting successfully uninstalled, but TestComplete returns an error that he couldn't remove package. No idea why, but that's causing serious issue for me, I'm unable to do fully automated tests.
Tested on Samsung Galaxy S3, S4 and Nexus 7 -> exactly same problem exists on all devices.
Also I've splitted this script up and I've made 3 different scripts -> 1 for Install, 1 for Run and 1 for Remove scripts. I did it and reworked my testcase to something like that:
1. Run JScript InstallPackage only
2. Run JScript RunPackage only
3. Run whole testcase
4. At the end of testcase before "GoToLabel" function (it goes to label "start" on the beginning of testcase, making it unlimited loop), run JScript RemovePackage only -> AT THIS POINT - ofcourse - I'm getting an "Android device has been disconnected." error, full log is attached.
Best regards,
Jacob.
I'm executing my newly created test on real Android device through USB cable. Everything works fine, but I have one problem that have to be solved or SmartBear TestComplete is going to be useless for me.
I've added a LOOP in front and end of testcase, so it's running full test whole time untill I stop it manually.
Right now it's working like that:
- Install apk on real device (RunTestedApp function)
- Run test (runs apk and go through registration process)
- At the end of test, go to label that's at start of testcase
- Uninstall apk on real device (RunTestedApp function)
- Install apk on real device again and test goes on again (RunTestedApp function)
My problem is:
After it complete my whole testcase 100% successfully, it goes to the start of testcase. When it goes to the start of testcase, it's executing RunTestedApp function again, what makes my application data clear (because of RemovePackage function before InstallPackage, and yes, I want that this way because I can't find other way to clear application data). And now, on this step, when it's uninstalling apk or installing apk (problem exists when installing and uninstalling, totally randomized, occurs more often when uninstalling) my Android device is getting UNPLUGGED in TestComplete. To make it visible again I have to plug it off and plug it on again.
This problem causes very big issue for me, I'm not able to run fully automated tests.
If that problem exists because some sort of "new files" are added when registration process goes on and later TestComplete is having problems uninstalling apk, it needs to be fixed, because like I said earlier, that problem is a serious problem for me.
Also I have a simple JScript that calls InstallPackage, LaunchPackage and RemovePackage.
Here's it:
function Test()
{
// Obtain the PackageObject object
var DeviceObj = Mobile.Device("");
var PackManagerObj = DeviceObj.PackageManager;
var PackObj = PackManagerObj.GetPackageFromAPK("C:\\RX- Android-20140313-1130_poland_ smartbear.apk");
// Install the package
PackManagerObj.InstallPackage(PackObj);
// Launch the default activity for the package
PackManagerObj.LaunchPackage(PackObj);
// Remove the package
PackManagerObj.RemovePackage(PackObj);
}
After running my script, It looks like this:
1. Installs apk (InstallPackage)
2. Runs apk (LaunchPackage)
3. Closes apk (RemovePackage)
4. Test stops with an error "The Android device was disconnected. Failed to remove package~."
Important note in this point: Application on Mobile Device is getting successfully uninstalled, but TestComplete returns an error that he couldn't remove package. No idea why, but that's causing serious issue for me, I'm unable to do fully automated tests.
Tested on Samsung Galaxy S3, S4 and Nexus 7 -> exactly same problem exists on all devices.
Also I've splitted this script up and I've made 3 different scripts -> 1 for Install, 1 for Run and 1 for Remove scripts. I did it and reworked my testcase to something like that:
1. Run JScript InstallPackage only
2. Run JScript RunPackage only
3. Run whole testcase
4. At the end of testcase before "GoToLabel" function (it goes to label "start" on the beginning of testcase, making it unlimited loop), run JScript RemovePackage only -> AT THIS POINT - ofcourse - I'm getting an "Android device has been disconnected." error, full log is attached.
Best regards,
Jacob.
Hi Jakub,
As far as I understand from the support case you've submitted, the problem doesn't persist in TestComplete 10.10, right?