examples of user definied functions? how to write user
defined functions in qtp9.2?

Answer Posted / nanda

see..u can write user defined function in many ways.

here i am explaing u one sample example.

Public Function Func_Login(strUser,strPassWord)

Browser().Page().WebEdit("Name:=UserID").set strUser
Browser().Page().WebEdit("Name:=Password").setSecure
crypt.encrypt(strPassword)
Browser().Page().WebButton("Name:=Log In").Click

End Function

When ever u want to login to application u can call this
function with parameter values for User and Password.

Example:
sUser = DataTable.Value("UserName")
sPassword = DataTable.value("Password")

' Call the Login function for loggin in to application..

Func_Login sUser,sPassword

Note : the function can not contain Object repository. So
before calling or executing this function u have to
associate Object repostiroy to the Current Action where
this function is called. And also should assoicate the
function library file where this function is stored.

If any queries..

nanda.dreddy@gmail.com

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to test Web application using QTP software

1419


How to run an integrated test scenario using Multiple Actions? How to use the QTP Step Generator?

3557


How to create a standard checkpoint ?

642


What is data driver in qtp?

659


What is quick test pro? What is a quick test professional?

641






What is the use of Debug Viewer?

1566


Is there any pdf or online book for QTP Scripting? Let me know more about QTP Scripting.

2501


Whether qtp 9.0 supports Test director8.0

2225


Explain advantages and disadvantages of ddf?

684


can the activities of test case design be automated?

1546


What is the basic concept of quicktest professional?

651


Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji

2357


What are parameterizing tests?

626


I am getting the "test object property" Description properties "toolkit class" value By using "gettoproperty" in run time But my problem is how to get Ordinal Identyfier's type and value Type is index, value is 0 How can i keep this values in to required place How can i get these values in runtime I have to insert these "index" and "value" into another area Is there any script for this like "gettoproperties","Getroproperties" If anybody knows,please help me .

1818


If object is not recognized by qtp but the object is standard object what is your approach?

696