Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

How to share values between various actions in a test in QTP


Below are the various ways by which values can be transferred between various actions in a test.

Sharing Values via the Global Data Table

Value generated in one action can be shared  with other actions in your test by storing the value in the global Data Table. Each Action in the test can access the global data table and hence can access data from the global data table. For details on how to access various in a data table, see Working With data Tables in QTP


Sharing Values Using Environment Variables

Environment variables are also shared between actions and can be used to share information between various action in the test. Also values can be parameterized using environment variable. To create an environment variable, loading environment variable, and details on environment variable, Please see post on Environment Variables in QTP

Sharing Values Using the Dictionary Object

Values between various actions in a test can be done creating a global dictionary object, and using properties of dictionary object.Below are the steps to share values between actions using globaldictionary object:

To use the Dictionary object, you must first add a reserved object to the registry (in HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\ReservedObjects\) with ProgID = "Scripting.Dictionary". For example: HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\ReservedObjects\GlobalDictionary


Once object has been added, we can add and remove values to the Dictionary in one action and retrieve the values in another action from the same test using scripting dictionary methods.For details on Scripting Dictionary, Please see Working with dictionary Object


 

2 comments:

  1. Your information about qtp is really interesting. Also I want to know the latest new techniques which are implemented in qtp. Can you update it in your website?

    ReplyDelete
    Replies
    1. Thanks for finding the blog interesting. You can find latest on UFT 11.5 on http://qaautomationqtp.blogspot.in/search/label/Questions-Answers UFT 11.5 page .

      Delete