Forum Discussion

DOWEN's avatar
DOWEN
New Contributor
11 years ago

New to Test Complete Mobile, 2 issues

Hello -



I just recently started using Test Complete to test an Android application, but have run into a couple of issues.



The first is with "Deploy to the device on start".  I currently have this option enabled, however, this does not appear to be working.  In fact, if I do not have the (instrumented) APK manually installed on the device, the tests will not run.  It was my understanding that this option should install (or reinstall) the APK (from the file path) when the project is run.



The second is with adding existing KeywordTests to a new project.  When I add an existing KeywordTest to a new project, and attempt to run the test, the test will fail due to the object not being found.  To fix this, I have to go into the test and manually reselect the objects, essentially recreating the whole test.



To give an idea of my set up, I am running TestComplete 10.30.  I am attempting to test on a VZW Droid Incredible 4G LTE, running Android 4.0.4.  I have "USB debugging" and "Stay awake" enabled under "Developer options"



Being new to Test Complete, I'm not sure if I'm running into these issues due to improper set up, or some other issue.  Any help would be appreciated.



Thanks!
  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 3 rankChampion Level 3
    Hi David,



    > [...] the test will fail due to the object not being found.[...]



    Most probably, automatic NameMapping functionality of TestComplete was used during recording and mapped objects appeared to use not stable identification parameters.

    I would recomment you to watch the "Creating Reliable Tests For Dynamic Objects with Name Mapping" webinar recording (http://support.smartbear.com/screencasts/testcomplete/reliable-tests-for-dynamic-objects/) from the http://support.smartbear.com/screencasts/testcomplete/ page.

    Hope it will help.
  • DOWEN's avatar
    DOWEN
    New Contributor
    Thanks for the help.  I figured out the problem was that I had to copy the NameMapping into the new project as well.



    Do you have any advice on my first issue, with "Deploy to device on start"?
  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 3 rankChampion Level 3
    Hi David,



    > I had to copy the NameMapping into the new project as well.

    Thank you for the update on this.

    While the official approach is that NameMapping file (item) cannot be shared between projects, you may try this approach (http://smartbear.com/forums/f81/t88858/NameMapping-file-sharing-one-possible-approac) on your own risk.



    > Do you have any advice on my first issue, with "Deploy to device on start"?

    Unfortunately, I haven't tried this with TC 10.30 yet, but I used it with TC10.20.

    If I remember correctly (don't have TC10 running at the moment), this setting is an option for the given mobile item in the Tested Applications project item. In order it to work, the tested application must be started using the

    TestedApplications.<yourApp>.Run

    line of code.

    Are you starting your tested application this way?

  • Hi David,



    For Testcomplete to launch the application on the mobile device, you should (at the very least) have:



    * The "TestedApps" item in you project (and you instrumented app included)

    * The "Run TestedApp" test action included in your test (which references your application under test)



    If you have more than one device attached... you will have to tell TestComplete on which device you want to run. The action there is "Select Device"  (You can find this action under the "Mobile" Operations section)



    Something that may be handy is if there is some sort of an error log?



    Alternatively, see if you can manually install / uninstall the application on your mobile deivce with ADB:



    * adb install <app.apk>

    * adb uninstall <package>



  • DOWEN's avatar
    DOWEN
    New Contributor
    Thank you Alexei, after I added a TestedApps.<App>.Run script it started working.  I'll also look into that NameMapping approach you suggested.



    Altus, thank you as well.