Learn UFT or QTP Step By Step

1
38
Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

Learn UFT or UFT Step By Step
Learn UFT or UFT Step By Step

Learn UFT Step By Step:

Why UFT not Selenium?

UFT is a closed source software from HP. Many engineering brains are working the product better. Hence we need license to use it. However selenium is open source and there are not much engineers active supporting this. That does not mean it is bad.

While there lot of official help on same topics available directly from HP, Selenium lacks on that space. Testers need to try and find out the best solution.

UFT uses old VBscript hence ramping up from manual testing to UFT is easy but selenium needs knowledge on java,perl or .NET to write effective code.

Easy recording is available for UFT where as Selenium does not have easy recording. We need to code from scratch.

UFT supports almost all known technologies whereas selenium supports web technology.

Lastly UFT is very much user friendly,selenium lacks in this space.

First Step to UFT

The first thing you need to learn is VBScript…the basics..The best place to learn VB script is —MSDN

Technology Supported by UFT:

  • Web
  • Java -core and advanced
  • .NET
  • WPF
  • PDF
  • Oracle
  • SAP
  • Siebel
  • PeopleSoft
  • Mainframe
  • Terminal Emulator
  • Silverlight
  • Smalltalk
  • VisualAge
  • Windows Mobile
  • Power Builder
  • Delphi
  • Stingray-1
  • Flex
  • WebServices

Remember,QTP/UFt is backed by VBScript hence it can work on Windows environment only.

Addins for UFT

Add ins are the additional piece of code that puts extra layer on top of vanilla UFT to support different technologies.

Popular addins are:

  • Web
  • Jaba
  • .NET
  • Silverlight
  • SAP

All the above written technologies are supported via different plugins.

What plugins Vanilla UFT provides?

Vanilla UFT provides the basic addins like

  • ActiveX
  • Visual Basic
  • Web

Licenses of UFT:

UFT provides three types of licenses:

  1. Trial with limited facilities
  2. Seat License- tagged to the machine
  3. Concurrent License- depends on number of users

What is a VBScript to a Automation Test Engineer?

VBScript (Visual Basic Script)

1. It is a scripting language scaled down version of Visual Basic
2. It runs on client side.
3. Basically a syntax based language. Most VB syntaxes run on this.
4. For our purpose we always save the file as “XYZ.vbs”

The very next topic is Variable:

1. Variable: Variables are container which holds value. Before using any variables we need to declare them.(This is a best practice.) We need use dim statement to decleare. The variable declaration is nothing but allocate some amount of memory for that variable to hold some value.
Like: dim c_ball,d_count
Again this declaration can be of three type as per scope:
1. Dim Statement
2. Public Statement
3. Private Statement
Dim can be accessible from the entire script.
Public statement variables are available to all procedures in all scripts.
Private statement variables are available only to the script in which they are declared
There is a separate term called constant.
Like:
Const variable_Name=”I am a good boy”
Now this variable_Name can be used anywhere. And its value is same. The scope is public bydefault.
VBScript in itself has a number of defined intrinsic constants like vbOK, vbCancel, vbTrue, vbFalse and so on

You can also declare a variable implicitly by simply using its name in your script. That is not generally a good practice because you could misspell the variable name in one or more places, causing unexpected results when your script is run. For that reason, the Option Explicit statement is available to require explicit declaration of all variables. The Option Explicit statement should be the first statement in your script.

Naming Restrictions 

Variable names follow the standard rules for naming anything in VBScript. A variable name:

1.Must begin with an alphabetic character.
2.Cannot contain an embedded period.
3.Must not exceed 255 characters.
4.Must be unique in the scope in which it is declared.

Scope and Lifetime of Variables 

A variable’s scope is determined by where you declare it. When you declare a variable within a procedure, only code within that procedure can access or change the value of that variable. It has local scope and is a procedure-level variable. If you declare a variable outside a procedure, you make it recognizable to all the procedures in your script. This is a script-level variable, and it has script-level scope.

The lifetime of a variable depends on how long it exists. The lifetime of a script-level variable extends from the time it is declared until the time the script is finished running. At procedure level, a variable exists only as long as you are in the procedure. When the procedure exits, the variable is destroyed. Local variables are ideal as temporary storage space when a procedure is executing. You can have local variables of the same name in several different procedures because each is recognized only by the procedure in which it is declared.

Assigning Values to Variables 

Values are assigned to variables creating an expression as follows: the variable is on the left side of the expression and the value you want to assign to the variable is on the right. For example:

B = 200

Scalar Variables and Array Variables
Much of the time, you only want to assign a single value to a variable you have declared. A variable containing a single value is a scalar variable. Other times, it is convenient to assign more than one related value to a single variable. Then you can create a variable that can contain a series of values. This is called an array variable. Array variables and scalar variables are declared in the same way, except that the declaration of an array variable uses parentheses ( ) following the variable name. In the following example, a single-dimension array containing 11 elements is declared:

Dim A(10)

Although the number shown in the parentheses is 10, all arrays in VBScript are zero-based, so this array actually contains 11 elements. In a zero-based array, the number of array elements is always the number shown in parentheses plus one. This kind of array is called a fixed-size array.

Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here