SlideShare a Scribd company logo
QTP Functions




Why User Defined Functions?
Working with User Defined Functions
Associated to a test object
 Global




Functions Scope
Private
 Public




Using the Function definition Generator
Function Definition
 Registering Function








Documenting function

Adding function to Expert View
RegisterUserFunc
Calling the registered function
Session Wrap-Up
pgorantla.blogspot.com


A user-defined function encapsulates activities or steps
that require programming into operations (or
keywords). These operations can then be used to
enhance your test or component.



User defined functions helps in:


maintaining the modularity of the code



Reusability

pgorantla.blogspot.com


QTP allows creating two types of user defined functions





Associated to a test object
Global

Associated to a test object




QTP allows to register a function and associate with a test object. It is also
possible to set that operation as the default operation for the selected test
object.

Global


When a function is not associated with any test object, then it is termed as
Global Functions. Global functions can be called by selecting the Functions
category in the Step Generator (Can be invoked from Insert -> Step -> Step
Generator)
pgorantla.blogspot.com


Public:




Public functions are those which can be called
/accessed from multiple tests or components. To
make a function public, the function should be defined
and saved in the function library file.

Private:


Private functions are those that are defined in that
action using the Expert View. Such functions cannot
be called from another action.
pgorantla.blogspot.com


Quick Test provides a Function Definition Generator, which enables to generate definitions for new userdefined functions and add header information to them.



It also facilitates in the Function Definition Generator to register a function to a test object.



After filling the required information, the Function Definition Generator creates the basic function
definition for the user.



The function definition can be then copied to a library file and associate it with the test or component of the
definition can be directly copied to a test script.



The Function Definition Generator can be invoked from Start -> Programs -> QuickTest Professional ->
Tools -> Function Definition Generator.

Note:
•

If you are planning to register functions, before you open the Function Definition Generator for the first time, make
sure that you open QuickTest at least once. This enables the Function Definition Generator to access all of the test
objects and their operations.
pgorantla.blogspot.com
The Function Definition section allows to define the function name
and arguments.


Parts of Function Definition


Name




Type





Function - returns value to the calling function
Sub - Doesn’t return value to the calling function

Scope




Name of the function to be specified

Either Public or Private

Arguments




Click on
Click on
Click on

icon to add a new argument
icon to delete an argument
the to change the order of the arguments

Note:
•
•

If you create a user-defined function manually and do not define the scope as Public or Private, it will be treated as a
public function, by default.
Only public functions can be registered to a test object.
pgorantla.blogspot.com


Parts of Registering Function



The Register to a test object frame allows the user to register the
function with a test object. This option is available only for public
functions.



Test Object

 includes all available test objects
 (i.e., ActiveX Object, Standard Windows Object, Web Objects etc., )



Operation

 contains the corresponding operations for the selected test object
 The user can either type in a new operation name in order to create a new

operation or select an existing operation to overwrite.



Check the option ‘Register as default operation’ to make the selected
operation as default
pgorantla.blogspot.com


The below screen shows that a new function with name ‘verify’ has been created and it has been
associated to a test object ‘WebEdit’ and with the operation ‘Verify’.



Since, the option ‘Register to a test object’ is selected, the RegisterUserFunc statement is added to
pgorantla.blogspot.com
the end of the Function line.
Clicking on this arrow will
popup to add test object
type and test object
name






The Additional Information tab is used to enter some useful information about the
function.
It is also possible to enter the test object name and type in the Documentation field.
The test object name and type can be selected by clicking on the arrow beside the
documentation field.

pgorantla.blogspot.com
After entering the sufficient information in the Function
Definition Generator, Click on the ‘Copy’ button to
copy the syntax.
 In the Expert view, choose paste to the paste the
function definition.
 The function looks like below when pasted to the
The function related
code goes here
Expert view.


pgorantla.blogspot.com


Syntax




RegisterUserFunc TOClass, MethodName, FunctionName, SetAsDefault

Description
Argument

Type

Description

TOClass

String

The tests object class for which you want to register
the method.

MethodName

String

The method you want to register.

FunctionName

String

The name of your user-defined function. The
function can be located in your action or
component, or in any library file associated with
your test or component.

