Make an reusable Action

Via the GUI of QuickTest Professional

1. Right-click on the Action.

2. Select the “Action Properties” menu option.

3. Under the General tab, select the “Reusable Action” checkbox.

4. Click <OK>.

Via the Automation Object Model

Starting with QuickTest Professional version 10.0, it is possible to modify the Action object’s property “Type”, from the Automation Object Model (AOM)

Syntax: object.Type [= value]

Syntax Details: The property is a String value with “Read-write” access. Among the values it can show “external” (not valid when setting the property value), “reusable” and “non reusable”

Example:

Set QTP = CreateObject(“QuickTest.Application”)

If QTP.GetStatus = “Not launched” then QTP.Launch

QTP.New

Set action = QTP.Test.Actions.Item(1)

action.Type = “reusable”

Msgbox action.Type

action.Type = “non reusable”

Msgbox action.Type

QTP.Test.SaveAs “C:\MyTest”

Set QTP = Nothing

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s