Deleting Property Collections From Stores

Applies to TestComplete 15.63, last modified on April 23, 2024

The Objects collection of the Stores project item contains a collection of object properties that can be used in tests. If you no longer need a property collection, you can delete it from the Objects collection either by using the Objects editor, or from your test.

Deleting Property Collections From the Objects Editor

To delete a property collection from the Objects collection of the Stores project item:

  • Select the needed property collection in the Objects 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 file corresponding to the item from the disk.

  • Select the action you want perform by pressing the Remove or Delete button.

Deleting Property Collections From Tests

To delete a property collection from a test, use the Remove method of the Objects object. This method removes the specified property collection from the project.

The following code snippet checks whether the property collection with the specified name exists in the Objects collection and then deletes it from the collection (but keeps the XML file that stores the property collection on the disk).

JavaScript, JScript

if (Objects.Contains("wndNotepad"))
  // Removes the property collection from the project
  Objects.Remove("wndNotepad");

Python

def Test():
  if Objects.Contains("wndNotepad"):
    # Removes the property collection from the project
    Objects.Remove("wndNotepad")

VBScript

If Objects.Contains("wndNotepad") Then
  ' Removes the property collection from the project
  Objects.Remove("wndNotepad")
End If

DelphiScript

if Objects.Contains('wndNotepad') then
  // Removes the property collection from the project
  Objects.Remove('wndNotepad');

C++Script, C#Script

if (Objects["Contains"]("wndNotepad"))
  // Removes the property collection from the project
  Objects["Remove"]("wndNotepad");

To call the Remove method in keyword tests, use the Call Object Method, Run Code Snippet or Run Script Routine operation.

See Also

About Objects Collection
About Objects Editor

Highlight search results