0

i want to find the latest updated/modified file name in QC attachment for the current test using QTP code. can anyone please help on this?

1 Answers1

0

Well, provided you know the QC/ALM OTA API and know how to retrieve an reference to the test instance you want to refer to:

Every Test instance has an Attachments factory object. Its items are Attachment instances. Every Attachment instance has a Modified property, which contains the date and time when the attachment was modified.

As far as I remember it returns the modified date in the long date format of your locale, so its format is (unfortunately) dependent upon the country-specific international setting of the machine (not sure if server´s, or client´s).

So to find the "youngest" attachment, iterate over all attachments and inspect their Modified property, keeping a reference to the one with the largest (in terms of time) value.

I am not sure if the timestamp in Modified refers to when the attachment has been modified, or to the "modified" timestamp of the attachment file at the time it was uploaded.

(As long as you don´t provide any code you´ve tried, I won´t paste code here.)

TheBlastOne
  • 4,291
  • 3
  • 38
  • 72