Forum Discussion

Ned's avatar
Ned
Occasional Contributor
5 years ago
Solved

How can I check the time stamp of filename and know the file just got created

Hi. Hope someone can help me with TestComplete, I am testing a web application that requires to check a series of files got created once the user processes a new order, one order creates 10 image file (Filename001.jpg, Filename002.jpg and so on).  The current folder may have other files previously created so the only way I can think is to check the timestamp of the files and it should be close to the system clock and then check the number of files created is 10.

 

 If anyone knows of another way to know the files were created, it will be greatly appreciated.  

 

Thank you.

  • Well, if you know how many files are in the folder before you start, you can then check the number of files in the folder AFTER and see if the difference between the two numbers = what you're looking for.

     

    Either way, you're going to want to look at methods in the aqFileSystem object.   FindFiles will find all files in a folder matching a search pattern.  GetFileInfo will get the information (like creation date) from a specific file.  Some adaptation of any of these, I think, will help you meet your needs.

     

    https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfilesystem/methods.html

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Well, if you know how many files are in the folder before you start, you can then check the number of files in the folder AFTER and see if the difference between the two numbers = what you're looking for.

     

    Either way, you're going to want to look at methods in the aqFileSystem object.   FindFiles will find all files in a folder matching a search pattern.  GetFileInfo will get the information (like creation date) from a specific file.  Some adaptation of any of these, I think, will help you meet your needs.

     

    https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfilesystem/methods.html

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Thank you so much tristaanogre for the suggestions.

       

      Hi Ned! Does this approach work for you?