SetAsDefault

Boolean

Indicates whether the registered function is used as
the default method for the test object.



For example:


RegisterUserFunc “WebEdit”, “verify”, “verify”, true
Function Name

Operation Name

Test Object Name

pgorantla.blogspot.com


Invoke the Step Generator to add a new
step.



Select the category as ‘Test Objects’



Select a WebEdit object as the function that
is created is for the ‘WebEdit’ Objects. Here,
in this window, the ‘PassFirst0’ web edit
object is selected.



By default, the newly created operation
‘Verify’ is selected as the operation was set
as the default operation at the time of
creation.



If it is not set as the default operation, the
user has to select from the list of operations

pgorantla.blogspot.com
Prep Session Introduction

Q & A….

ATS Application Testing

pgorantla.blogspot.com


User defined functions can be created using Function
Definition Generator or by directly typing the function
header in Expert View.



Scope of Functions are of two types:





Public
Private

Two types of user defined functions can be created:



Associated to a test object
Global



Only public functions can be registered to a test object.



Any number of arguments can be created for a function.
pgorantla.blogspot.com


If a function is associated with a test object, then the
first argument should be the test object name.



If a particular method is set as the default operation,
then in keyword view, dropping down the operation
combo shows the newly created method.



It is possible to register any method using
RegisterUserFunc statement.



It is possible to enter function headers using Function
Definition Generator.
pgorantla.blogspot.com

More Related Content

What's hot

Qtp 92 Tutorial Anil
Qtp 92 Tutorial AnilQtp 92 Tutorial Anil
Qtp 92 Tutorial Anil
guest3373d3
 
qtp 9.2 features
qtp 9.2 featuresqtp 9.2 features
qtp 9.2 features
krishna3032
 
Qtp 9.2 Tutorial
Qtp 9.2 TutorialQtp 9.2 Tutorial
Qtp 9.2 Tutorial
guest37ae7f
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769
subhasis100
 
Qtp Basics
Qtp BasicsQtp Basics
Qtp Basics
mehramit
 
Web service testing using QTP (UFT)
Web service testing using QTP (UFT)Web service testing using QTP (UFT)
Web service testing using QTP (UFT)
NaveenKumar Namachivayam
 
QTP with Descriptive programming
QTP with Descriptive programmingQTP with Descriptive programming
QTP with Descriptive programming
Kuldeep Sharma
 
Qtp interview questions and answers
Qtp interview questions and answersQtp interview questions and answers
Qtp interview questions and answers
Ramu Palanki
 
3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k
IBM
 
IBM Performance Optimizaiton Toolkit for Rational Performance Tester
IBM Performance Optimizaiton Toolkit for Rational Performance TesterIBM Performance Optimizaiton Toolkit for Rational Performance Tester
IBM Performance Optimizaiton Toolkit for Rational Performance Tester
Ashish Patel
 
TEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROLTEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROL
Nyarai Tinashe Gomiwa
 
New features in qtp11
New features in qtp11New features in qtp11
New features in qtp11
G.C Reddy
 
First QTP Tutorial
First QTP TutorialFirst QTP Tutorial
First QTP Tutorial
tjdhans
 
Write testable code in java, best practices
Write testable code in java, best practicesWrite testable code in java, best practices
Write testable code in java, best practices
Marian Wamsiedel
 
Learning Robotic Process Automation-81-167
Learning Robotic Process Automation-81-167Learning Robotic Process Automation-81-167
Learning Robotic Process Automation-81-167
Nicolas Benjamin Cruz Carpio
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
alice yang
 
New features in qtp11
New features in qtp11New features in qtp11
New features in qtp11
Ramu Palanki
 

What's hot (17)

Qtp 92 Tutorial Anil
Qtp 92 Tutorial AnilQtp 92 Tutorial Anil
Qtp 92 Tutorial Anil
 
qtp 9.2 features
qtp 9.2 featuresqtp 9.2 features
qtp 9.2 features
 
Qtp 9.2 Tutorial
Qtp 9.2 TutorialQtp 9.2 Tutorial
Qtp 9.2 Tutorial
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769
 
