Forum Discussion

Mike9's avatar
Mike9
Occasional Contributor
4 years ago
Solved

Not stable object path to the "Programs and Features" window

Hello everyone, In my test should be checked info about the installed app via the "Programs and Features" window. I have identified the object path to this window by the "Object Spy" function of Te...
  • tristaanogre's avatar
    4 years ago

    If you were using NameMapping, this could probably be resolved using something like a conditional mapping or some subset of properties that would identify the object as a stable object regardless of whether it is "Form" or "Window".

     

    So, you could PROBABLY also find it using a FindChild or FindChildEx method to find the child object that matches a set of criteria.

     

    Go to the Object browser and get us screenshots of the object in question.  Please give the "Advanced" view of properties and include as many as possible.  Also, if you can do that for both the "Form" and "Window" instances, that will help greatly.  We can then assist with some logic to find the object.

     

    My guess, in pseudo-code, is that it will look something like this.  NOTE: THIS CODE IS NOT TESTED AND SHOULD NOT NECESSARILY BE USED AS IS.

     

    var objectToFind
    
    objectToFind = Sys.Process("explorer", 2).FindChild(["ObjectType","ObjectID"],["Form","Programs And Features"])
    if !objectToFind.Exists {
        objectToFind = Sys.Process("explorer", 2).FindChild(["ObjectType","Caption"],["Window","Programs And Feature"])
    }
    if objectToFind.Exists {
       Log.Message("Found it")
    }
    else {
        Log.Message("Object Not Found")
    }