The Stores > Files collection of a project contains files that you can use for file comparison and verification in your tests. You can delete the files you no longer need:
From TestComplete UI
-
Select the needed file in the Files editor and either choose Delete from the context menu or press Del.
-
Once you do this, you will be asked whether you want to remove the item from the project (but keep the corresponding file), or whether you want to completely delete the item file from the disk.
-
Select the action you want by pressing the Remove or Delete button.
From Tests
To delete files from the Files collection in your scripts and keyword tests, use the Files.Remove
method. This method removes the specified stored file from the collection.
The following code snippet obtains the name of the item that stores the specified file and then deletes this item from the Files collection:
JavaScript, JScript
// Removes the item from the project, but keeps the corresponding file on the disk.
Files.Remove(ItemName);
Python
ItemName = Files.NameByFileName("D:\\Data\\MyFile.txt")
# Removes the item from the project, but keeps the corresponding file on the disk.
Files.Remove(ItemName)
VBScript
' Removes the item from the project, but keeps the corresponding file on the disk.
Call Files.Remove(ItemName)
DelphiScript
// Removes the item from the project, but keeps the corresponding file on the disk.
Files.Remove(ItemName);
C++Script, C#Script
// Removes the item from the project, but keeps the corresponding file on the disk.
Files["Remove"](ItemName);
To delete stored files from keyword tests, call the Files.Remove
method by using the Call Object Method, Run Code Snippet or Run Script Routine operation.