Qtp Basics
Qtp BasicsQtp Basics
Qtp Basics
 
Web service testing using QTP (UFT)
Web service testing using QTP (UFT)Web service testing using QTP (UFT)
Web service testing using QTP (UFT)
 
QTP with Descriptive programming
QTP with Descriptive programmingQTP with Descriptive programming
QTP with Descriptive programming
 
Qtp interview questions and answers
Qtp interview questions and answersQtp interview questions and answers
Qtp interview questions and answers
 
3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k3 know more_about_rational_performance_tester_8-1-snehamoy_k
3 know more_about_rational_performance_tester_8-1-snehamoy_k
 
IBM Performance Optimizaiton Toolkit for Rational Performance Tester
IBM Performance Optimizaiton Toolkit for Rational Performance TesterIBM Performance Optimizaiton Toolkit for Rational Performance Tester
IBM Performance Optimizaiton Toolkit for Rational Performance Tester
 
TEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROLTEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROL
 
New features in qtp11
New features in qtp11New features in qtp11
New features in qtp11
 
First QTP Tutorial
First QTP TutorialFirst QTP Tutorial
First QTP Tutorial
 
Write testable code in java, best practices
Write testable code in java, best practicesWrite testable code in java, best practices
Write testable code in java, best practices
 
Learning Robotic Process Automation-81-167
Learning Robotic Process Automation-81-167Learning Robotic Process Automation-81-167
Learning Robotic Process Automation-81-167
 
Test strategy for web development
Test strategy for web developmentTest strategy for web development
Test strategy for web development
 
New features in qtp11
New features in qtp11New features in qtp11
New features in qtp11
 

Viewers also liked

Product Strategy
Product StrategyProduct Strategy
Product Strategy
little_sunshine143
 
Hành vi người tiêu dùng trên điện thoai thông minh tại Việt Nam 2013
Hành vi người tiêu dùng trên điện thoai thông minh tại Việt Nam 2013Hành vi người tiêu dùng trên điện thoai thông minh tại Việt Nam 2013
Hành vi người tiêu dùng trên điện thoai thông minh tại Việt Nam 2013
Vietguys - Mobile Marketing Solutions
 
Halliburton Experience Certificate_B
Halliburton Experience Certificate_BHalliburton Experience Certificate_B
Halliburton Experience Certificate_BLatif Donii
 
JCI Nederland terugblik 2013
JCI Nederland terugblik 2013JCI Nederland terugblik 2013
JCI Nederland terugblik 2013
Frank Buijs
 
橙色精美销售模板Ppt
橙色精美销售模板Ppt橙色精美销售模板Ppt
橙色精美销售模板PptGina Gu
 
4-class
4-class4-class
4-class
maXdonalds
 
Halliburton Experience Certificate_A
Halliburton Experience Certificate_AHalliburton Experience Certificate_A
Halliburton Experience Certificate_ALatif Donii
 
Specification of f21 2 d radio remote control
Specification of f21 2 d radio remote controlSpecification of f21 2 d radio remote control
Specification of f21 2 d radio remote control
Cynthia Wang
 
Spanish resources and websites urls with printscreens
Spanish resources and websites urls with printscreensSpanish resources and websites urls with printscreens
Spanish resources and websites urls with printscreens
jvlikemedia
 
Geodinámica externa
Geodinámica externaGeodinámica externa
Geodinámica externa
IES Sancho III el Mayor, Tafalla
 
MODELO DE DESARROLLO ORGANIZACIONAL
MODELO DE DESARROLLO ORGANIZACIONAL MODELO DE DESARROLLO ORGANIZACIONAL
MODELO DE DESARROLLO ORGANIZACIONAL
Genisse Bravo
 
Wat can i lose from filling bankruptcy?
Wat can i lose from filling bankruptcy?Wat can i lose from filling bankruptcy?
Wat can i lose from filling bankruptcy?
hayworrythyxscaejrlet
 
SPC May 28, 2015 2000 UTC Day 1 Convective Outlook
SPC May 28, 2015 2000 UTC Day 1 Convective OutlookSPC May 28, 2015 2000 UTC Day 1 Convective Outlook
SPC May 28, 2015 2000 UTC Day 1 Convective Outlook
dallasbusinessnews
 
