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

Answers were Sorted based on User's Feedback



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

Answer / viswanath

Its better to write user defined functions by using
Descriptive programing in notepad and save them as .vbs
extension. we can upload those files in QTP and we can use
those functions.

Is This Answer Correct ?    3 Yes 0 No

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

Answer / 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

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

Answer / sonu

using function definition generator,we can also write functions.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More QTP Interview Questions

WHAT IS PARAMITARIZATION?

8 Answers  


In how may ways we can use checkpoints to an application using QTP?

3 Answers  


Plz write the code, function will take the parameter as month number, i.e., numerical value, but it returns the last day of the month in string (weekday). example: input: function parameter: 3(march) output: thursday

1 Answers  


key word driven frame work is like a folder structure Question is that where is the folder like funtion library folder,object repository,data base,application scenerio folder etc are store whether in a remote machine where we have to access or in our machine (it just like VSS)

0 Answers   Kanbay,


I want to execute 1st row of the local sheet and 3rd row of the global sheet parellely. write script to execute

2 Answers   IBM,


results.xls file is automatically generated while running the script in QTP.But it is showing error to open the file

1 Answers  


In Keyword driven frame work you have write 30 test case for one scenario,in which 10 test cases are failed while executing.client asked you to execute only the failed test cases. HOw can you execute only failed test cases

2 Answers   IBM,


What we are looking for is to load properties of object dynamically as for our application the global repository will pretty huge. It will be really helpful to us if something similar to following functions of Winrunner is available in QTP. #Define descriptor auto strDesc; #set property in the descriptor Gui_desc_set_attr(strDesc,?Class?,?Edit?); --- put other properties #Add Edit box to GUI Map Gui_add(? ?,strWindowName,strEditboxName,strDesc);

0 Answers  


How to test whether the navigation i.e. from one page to another is working r not using QTP for web based application

1 Answers  


What is the difference between keyword view and expert view?

0 Answers  


Hi All I am installing QTP 8.0/8.2 in my office desktop (WIN XP) but it is not working. Inspite Installion is succesfully done but when i open qtp from programs it opens only first screen of add-in and after that it disappears. But in my other computer at home (winxp) it is working fine. Can you please give the reason, why it is not working in office desktop. DEEPAK SINGH

4 Answers   Satyam,


abt filter function if iam using below two statments its ok My = Array ("Apples","Oranges", "Apricots") MyResult = Filter(My, "Oran") if i use msgbox MyResult it shows type mismatch plz help me

2 Answers  


Categories