I have to automate a series of manual tests which contain a time window for which the user has to wait for a period of time - 48h.After this period, the status of my objects is changed. And this I have to check, if the status has changed. Is there a way to automate this using QTP/UFT, only on the UI? Or DB changes are needed in order to speed up those 48 hours?
There are several ways you can do this, depending on the nature of your application. Some suggestions:
- If status changes based on time since creation and you have access to the database, part of your setup is to set the database object creation timestamp to 47:00:59 before now, then wait one second and check the object.
- If there is a configurable wait time in the application (such as setting a cool-down time of 48 hours) you can change that setting to something like 30 seconds; create your object, then wait 30 seconds to check that its status changed on schedule.
- If you are running tests on a schedule, you can get creative and have part of your setup create the objects and use the expected "maturation time" in their name if you can. Then you check them during the test run two days later. (I don't recommend this if you can possibly avoid it. It's complicated, messy, and has far too many dependencies involved. But it may be all you have available to you).
- You can mock the date/time to be what you choose, and set your mock date/time value to when you expect the object to change status.
If I had to test this scenario, I'd probably use a combination of #1, #2, and #4 so I had some tests covering status change 48 hours after creation, some covering honoring the wait time interval, and some focusing only on the status change.
Regardless of the way you approach the problem, you will need to use code rather than the UFT GUI to create and modify your tests.