Qu'est ce qu'une huile essentielle
Qu'est ce qu'une huile essentielleQu'est ce qu'une huile essentielle
Qu'est ce qu'une huile essentiellemisstambouille
 
Emilio fernández. logo
Emilio fernández. logoEmilio fernández. logo
Emilio fernández. logo
Manel Dominguez Puñet
 
Resume
ResumeResume

Viewers also liked (16)

Product Strategy
Product StrategyProduct Strategy
Product Strategy
 
Hành vi người tiêu dùng trên điện thoai thông minh tại Việt Nam 2013
Hành vi người tiêu dùng trên điện thoai thông minh tại Việt Nam 2013Hành vi người tiêu dùng trên điện thoai thông minh tại Việt Nam 2013
Hành vi người tiêu dùng trên điện thoai thông minh tại Việt Nam 2013
 
Halliburton Experience Certificate_B
Halliburton Experience Certificate_BHalliburton Experience Certificate_B
Halliburton Experience Certificate_B
 
JCI Nederland terugblik 2013
JCI Nederland terugblik 2013JCI Nederland terugblik 2013
JCI Nederland terugblik 2013
 
橙色精美销售模板Ppt
橙色精美销售模板Ppt橙色精美销售模板Ppt
橙色精美销售模板Ppt
 
4-class
4-class4-class
4-class
 
Halliburton Experience Certificate_A
Halliburton Experience Certificate_AHalliburton Experience Certificate_A
Halliburton Experience Certificate_A
 
Specification of f21 2 d radio remote control
Specification of f21 2 d radio remote controlSpecification of f21 2 d radio remote control
Specification of f21 2 d radio remote control
 
Spanish resources and websites urls with printscreens
Spanish resources and websites urls with printscreensSpanish resources and websites urls with printscreens
Spanish resources and websites urls with printscreens
 
Geodinámica externa
Geodinámica externaGeodinámica externa
Geodinámica externa
 
MODELO DE DESARROLLO ORGANIZACIONAL
MODELO DE DESARROLLO ORGANIZACIONAL MODELO DE DESARROLLO ORGANIZACIONAL
MODELO DE DESARROLLO ORGANIZACIONAL
 
Wat can i lose from filling bankruptcy?
Wat can i lose from filling bankruptcy?Wat can i lose from filling bankruptcy?
Wat can i lose from filling bankruptcy?
 
SPC May 28, 2015 2000 UTC Day 1 Convective Outlook
SPC May 28, 2015 2000 UTC Day 1 Convective OutlookSPC May 28, 2015 2000 UTC Day 1 Convective Outlook
SPC May 28, 2015 2000 UTC Day 1 Convective Outlook
 
Qu'est ce qu'une huile essentielle
Qu'est ce qu'une huile essentielleQu'est ce qu'une huile essentielle
Qu'est ce qu'une huile essentielle
 
Emilio fernández. logo
Emilio fernández. logoEmilio fernández. logo
Emilio fernández. logo
 
Resume
ResumeResume
Resume
 

Similar to QTP Functions

Qtp Presentation
Qtp PresentationQtp Presentation
Qtp Presentation
techgajanan
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769
subhasis100
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769
vinayaka.nadiger
 
Qtp Training
Qtp TrainingQtp Training
Qtp 80 Basics3561
Qtp 80 Basics3561Qtp 80 Basics3561
Qtp 80 Basics3561
Siddhartha Parida
 
Qtp 8.0 basic
Qtp 8.0 basicQtp 8.0 basic
Qtp 8.0 basic
medsherb
 
QTP Faqs
QTP FaqsQTP Faqs
QTP Faqs
VGlobal Govi
 
SAP Testing Training
SAP Testing TrainingSAP Testing Training
SAP Testing Training
VGlobal Govi
 
About Qtp_1 92
About Qtp_1 92About Qtp_1 92
About Qtp_1 92
techgajanan
 
About QTP 9.2
About QTP 9.2About QTP 9.2
About QTP 9.2
chandrasekhar
 
