Monday, 8 August 2011

How to use Dynamic Descriptive program in QTP?

 We can create objects by passing the property values dynamically to the function and create the objects so that the function can separate from the objects and used on any application

Set myDialog = Description.Create()
myDialog("Text").value = "Login"
mydialog("Enabled").value = "True"

Set Agent = Description.Create()
Agent("Attached text").value="Agent Name:"

Set password = Description.Create()
password("Attached text").value="Password:"

Set btnOK = Description.Create()
btnOK("Text").value = "OK"

call fnDialogLogin(myDialog,Agent,password,btnOk,"Test","mercury")

msgbox "Execution completed"


Function fnDialogLogin(objDialog,objUserid,objPassword,objLogin,strUserid,strPassword)
    Dialog(objDialog).winEdit(objUserid).Set strUserid '"test"
    Dialog(objDialog).winEdit(objPassword).Setsecure strPassword' "4e3bb8c872c2f2b9b5bdf31a221035f1747d7aac"
    Dialog(objDialog).winButton(objLogin).Click
End Function

No comments:

Post a comment