Forum Discussion

Uzumaki's avatar
Uzumaki
Occasional Contributor
13 years ago

Recorded keyword test and identifying objects

Hi all



I have recorded some tests that click radiobuttons that are present in a grid. The recorder creates a step containg a click action on the object below.



Aliases["IEXPLORE"]["pageHttpLocalhostIntasmaWizardad"]["document"]["all"]["Item"]("ctl00_mainContent_ucAddCase_ucSelectBaseApplication_ucSelectCaseGridFrom_rbSelect611")



The problem is that the next time the test is executed this object no longer exists. Its called something like:



Aliases["IEXPLORE"]["pageHttpLocalhostIntasmaWizardad"]["document"]["all"]["Item"]("ctl00_mainContent_ucAddCase_ucSelectBaseApplication_ucSelectCaseGridFrom_rbSelect617")



I then figured I have to edit the namemapping file to try to identify the object an other way, but when trying to TestComplete says the object does not exist in the namemapping file.



How should I handle this problem? What am I missing?



/Joakim

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    You should be able to edit the property itself without the object needing to be present.  See attached screenshot.
  • Uzumaki's avatar
    Uzumaki
    Occasional Contributor
    Hi again



    Sorry for not replying earlier. This problem is giving me an headache.



    All my tests act inconsistent as objects are constantly recieving different id:s. I run the test once and it goes through, but the next time it doesn find half of the objects.



    I cant reach the dialog you supplied a screenshot for, because when I try to look at the object in the namemapping file it does not exist, as shown in my screenshot 1.png.



    My second screenshot shows the object explorer, but from there I cant specify on what properties I want to use when identifying my object.



    Please help me, I am getting a bit desperate... I must be missing some vital feature...



    /Joakim
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    How are you trying to access the NameMapping file?  The screenshot you showed seems to be accessing via a keyword test rather than directly through the NameMapping node in the project explorer.



    A couple of articles.  First, this article explains the whole process of editing NameMapped objects and what that entails.  This takes you into the NameMapping node and shows you how to edit and manipulate the properties.



    http://smartbear.com/support/viewarticle/12451/



    Secondly, to address your particular situation.  What you're dealing with is pretty common, actually, in that some properties of the objects that you're using for your tests are dynamic and change constantly.  There are a LOT of ways to handle that kind of thing.  The best description of these techniques is in the screen cast at http://smartbear.com/support/screencasts/testcomplete/reliable-tests-for-dynamic-objects/