1. A method, comprising: detecting, by a system having a processor, an operation of a software application performed at a first time on a target object; generating, by the system, an automation script containing the operation; identifying, by the system prior to execution of the automation script, relations between the target object and other objects within the software application; ranking, by the system, the identified relations in accordance with usefulness of each relation with respect to identifying the target object at a later time, wherein the ranking is based on different types of the identified relations; eliminating, based on the ranking, at least one of the identified relations to form a subset of the identified relations that excludes the eliminated at least one identified relation; testing, by the system, the identified relations in the subset to determine which of the identified relations in the subset are useful for identifying the target object so that the operation can be performed on the target object; based on the testing, generating, by the system, a set of the useful relations corresponding to the target object; after generating the set of the useful relations, executing the automation script to replay the operation; and attempting, by the system, identification of the target object during the replay using the set of the useful relations.