About Qtp 92
About Qtp 92About Qtp 92
About Qtp 92
techgajanan
 
Test Case Creation in Katalon Studio
Test Case Creation in Katalon StudioTest Case Creation in Katalon Studio
Test Case Creation in Katalon Studio
RapidValue
 
Qtp interview questions3
Qtp interview questions3Qtp interview questions3
Qtp interview questions3
Ramu Palanki
 
Qtp interview questions3
Qtp interview questions3Qtp interview questions3
Qtp interview questions3
Ramu Palanki
 
What are the features in qtp
What are the features in qtpWhat are the features in qtp
What are the features in qtp
Ramu Palanki
 
Interview questions in qtp
Interview questions in qtpInterview questions in qtp
Interview questions in qtp
Ramu Palanki
 
Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780
Azhar Satti
 
Automation Tool QTP
Automation Tool  QTPAutomation Tool  QTP
Automation Tool QTP
BugRaptors
 
Qtp day 1
Qtp day 1Qtp day 1
Qtp day 1
Prashanth BS
 
Katalon Studio - GUI Overview
Katalon Studio - GUI OverviewKatalon Studio - GUI Overview
Katalon Studio - GUI Overview
Katalon Studio
 

Similar to QTP Functions (20)

Qtp Presentation
Qtp PresentationQtp Presentation
Qtp Presentation
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769
 
Qtp 92 Tutorial769
Qtp 92 Tutorial769Qtp 92 Tutorial769
Qtp 92 Tutorial769
 
Qtp Training
Qtp TrainingQtp Training
Qtp Training
 
Qtp 80 Basics3561
Qtp 80 Basics3561Qtp 80 Basics3561
Qtp 80 Basics3561
 
Qtp 8.0 basic
Qtp 8.0 basicQtp 8.0 basic
Qtp 8.0 basic
 
QTP Faqs
QTP FaqsQTP Faqs
QTP Faqs
 
SAP Testing Training
SAP Testing TrainingSAP Testing Training
SAP Testing Training
 
About Qtp_1 92
About Qtp_1 92About Qtp_1 92
About Qtp_1 92
 
About QTP 9.2
About QTP 9.2About QTP 9.2
About QTP 9.2
 
About Qtp 92
About Qtp 92About Qtp 92
About Qtp 92
 
Test Case Creation in Katalon Studio
Test Case Creation in Katalon StudioTest Case Creation in Katalon Studio
Test Case Creation in Katalon Studio
 
Qtp interview questions3
Qtp interview questions3Qtp interview questions3
Qtp interview questions3
 
Qtp interview questions3
Qtp interview questions3Qtp interview questions3
Qtp interview questions3
 
What are the features in qtp
What are the features in qtpWhat are the features in qtp
What are the features in qtp
 
Interview questions in qtp
Interview questions in qtpInterview questions in qtp
Interview questions in qtp
 
Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780Qtp Training Deepti 2 Of 44780
Qtp Training Deepti 2 Of 44780
 
Automation Tool QTP
Automation Tool  QTPAutomation Tool  QTP
Automation Tool QTP
 
Qtp day 1
Qtp day 1Qtp day 1
Qtp day 1
 
Katalon Studio - GUI Overview
Katalon Studio - GUI OverviewKatalon Studio - GUI Overview
Katalon Studio - GUI Overview
 

More from Praveen Gorantla

Troubleshooting with QTP
Troubleshooting with QTPTroubleshooting with QTP
Troubleshooting with QTP
Praveen Gorantla
 
File System Object in QTP
File System Object in QTPFile System Object in QTP
File System Object in QTP
Praveen Gorantla
 
Recovery Scenario in QTP
Recovery Scenario in QTPRecovery Scenario in QTP
Recovery Scenario in QTP
Praveen Gorantla
 
Selenium WebDriver FAQ's
Selenium WebDriver FAQ'sSelenium WebDriver FAQ's
Selenium WebDriver FAQ's
Praveen Gorantla
 
VB Script Overview
VB Script OverviewVB Script Overview
VB Script Overview
Praveen Gorantla
 
