Parametrize the name field in QTP

I am a new learner in Qtp and Practising it .This is query I have a very basic doubt,

I recorded a script in mercury website tours. I wanted to parametrize the name field.
when I did it with Global it worked . But every time it logged in and added the users from the data table . I wanted the script to login in Once and add the users.
i tried it with the local sheet it did it work.

This is the script I recorded. QTP EXPERTS answer my query. This is the recording of the
script.
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set "sjsai70"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "4619dd02052b5530abe5ef1ffb5c278b5d051064"
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Image("Sign-In").Click 55,2
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").Sync
Window("Microsoft Outlook").Activate
Browser("Welcome: Mercury Tours").Page("Find a Flight: Mercury").Image("findFlights").Click 98,18
Browser("Welcome: Mercury Tours").Page("Select a Flight: Mercury").Image("reserveFlights").Click 52,12
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passFirst0").Set "shailaaja"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebEdit("passLast0").Set "j"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebList("pass.0.meal").Select "Bland"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").WebList("pass.0.meal").Select "Vegetarian"
Browser("Welcome: Mercury Tours").Page("Book a Flight: Mercury").Image("buyFlights").Click 70,7
Browser("Welcome: Mercury Tours").Page("Flight Confirmation: Mercury").Image("backtoflights").Click

Questions by cindrela   answers by cindrela

Showing Answers 1 - 6 of 6 Answers

CRC

  • Apr 17th, 2007
 

Parameterize the name field in QTP in mainly 3 types

1. Datatable
2. Method Argument
3. Dynamic in Datatable

Step 1: First of all we will create parameter for name field like "UName" This parameter should be created in ActionSheet

Step 2: After that connect the parameter to the name field through the Keyword View

Step 3: After select the Keyword view we should select the Value column in Keyword view and press the icon of the value column right side.

Step 4: after that we got parameter box in that we will select Parameter option in that we select Data Table and select parameter in value list box and press ok button it automatically effect in the expert view in the name field line like
"Datatable("Uname","Action1").Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Set Datatable("Parametername","Action1")

Same as Password also
Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("password").SetSecure "4619dd02052b5530abe5ef1ffb5c278b5d051064"

  Was this answer useful?  Yes

VK

  • Jul 4th, 2007
 

After Finishing the Recording. Steps to be follow as:

1. Go to Data Driven...
2. Select the option what field you want to parametrize.
3. Enter the values or data in Data table.
4. Run it..

Regards,
VK

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions