GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Testing Tools  >  QTP
Go To First  |  Previous Question  |  Next Question 
 QTP  |  Question 667 of 684    Print  
QTP User Defined Functions
How to write and where we call user defined functions in QTP? Give an example.


  
Total Answers and Comments: 2 Last Update: November 13, 2008     Asked by: sirin321 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: govindraj
 
We can write user define functions in QTP Editor or in notepad also. when we write funtions in notepad we have to save file with .vbs extention. and close notepad then we can use that file in qtp resources. in resources we give notepad file path. than we can use funtion directly by functions name....

Above answer was rated as good by the following members:
Ruparamesh, cumac
September 07, 2008 11:40:28   #1  
govindraj Member Since: September 2008   Contribution: 5    

RE: QTP User Defined Functions
We can write user define functions in QTP Editor or in notepad also. when we write funtions in notepad we have to save file with .vbs extention. and close notepad then we can use that file in qtp resources. in resources we give notepad file path. than we can use funtion directly by functions name....
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
November 13, 2008 15:54:20   #2  
sivagarlapati Member Since: January 2007   Contribution: 18    

RE: QTP User Defined Functions

Using QuickTest you can define and store your user-defined functions either in a function library (saved as a .qfl file by default) or directly in an action within a test. A function library is a Visual Basic script containing VBscript functions subroutines modules and so forth. You can also use QuickTest to modify and debug any existing function libraries (such as .vbs or .txt files).

When you store a function in a function library and associate the function library with a test the test can call the public functions in that function library. Functions that are stored in an associated function library can be accessed from the Step Generator (for tests and function libraries) and the Operation column in the Keyword View as well as being entered manually in the Expert View.

When you store a function in a test action it can be called only from within that action—the function cannot be called from any other action or test. This is useful if you do not want the function to be available outside of a specific action.

You can also define private functions and store them in a function library. Private functions are functions that can be called only by other functions within the same function library. This is useful if you to reuse segments of code in your public functions.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

Latest Answer : font color change?font size?how can we save data in excel file?how can we open excel file at run time?how can we fetch data from excel file? ...

Latest Answer : One of the examples for vbs function library is,Suppose a web page has a web table column at the starting of the page with 4 tabs and clicking each tab will produce separate frames in the page.Then function should be somewhatClicktab(tabname){................................................................}Thsi ...

How to do the scripting.  Is there any inbuilt functions in QTP as in QTP-S.  Whatz the difference between them?  how to handle script issues? 

Latest Answer : We can use Predefined functions and User defined function. Predefined funtions are inbuilt in vbscript. Predefined functions are used directly by pre-defined name and user defined functions are defined by user. If functions are defined external then ...
Read Answers (5) | Asked by : chaw

These are the new features which are available in QTP8.2 and which are not present in 6.5 version.Keyword View: Lets you easily build and maintain tests without writingVBScripts.Auto-Documentation: Provides 
Latest Answer : Really great help,Thanks ...
Read Answers (2) | Asked by : James

Give an example of a regular expression,user-defined function and built-in-function?how to make a user-defined function reusable?
Read Answers (2) | Asked by : Mann

Does qtp allows us to execute sql statements(like select..) with the help of any vb functions? winrunner does this with the help of db_connect(),db_execute_query(),db_write_records().
Read Answers (2) | Asked by : thanu

Hi,what is the procedure of doing SQL/database testing?Is a tester suppose to create procedures,functions,views,triggers etc?
Read Answers (2) | Asked by : mann

Latest Answer : The code is not working in QTP 9.0. But it worked fine in QTP 8.0. Please suggest something how to add the repository at run time in QTP 9.0 Set QtApp = CreateObject("QuickTest.Application") Set QtTestResources = QtApp.Test.Settings.Resources QtTestResources.Add ...
Read Answers (2) | Asked by : Rajesh Kumar

Latest Answer : Public :  In any testing tool not only the QTP if we declare as a Public then we can use that variable to any function within the scriptPrivate : we can use that variable within the function sudhakar kolla,My email:kollasudhakar2005@yahoo.co.in.My ...
Read Answers (3) | Asked by : rekha


 Sponsored Links

 
Related Articles

SQA Software and Tools

SQA Software and Tools In quality assurance it is always important to get all the help we could get In other industries developers could easily check the products manually and discard those that do not meet the standard The length and the width of the product are checked to maintain standardization
 

Microsoft AJAX Library - Anonymous Functions

Anonymous Functions Anonymous functions can be created adhoc and used instead of a named function Although this can hinder readability when the function is more complex you can do this if you don t intend to reuse a function s code In the following example we pass such an anonymous function to Displ
 

Microsoft AJAX Library - Functions as Variables

Functions as Variables In JavaScript functions are first class objects This means that a function is regarded as a data type whose values can be saved in local variables passed as parameters and so on For example when defining a function you can assign it to a variable and then call the function thr
 

Microsoft AJAX Library - JavaScript Functions

JavaScript Functions A simple fact that was highlighted in the previous chapter but that is often overlooked is key to understanding how objects in JavaScript work code that doesn t belong to a function is executed when it s read by the JavaScript interpreter while code that belongs to a function is
 

Business Network Virtual Communication Tools

Business Network Virtual Communication Tools Since ages the Business community heavily relied on face to face communication for building Business relationships Face to face communications formed the basis for trust in a relationship An individual’ s appearance or the physical appearance of
 

ERPAdvantages for Management Functions

ERP Advantages for Management Functions ERP management systems provide a technology platform in which organizations can integrate and coordinate their main internal business processes They use this to fight against the problem of the organizational inefficiency brought on by the use of different sys
 

C++ Static Functions

C Static Functions Static member functions have a class scope and they do not have access to the this pointer of the class When a member is declared as static a static member of class it has only one data for the entire class even though there are many objects created for the class The main usage of
 

C++ Virtual Functions

C Virtual Functions What are Virtual Functions Virtual as the name implies is something that exists in effect but not in reality The concept of virtual function is the same as a function but it does not really exist although it appears in needed places in a program The object oriented programming la
 

C++ Inline Functions

C Inline Functions In this C tutorial you will learn about Inline function what is inline function reason for the need of inline function what happens when an inline function is written general format of inline function explained with example mosgoogle center What is Inline Function Inline functions
 

What are Data Access Tools

Data access is the process of entering a database to store or retrieve data. Data Access Tools are end user oriented tools that allow users to build structured query language (SQL) queries by pointing and clicking on the list of table and fields in the data warehouse. Thorough computing history, t
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape