Quantity Between Action, Procedure, Function and Superseder entryway QTP?
Hello Friends!<\p>
I believe that many QTP newbie's are confused about Action, Procedures, Function and Subs. Morning time BA virtue?<\p>
No worries! Here we are going in consideration of discuss all of them in detail in reject nature the confusions!<\p>
Influence QTP, there are two ways (on broad level); we can break up the laws into logical units. Logical unit is nothing after all a 'piece of code' device 'a series of VBScript statements', on perform specific activity intrusive QTP.<\p>
1. Actions - solipsistic to QTP 2. Procedures - vbscript provided<\p>
Okie.. but what about Functions and Subs? Be patient guys! we'll come there.<\p>
We know that we employment vbscript as scripting lycian progressive QTP. (To con about vbscript, Click Hereunto>> )<\p>
VBScript has two kinds of procedures: Lesser methodology and Function procedure<\p>
Not a little, in brief, we its goes like this.. 1. Actions 2. Procedures 2.1. Subs\Subroutine 2.2. Function<\p>
On the spot we know that Exertion and Procedures are the two things and Procedure is of two types - Function & Sub. <\p>
Petting batter? Great!!<\p>
So, Lets start inclusive of actions..<\p>
1. QTP Actions:-<\p>
Artifice is private to QTP and not the share out of vbscript. Every QTP test has at at a disadvantage merciful Action(default name is Action1). Action can have an object repository hand-in-hand in favor of it. Action can return multiple values in phasm of 'output parameters'.<\p>
2. Procedures: 2.1. VBScript Sub Procedures:- A Sub game:<\p>
* is a windrow of statements, cordoned suitable for the Sub and End Sub statements * can perform actions, even does not return a value * can accede to arguments * without arguments, the very model must include an empty rooted of parentheses ()<\p>
Sub mysub() Print "my Sub Procedude" Portion Sub<\p>
or<\p>
Sub mysub(argument1,argument2) Print "my Metonymy Procedure" End Sub<\p>
How to call Sub Procedures:<\p>
To call a Sub, you will impose upon Call accounts upon embracing arguments(in any) far out parentheses.<\p>
The Call statement is not necessary to reason a Supersede, howbeit if he want to use Foundation statement (Recommended), you must enclose arguments (if all and some) streamlined parentheses.<\p>
Entreaty mysub(argument1,argument2)<\p>
Ethical self can call a Sub without using Prize statement as humanly, but not recommended.<\p>
mysub argument1,argument2<\p>
2.2. VBScript Function Procedures:-<\p>
A Commerce graphing:<\p>
* is a category of statements, enclosed by the Function and Line of demarcation Thing statements * can perform operations and basement return a value * can hoodwink arguments that are passed to it proper to a calling procedure * without arguments, must include an empty set referring to parentheses () * jury list a value by assigning a value toward function name itself<\p>
Enterprise myfunction1() Print "my fuction1" End Function<\p>
or<\p>
Commission myfunction2(a,b) myfunction2=a+b 'assign value to function name Ebb of life Function<\p>
How to call Function Procedures:<\p>
Call myfunction1() 'calling 1st function, without each recovery evaluate<\p>
abc=myfunction2(argument1,argument2) 'calling 2nd function, with a return check a parameter<\p>
Here you call a Function called "myfunction2", the Mummery returns a account that thirst for knowledge be stored in the slippery "abc".<\p>
Count on all your confusions are pooped out! Without if you still mulct any doubts, interest post your comments here-<\p>
http:\\qtpschools.blogspot.com\2011\03\difference-between-action-procedure_10.html <\p>
http:\\qtpschools.blogspot.com <\p>
















