Forum Discussion

Mojo's avatar
Mojo
Occasional Contributor
7 years ago
Solved

Recognition string of object frequently changing in external repository

Hi,

I am using an external notepad repository for keeping the recognition string of the objects of my application
(Windows application). Then, i am using keywords against which functions are written to return stub objects
and perform actions as per my requirement. But, after each new build of the application, the entire recognition of
some of the objects completely changes. While for some of them, i am using wildcards(*), but for some objects, the entire
class changes. What can be done to reduce maintainability of the repository? Any help will be greatly appreciated.

  • If you don't want to use the NameMapping feature of TestComplete, rather than using the long recognition string, you might be better off in determining identification properties similar to the way NameMapping works.  For example, an object may have a class and a caption, two things that will change rarely, regardless of how the rest of the application changes.  So, instead of the long string, use those two properties and their values and then utilize the built in "Find" or "FindChild" methods of TestComplete to find and return the specific objects.

6 Replies

  • sanjay0288's avatar
    sanjay0288
    Frequent Contributor

    Can you provide a snapshot of the objects which got changed. Along with the snapshot of the object notepad file. So that can quickly look into it and provide a solution. 

    • Mojo's avatar
      Mojo
      Occasional Contributor

      As seen in the screen shot it is the "add "button in the left bottom corner.

      In the earlier build it was:(in C# script)

      Sys["Process"]("SoftControllerPanel")["Window"]("WindowsForms10.Window.8.app.0.141b42a_r12_ad1", "SoftController", 1)["Window"]("WindowsForms10.BUTTON.app.0.141b42a_r12_ad1", "&Add", 1)

      In the new build it is:

      Sys["Process"]("SoftControllerPanel")["WinFormsObject"]("SoftControllerDialog")["WinFormsObject"]("m_AddButton")

       

      Screen shot is attached

      • sanjay0288's avatar
        sanjay0288
        Frequent Contributor

        Hi,

         

        Instead of passing the complete object from your notepad file, A more generic approach would be to pass the Object properties and values from your file and write a common method which does the find child operation and returns the found object.

         

        If the product which you are working is still in a development phase then there are chances that the dev team recklessly change the properties of the widget. Also if you have better access to your dev team then find out from them which object properties are unique and not going to change for the widget and then add it in your file.

         

        Below is sample vb script method written to get the object

         

        Function GetObjectofControl(prop,val)
          Dim mainObject, object
          Set mainObject = Sys.Process(<your process name>)
          Set object = mainObject.FindChild(prop,val,100) 
          Set GetObjectofControl = object
        End Function