QTP10.com is a new and completely free website that offers help in all the versions of HP QTP (including latest version 10). More importantly, it offers free code for users of HP QuickTest Professioal. This site helps you in learning the basics of QTP and descriptive/advanced programming in (QTP) on various environments like - .Net, Infragistics, Web, Windows, etc.

Note -
This blog is NOT affiliated with HP / Hewlett-Packard in any way. The data/questions come from various sources and we have our own testing questions. I am just another Software Tester like you.

---------------------------------------------------------------------

Get updates and tips by Email, Twitter & Facebook. To Subscribe, Click on the respective image.




Sunday, July 5, 2009

Create Actions in QTP - Step by Step Tutorial

Share This Post -

Sponsored Links:

You can create new actions and add calls to them, as needed.

You can call the new action from your test flow as a top-level action, or you can call the new action from within another action in your test as a sub-action (or nested action).

 

You can also split an existing action into two actions.

 

To create a new action in your test:

  1. If you want to insert a call to the new action from an existing action in your test, click the step after which you want to insert the new action. To insert a call to the new action from the test flow as a top-level action, click any step.

  2. Select Insert > Call to New Action or click the Insert Call to New Action button on the Insert toolbar. The Insert Call to New Action dialog box opens.Create Actions             
  3. In the Name box, type a new action name or accept the default name. If you rename the action, make sure that the action name is unique (within the test), does not exceed 1023 characters, does not begin or end with a space, and does not contain the following characters:  \ / : * ? " < > | % ' ! { }

  4. In the Description box, add a description of the action. You can also add an action description at a later time using the Action Properties dialog box.

    Tip: Descriptions of actions are displayed in the Select Action dialog box. The description makes it easier for you to choose an existing action you want to call.

  5. Ensure Reusable Action is selected if you want to be able to call the action from other tests or multiple times from within this test. By default, this option is selected. You can also set or modify this setting at a later time using the Action Properties dialog box.

     

  6. Decide where to insert the call to the action by selecting At the end of the test or After the current step. Choosing At the end of the test creates a call from the test flow to a top-level action. Choosing After the current step inserts the call to the action from within the current action (nests the action).

    Note: If the currently selected step is a reusable action from another test, the new action is added automatically to the end of the test (the location options are disabled).

     

     

  7. Click OK. A new action is stored with your test and the call to it is displayed at the bottom of the test or after the current step. You can move your action call to another location at a parallel (sibling) level within your test by dragging it to the desired location. For more information on moving actions, see Using the Test Flow Pane.

  8. If you inserted the call to the new action while editing your test, make sure your new action is selected before adding steps to it.

Go Back to: Working with Actions in QTP 

SPONSORED LINKS: