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

can we install qtp in windows vista

2 Answers  


hi all can any body explain how to write the script for finding the mandatory fields which are having [red Astrik sign (*)]

0 Answers   Accenture,


What are the Features & Benefits of Quick Test Pro (QTP)..?

5 Answers  


What is the Major difference between QTP ; LoadRunner? If u want to test an 1. erp module which automation tool you would prefer and why? and 2. for web application, which tool and why?

2 Answers   Satyam,


What are some test assets and related extensions of qtp?

0 Answers  






While writing script using For Next Statement in QTP, I try defining the variable in Lib File I am getting syntax error whereas if I use the variable in script file, the script works fine. Can anyone help me in finding the reason behind this?. E:g Dim intStartRow (Define in Lib File----- say abc.vbs) Dim intRow (If I define this variable in Lib file I am getting Syntax error where as if I define in the script file ---- say xyz.mts the script works fine) IntStartRow=2 For intRow = intStartRow to xlWrksht.UsedRange.Rows.Count ‘Some Code here Next

1 Answers  


How can we QTP Scripts in xml format? is there any way to do so?

2 Answers   Apex,


How to invoke QTP through VBscript?Send me full code along with description of the code.Thanks in Advance

1 Answers   Capco,


If created one virtual object? Next time I changed the window position will it work?

0 Answers  


One build is delivered. in that build button name is submit. but in the next buit that name of the button changed as login.are u continue with previous recorded script or u make any changes?

6 Answers   Covansys,


Hi, Has anybody attended IBM interview on 17th APR 2010,and got offer letter? I had given interview and selected also but still did not recieve offer letter.

5 Answers   IBM,


In QTP, If you have list of checkboxes, how can i select a particular checkbox and delete if the checkboxes are changing dynamically?

0 Answers  


Categories