Ask a Question

FindFiles not working

SOLVED
rmnrdi
Contributor

FindFiles not working

This line of code is not finding a file and returning null.

 

foundFiles = aqFileSystem.FindFiles("C:\\Temp\\" , "*.rxi");

//I'm using javascript, hence the escape \

 

Here is a picture of a file in that folder:

FileInFolder.PNG

 

That code is practically copied and pasted from here:

https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfilesystem/findfiles.htm...

 

I also tried a folder on my desktop with the same results. 

 

Anyone had this issue?

 

Any help would be greatly appreciated.

2 REPLIES 2
SaravanaKumar_N
Contributor

@rmnrdi

I did use the same code and .rxi extension file. It did work for me, please refer below...

function FileFinder()
{
  var foundFiles, aFile;
  foundFiles = aqFileSystem.FindFiles("E:\\UsersDirectory\\", "*.rxi");
  if (!strictEqual(foundFiles, null))
    while (foundFiles.HasNext())
    {
      aFile = foundFiles.Next();
      Log.Message(aFile.Name);
    }
  else
    Log.Message("No files were found.");
}

 

image.png

I figured out the problem.

 

I had "hide file extensions for known file types" on.

 

This is what it thought the file name was:

Dang.PNG

 

 

 

 Your answer is the excepted solution because looking at the picture of the log with the full file name and extension made me realize what had happend.

 

Smiley Frustrated

Thanks for your help.

cancel
Showing results for 
Search instead for 
Did you mean: