Forum Discussion

jbcmt's avatar
jbcmt
Occasional Contributor
13 years ago

How to Compare Mapped Objects

I have a couple of objects in a Java app which are similar, except that the Window Title changed.  The title is difference enough that I would have to wildcard the whole title, but I'm not sure if that would work as well as it sounds.  I would like to combine them into a single object.  How can I compare the two objects and pick which properties to use for identification?



Thanks



JBC

3 Replies

  • ArtemS's avatar
    ArtemS
    SmartBear Alumni (Retired)
    Hello Jeremy,

    Once the objects are similar except for their titles, you can treat them as one mapped object. When selecting the properties to be used as identification attributes along with the other suggested properties, you may select the WindowTitle property and specify the * wildcard as its value (just as you supposed). As an alternative, you may enable the conditional mode of the name mapping and specify both of the possible titles (e.g. WindowTitle="Name1" OR WindowTitle="Name1").

    After that, to determine which of the objects was mapped, you just need to verify the actual value of the WindowTitle property.



    Keep in mind that when both of the mapped objects are available simultaneously, only one of them would be accessible by the mapped name.



    Regards.
  • jbcmt's avatar
    jbcmt
    Occasional Contributor
    So there's no way to compare objects to pick which attributes to use?



    How about a script which runs through all the mapped objects and prints out all of the available properties?



    Thanks



    JBC
  • ArtemS's avatar
    ArtemS
    SmartBear Alumni (Retired)
    Hello Jeremy,



    Since mapping two objects into one is not a common case, there's no special way to do this. However, at first, you can compare the objects (either manually through the Object Browser, or automatically via Object Checkpoints), and then, use the properties with non-matching values as identification attributes.



    Regards.