I am trying to search a specific folder in D:\test directory using QTP. I did spy on the folders. It seems to me all the folders in a containter object. QTP does not recognize folders seperately. Any help?
Example: In C:\Test directory, folders are being created automatically from a VB application. Each time VB application creates a folder, I need to come to C directory to verify whether the folder was created.
Folders names will be test1, test2, test3, qtp1, qtp2, qtp3.
When a new folder gets created with prefix test, the next folder name will be test4. When a new folder gets created with prefix qtp, the fourth qtp folder name will be qtp4, so on.
I need QTP to find out whether the new folder has created with the same prefix in the given directory.
'Folder for getting details
'get the subfolders count in a folder
For each folder in get_subfolder
'compare folder name
If folder.name = "expected value" then
'process to do
If you find that this or any post resolves your issue, mark it as an accepted solution.
The code provided above is free and is just a sample, you need to adapt it and maintain it according to your needs.
Also remember if you have a valid contract with HP feel free to visit our FT/QTP Support Customer Forums: