Forum Discussion

thebick's avatar
thebick
Occasional Contributor
6 years ago
Solved

aqFile* Exists not find application-created folder

My application creates a folder during execution, but TestComplete's aqFile* methods don't find it during the test.

Not aqFile.Exists, not aqFileSystem.Exists, not aqFileSystem.FindFolders. (But they do find the already-existing parent)

If I leave the folder in place and run a second test, it finds the folder.

If I call CreateFolder() during the test, FindFolders() finds only that folder, not the one my app created.

I'm running on a Windows 10 VM on Windows 10. The folder is on the host, shared with the VM.

The test is written in Python.

How can I get TestComplete to find the folder that my application creates during the test?

 

Correction: The folder is on the VM, not shared from the host

5 Replies

  • Wamboo's avatar
    Wamboo
    Community Hero

    Hi thebick,

     

    Can you share with us a code example?

      • thebick's avatar
        thebick
        Occasional Contributor

        Not sure I understand what you mean.

        When the application creates the folder (and a lot of sub-folders), I can see it easily in File Explorer -- just not via TC.

        I do not have access to source code, so I can't change how it behaves.

         

        Or are you suggesting something else?

    • thebick's avatar
      thebick
      Occasional Contributor
      # Portion of test script written in Python
      # FormToCreateDirectory has already been properly assigned
      # This function works and creates the directory
      FormToCreateDirectory.OKButton.ClickButton()
      parentDir= "D:\\parentDir"
      if not aqFileSystem.Exists(parentDir):
         Log.Error("Can't find " + parentDir)
      # If I don't have this line, foundFolders is None
      aqFileSystem.CreateFolder(parentDir + "\\" + "bogusFolder")
      foundFolders = aqFileSystem.FindFolders(parentDir)
      if foundFolders != None:
          Log.Error("No folders in " + parentDir)
      while foundFolders.hasNext():
         aFolder = foundFolders.Next()
         Log.Message("found folder " + aFolder)

      The only Folder found is bogusFolder