RepositoriesCollection Object

Description

A collection object that enables you to programmatically manage the run-time collection of shared object repository files associated with the current action.

IMPORTANT

At the beginning of a run session, the RepositoriesCollection object contains the same set of object repository files as the Associated Repository Files tab of the Action Properties dialog box. The operations you perform on the RepositoriesCollection object affect only the run-time copy of the collection.

You use the RepositoriesCollection object to associate or disassociate shared object repositories with an action during a run session. This enables you to perform steps on test objects that are stored in that repository without recording on the object or permanently associating the repository with the action.

For example, suppose you want to test a Web application that supports twenty different languages. Instead of creating twenty different tests (one for each supported language), you can create one test and run multiple iterations of that test—one for each language version of your application. If you create one or more shared object repository files for each version, you can use the RepositoriesCollection object to load the required shared object repository files for each iteration. Then, when each iteration finishes, you can use the RepositoriesCollection object to remove these object repository files prior to loading the object repository files required for the next iteration.

Methods and Properties

Method AddChecks that an object exists.
Method CountReturns the value of the specified description property from the test object description.
FindFinds the index position of the specified object repository file within the run-time collection of shared object repository files associated with the current action.
Item

Returns the path of the object repository file located in the specified index position within the run-time collection of shared object repository files associated with the current action.

MoveToPosMoves the object repository file entry from the current index position to the specified new index position within the run-time collection of shared object repository files associated with the current action.
RemoveFinds the object repository that is located in the specified index position and removes it from the run-time collection of all object repository files associated with the current action.
RemoveAllRemoves all object repository files from the run-time collection of object repository files associated with the current action.

Back to top

Add Method

Description

Adds an object repository file to the specified index position in the run-time collection of shared object repository files associated with the current action.

Syntax

RepositoriesCollection.AddRepositoryPath, [Position]

Argument

Type

Description

RepositoryPath

String

Required. The absolute or relative path of the shared object repository that you want to add.

Position

Number

Optional. The index position to which you want to add the shared object repository in the run-time list of associated shared object repositories. If you do not specify a position, the object repository is added to the end of the list (position = -1).

Return Value

None

Back to top

Count Property

Description

The number of object repository files in the run-time collection of shared object repository files associated with the current action.

Syntax

RepositoriesCollection.Count

Return Value

Read-only. A Number.

Back to top

Find Method

Description

Finds the index position of the specified object repository file within the run-time collection of shared object repository files associated with the current action.

Syntax

Pos = RepositoriesCollection.FindRepositoryPath

Argument

Type

Description

RepositoryPath

String

The absolute or relative path of the shared object repository that you want to find.

Return Value

A Number representing the index position in the repository collection. Index position values begin with 1. Returns -1 if the specified path is not found.

Back to top

Item Property

Description

Returns the path of the object repository file located in the specified index position within the run-time collection of shared object repository files associated with the current action.

Syntax

RepositoriesCollection.Item(Position)

Argument

Type

Description

Position

Number

The index position of the shared object repository that you want to retrieve from the collection. The first repository in the collection is numbered 1.

Return Value

Read-only. A String value.

Back to top

MoveToPos Method

Description

Moves the object repository file entry from the current index position to the specified new index position within the run-time collection of shared object repository files associated with the current action.

Syntax

RepositoriesCollection.MoveToPosCurrentPosition, NewPosition

Argument

Type

Description

CurrentPosition

Number

Required. The current index position of the shared object repository in the action's list of associated object repositories. Index position values begin with 1.

NewPosition

Number

Required. The index position to which you want to move the shared object repository in the action's list of associated object repositories. Index position values begin with 1.

Return Value

None

Back to top

Remove Method

Description

Finds the object repository that is located in the specified index position and removes it from the run-time collection of all object repository files associated with the current action.

Syntax

RepositoriesCollection.RemovePosition

Argument

Type

Description

Position

Number

The index position of the shared object repository you want to remove from the list. Index position values begin with 1.

Return Value

None

Back to top

RemoveAll Method

Description

Removes all object repository files from the run-time collection of object repository files associated with the current action.

Syntax

RepositoriesCollection.RemoveAll

Return Value

None

Back to top

See also: