- June 19, 2016 at 6:43 pm #12461Devanathan RamParticipant@thoughtsofdeva
How do we work with dynamically changing values using object spy in UFT. For example: there is a seat booking app where the availability field shows available, waiting, canceled etc with respective numbers to it. If I capture that field as object it stores the current value by default. If I find with the existing object values then my test would fail when I do the same next day. How do I go about working with this? Any thoughts?August 7, 2016 at 3:30 pm #13300AlinParticipant@groza-alin88
When you add the object in repository, you will see all the properties of that object. Normally, besides the value, it should have other properties like id, class, name, title, html tag etc. Try to find the properties that contain a fixed value even if the entire value is dynamically changing. For example: if the object has the name “availableseats12345678”, it contains a fixed value “availableseats” and a generated 8 digit value at each run. You can use a regular expression like this to identify it: “availableseats.*”. So, it will identify the object with the name that starts with “availableseats”. Additionally, if more objects have the same description, you can set an index in repository for each of them.
Another way is to use the relative position to another object that can be always identified somewhere near; you can set in repository for the dynamically changing object different positions e.g. above, below, etc. the other object.
If using the repository does not work, you can try using the keyboard commands. You can go through the fields by using the tab key and you can enter data in the field or copy data from the field with the SendKeys method.
- You must be logged in to reply to this topic.