cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
Highlighted
Occasional Contributor

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

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

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


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

2 REPLIES 2
Highlighted
Community Hero

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

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


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Community Manager

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

Thank you so much tristaanogre for the suggestions.

 

Hi @Ned! Does this approach work for you?


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!
Top Kudoed Authors