Regular Expressions in QTP
Regular Expressions in QTPRegular Expressions in QTP
Regular Expressions in QTP
Praveen Gorantla
 
Dynamic Content in QTP
Dynamic Content in QTPDynamic Content in QTP
Dynamic Content in QTP
Praveen Gorantla
 
Business Process Testing
Business Process TestingBusiness Process Testing
Business Process Testing
Praveen Gorantla
 
QTP Basics-2
QTP Basics-2QTP Basics-2
QTP Basics-2
Praveen Gorantla
 
QTP with QualityCenter
QTP with  QualityCenterQTP with  QualityCenter
QTP with QualityCenter
Praveen Gorantla
 
Virtual objects
Virtual objectsVirtual objects
Virtual objects
Praveen Gorantla
 
2.regular expressions
2.regular expressions2.regular expressions
2.regular expressions
Praveen Gorantla
 
1.qtp basics
1.qtp basics1.qtp basics
1.qtp basics
Praveen Gorantla
 

More from Praveen Gorantla (13)

Troubleshooting with QTP
Troubleshooting with QTPTroubleshooting with QTP
Troubleshooting with QTP
 
File System Object in QTP
File System Object in QTPFile System Object in QTP
File System Object in QTP
 
Recovery Scenario in QTP
Recovery Scenario in QTPRecovery Scenario in QTP
Recovery Scenario in QTP
 
Selenium WebDriver FAQ's
Selenium WebDriver FAQ'sSelenium WebDriver FAQ's
Selenium WebDriver FAQ's
 
VB Script Overview
VB Script OverviewVB Script Overview
VB Script Overview
 
Regular Expressions in QTP
Regular Expressions in QTPRegular Expressions in QTP
Regular Expressions in QTP
 
Dynamic Content in QTP
Dynamic Content in QTPDynamic Content in QTP
Dynamic Content in QTP
 
Business Process Testing
Business Process TestingBusiness Process Testing
Business Process Testing
 
QTP Basics-2
QTP Basics-2QTP Basics-2
QTP Basics-2
 
QTP with QualityCenter
QTP with  QualityCenterQTP with  QualityCenter
QTP with QualityCenter
 
Virtual objects
Virtual objectsVirtual objects
Virtual objects
 
2.regular expressions
2.regular expressions2.regular expressions
2.regular expressions
 
1.qtp basics
1.qtp basics1.qtp basics
1.qtp basics
 

Recently uploaded

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 

Recently uploaded (20)

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 

