How to do parameterization in HP UFT/QTP

Parameterization is used to replace the hard coded recorded values in the code.

How to do parameterization in HP UFT/QTP

1. Record the script and find out the values that you want to parameterize it.

2. Refer below – user login id is intended to parameterize here.

3. Click on View > Keyword View

keyword view
keyword view

4. Will bring the below screen and click the value field (marked in green below)

keyword edit
keyword edit

5. should bring below screen

keyword edit table
keyword edit table

6. Select parameter and give a meaningful name as below

keyword parameter
keyword parameter

7. click ok

keyword parameter ok
keyword parameter ok

8. now go back to Editor

qtp editor view
qtp editor view

9. as you see below, original code is updated with parameterization and you could see the script execution window updating the application under test (gmail.com) is updated with the parameterized value.

qtp source code
qtp source code

 

 

10. QTP results viewer is updated with parameterized values

qtp results

qtp results