Micro Focus QTP (UFT) Forums
Parameterize - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Parameterize (/Thread-Parameterize)

Pages: 1 2


Parameterize - Melody M - 10-04-2010

Hi,
I'm trying to parameterize username, password, customername and tickets.I've entered the contents in the datatable, also the parameter name in the DT column name.....but i'm stuck with the script.....could you please give me the steps for that.
I'm currently working on QTP11

Thankyou in advance


RE: Parameterize - guin.anirban - 10-04-2010

Can you please provide your code?


RE: Parameterize - Melody M - 10-05-2010

Code:
Dialog("login").WinEdit("AgentName").Set Datatable.Value
Dialog("login").WinEdit("AgentName").Set ("username, dt global sheet")
Dialog("login").WinEdit("Agentname").Set("password, dt global sheet")



RE: Parameterize - A.Saini - 10-05-2010

Hi Melody M,

Please try this code....

Code:
' / *    Store the datatable value in variables
strUserName = DataTable("pUserName", dtGlobalSheet)
strPassword =   DataTable("pPassword", dtGlobalSheet)

' / *    Enter the values in the fields
Dialog("login").WebEdit("AgentName").Set strUserName
Dialog("login").WebEdit("Password").SetSecure strPassword

' / *    Note : Change the values of webEdit as per your application


I hope It will work for you......
Smile


RE: Parameterize - Melody M - 10-05-2010

Saini,
Thank you so much for taking my Q!
This time i tried parameterizing Username, password, customername and ticket.....i tried ur code, when i ran the test it failed, but if i run it from step- the test result is done.

Is this normal?

Code:
' / *    Store the datatable value in variables
strUserName = DataTable("pUserName", dtGlobalSheet)
strPassword =   DataTable("pPassword", dtGlobalSheet)

' / *    Enter the values in the fields
Dialog("login").WebEdit("mercury").Set str"Mel"
Dialog("login").WebEdit("mercury").SetSecure strPassword

Dialog("login").WebEdit("Jojo").Set str"Mary"
Dialog("login").WebEdit("jojo").SetSecure strPassword

Dialog("login").WebEdit("Jojo").Set str"Sia"
Dialog("login").WebEdit("mercury").SetSecure strPassword



RE: Parameterize - A.Saini - 10-06-2010

Hi Melody,

Please update your code by following the below example.

Code:
' / *  Your Code
Dialog("login").WebEdit("mercury").Set str"Mel"

' / *  Updated Code
Dialog("login").WebEdit("mercury").Set "Melody"

' / *  or you can use
strName = "Melody"
Dialog("login").WebEdit("mercury").strName

I hope It should work .....

Smile


RE: Parameterize - Melody M - 10-06-2010

Thank you Ankur, i'll try with the updated code:-)


RE: Parameterize - Melody M - 10-07-2010

Ankur,
Still not workingSad Its not your script, gotto be some mistake from my side....thank you anyways!


RE: Parameterize - KavitaPriyaCR - 10-08-2010

I am working on version 10...have not worked on version11, Try this once and pls let me know if it works
Code:
' / *    Store the datatable value in variables
strUserName = DataTable.Value("pUserName", dtGlobalSheet)
strPassword =   DataTable.Value("pPassword", dtGlobalSheet)

' / *    Enter the values in the fields
Dialog("login").WebEdit("AgentName").Set strUserName
Dialog("login").WebEdit("Password").SetSecure strPassword



RE: Parameterize - Melody M - 10-08-2010

Ankur and Kavitha,
I tried this code and the results were done without any errors......thank you bothSmile

Code:
Parameterizing- Username(AJ), password(mercury), tickets( 2) and customername(mel)

strName = "AJ"
Dialog("login").WebEdit("mercury").strName

strName="Tickets"
Dialog("login").wedEdit("2").strName

strName="Mel"
Dialog("login").wedEdit("Mel").strName