QTP Functions

  • 1.
  • 2. QTP Functions   Why User Defined Functions? Working with User Defined Functions Associated to a test object  Global   Functions Scope Private  Public   Using the Function definition Generator Function Definition  Registering Function       Documenting function Adding function to Expert View RegisterUserFunc Calling the registered function Session Wrap-Up pgorantla.blogspot.com
  • 3.  A user-defined function encapsulates activities or steps that require programming into operations (or keywords). These operations can then be used to enhance your test or component.  User defined functions helps in:  maintaining the modularity of the code  Reusability pgorantla.blogspot.com
  • 4.  QTP allows creating two types of user defined functions    Associated to a test object Global Associated to a test object   QTP allows to register a function and associate with a test object. It is also possible to set that operation as the default operation for the selected test object. Global  When a function is not associated with any test object, then it is termed as Global Functions. Global functions can be called by selecting the Functions category in the Step Generator (Can be invoked from Insert -> Step -> Step Generator) pgorantla.blogspot.com
  • 5.  Public:   Public functions are those which can be called /accessed from multiple tests or components. To make a function public, the function should be defined and saved in the function library file. Private:  Private functions are those that are defined in that action using the Expert View. Such functions cannot be called from another action. pgorantla.blogspot.com
  • 6.  Quick Test provides a Function Definition Generator, which enables to generate definitions for new userdefined functions and add header information to them.  It also facilitates in the Function Definition Generator to register a function to a test object.  After filling the required information, the Function Definition Generator creates the basic function definition for the user.  The function definition can be then copied to a library file and associate it with the test or component of the definition can be directly copied to a test script.  The Function Definition Generator can be invoked from Start -> Programs -> QuickTest Professional -> Tools -> Function Definition Generator. Note: • If you are planning to register functions, before you open the Function Definition Generator for the first time, make sure that you open QuickTest at least once. This enables the Function Definition Generator to access all of the test objects and their operations. pgorantla.blogspot.com
  • 7. The Function Definition section allows to define the function name and arguments.  Parts of Function Definition  Name   Type    Function - returns value to the calling function Sub - Doesn’t return value to the calling function Scope   Name of the function to be specified Either Public or Private Arguments    Click on Click on Click on icon to add a new argument icon to delete an argument the to change the order of the arguments Note: • • If you create a user-defined function manually and do not define the scope as Public or Private, it will be treated as a public function, by default. Only public functions can be registered to a test object. pgorantla.blogspot.com
  • 8.  Parts of Registering Function  The Register to a test object frame allows the user to register the function with a test object. This option is available only for public functions.  Test Object  includes all available test objects  (i.e., ActiveX Object, Standard Windows Object, Web Objects etc., )  Operation  contains the corresponding operations for the selected test object  The user can either type in a new operation name in order to create a new operation or select an existing operation to overwrite.  Check the option ‘Register as default operation’ to make the selected operation as default pgorantla.blogspot.com
  • 9.  The below screen shows that a new function with name ‘verify’ has been created and it has been associated to a test object ‘WebEdit’ and with the operation ‘Verify’.  Since, the option ‘Register to a test object’ is selected, the RegisterUserFunc statement is added to pgorantla.blogspot.com the end of the Function line.
  • 10. Clicking on this arrow will popup to add test object type and test object name    The Additional Information tab is used to enter some useful information about the function. It is also possible to enter the test object name and type in the Documentation field. The test object name and type can be selected by clicking on the arrow beside the documentation field. pgorantla.blogspot.com
  • 11. After entering the sufficient information in the Function Definition Generator, Click on the ‘Copy’ button to copy the syntax.  In the Expert view, choose paste to the paste the function definition.  The function looks like below when pasted to the The function related code goes here Expert view.  pgorantla.blogspot.com
  • 12.  Syntax   RegisterUserFunc TOClass, MethodName, FunctionName, SetAsDefault Description Argument Type Description TOClass String The tests object class for which you want to register the method. MethodName String The method you want to register. FunctionName String The name of your user-defined function. The function can be located in your action or component, or in any library file associated with your test or component. SetAsDefault Boolean Indicates whether the registered function is used as the default method for the test object.  For example:  RegisterUserFunc “WebEdit”, “verify”, “verify”, true Function Name Operation Name Test Object Name pgorantla.blogspot.com
  • 13.  Invoke the Step Generator to add a new step.  Select the category as ‘Test Objects’  Select a WebEdit object as the function that is created is for the ‘WebEdit’ Objects. Here, in this window, the ‘PassFirst0’ web edit object is selected.  By default, the newly created operation ‘Verify’ is selected as the operation was set as the default operation at the time of creation.  If it is not set as the default operation, the user has to select from the list of operations pgorantla.blogspot.com
  • 14. Prep Session Introduction Q & A…. ATS Application Testing pgorantla.blogspot.com
  • 15.  User defined functions can be created using Function Definition Generator or by directly typing the function header in Expert View.  Scope of Functions are of two types:    Public Private Two types of user defined functions can be created:   Associated to a test object Global  Only public functions can be registered to a test object.  Any number of arguments can be created for a function. pgorantla.blogspot.com
  • 16.  If a function is associated with a test object, then the first argument should be the test object name.  If a particular method is set as the default operation, then in keyword view, dropping down the operation combo shows the newly created method.  It is possible to register any method using RegisterUserFunc statement.  It is possible to enter function headers using Function Definition Generator. pgorantla.blogspot.com

Editor's Notes

  1. Briefly review the session agenda as indicated here. Currently we are in the “Prep Session Introduction” section, during which we will review basic information about this session, including how to use Centra to participate. Note: The Prep Session Introduction section should take no longer than 15 minutes.
  2. Spend a few moments answering participants’ questions about the agenda of this session or the Centra controls they will be using. Remind them to use the “Raise Hand” icon to ask a question.