Forum Discussion

easy-soft's avatar
easy-soft
Occasional Contributor
8 years ago

Modify operation during recording

When recording tests for VCL Delphi applications any clicks to TreeViews (and other controls) are registered using the caption of the clicked item. In our application we have dynamic captions for these controls but all items have stable internal IDs. I'd like to use these IDs during recording and playback of the tests. We have sub-classed these controls thus accessing internal details of these controls should be possible.

 

I already tried to implement a KDTOperation using a script extension. Unfortunately this does not help, as all the code is only executed after finishing the recording. At that time access to internal information of the controls is no longer possible.

 

Thus, what I want is, that the standard recording of a TreeView click (i.e. myTV.ClickItem('|item1|item1.2')) would be recorded as something like myTV.ClickItem('MyItemID'). During playback of the test, this recorded ID should be used instead of the caption.

 

Searching the forums and your documentation did not reveal any hints on how to solve my problem. Could you please give my any clues?

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I think, at this point, after recording, you'll have to manually go back and edit your recorded automation to use the indicated ID's.  ClickItem is a wrapper that TestComplete puts on the Tree control to execute the click item and it utilizes what is available at run time for the recording.  

    • Marsha_R's avatar
      Marsha_R
      Moderator

      tristaanogre  I know the id's need to be set manually, but would setting up Aliases also help out here?

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        An Alias would be for the tree object itself... there's no Aliasing for the items within the tree because they aren't separate objects... they don't show up in the object browser as separate objects so they can't be mapped....  At least, as far as I recall for VCL objects of this type....