Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

How to remember Shortcut Keys in UFT/QTP

In this article, we will discuss on different shortcut keys in QTP/UFT. It is very difficult to understand each of the shortcut Keys and even does not make much change. But can remember the important one highlighted in bold green.

    File Menu


Creating Something New – When we create a new test or business component , it can be created with shortcut key combination with Key N.


New Test - Ctrl + N (For a test, we use Ctrl + N (for new))
New Business Component : Ctrl + Shift + N ((For a Business Component, we use Ctrl +Shift+ N (for new))
Function Library : Alt + Shift + N ((For a Function library, we use Alt +Shift+ N (for new))

Application area : Ctrl + Alt + N ((For an application area, we use ctrl + Alt + N (for new))

Opening something existing – So Open starts with O (So shortcut key combination will have one of the key as O and rest characters same as with new for test, business component, function library and application area.


Open Test : Ctrl + O
Open Business Component : Ctrl + Shift + O
Open Function Library : Alt + Shift + O

Open Application area : Ctrl + Alt + O

Adding new or existing– The shortcut key combination is created as ctrl+Shift + first letter of the component added.In case of existing, use Ctrl+ Alt instead of ctrl + Shift

Add new Test : Ctrl + Shift + T
Add new Business Component : Ctrl + Shift + B
Add new Application area : Ctrl + Shift + A
Add Existing Test : Ctrl + Alt + T
Add Existing Business Component : Ctrl + Alt + B
Add Existing Application area : Ctrl + Alt + A
Close: Ctrl + F4
Close Solution : Ctrl + Shift + F4
Save Current  : Ctrl + S
Save All : Ctrl + Shift + S

Edit Menu


Most of Edit option are same as other application, i.e copy using ctrl+c and paste using ctrl + v.

 Different ones are:
Comment : Ctrl + M
Uncomment : Ctrl + Shift + M
Indent : Tab
Outdent : Shift + tab
Complete word : Ctrl + Space
Argument Info : Ctrl + Shift + Space
Apply “With” to the script : Ctrl + W
Remove “With” : Ctrl + Shift + W

View Menu


One thing in common is all contain Ctrl+Alt

Solution Explorer: Ctrl + Alt + L
Toolbox : Ctrl + Alt + X
Properties : Ctrl + Alt + P
Data : Ctrl + Alt + D
Output : Ctrl + Alt + U
Errors : Ctrl + Alt + E
Tasks : Ctrl + Alt + K

Design Menu


Standard Checkpoint – F12
Existing Checkpoint – Alt + F12
Step Generator : F7
Check Syntax : Ctrl + F7

Record Menu


Record : F6
Stop Run/Recording : F4

Analog Recording : Ctrl + F3
Low Level Recording : Shift + F3

Run Menu


Run : F5
Run now : Shift + F5
Stop : F4
Run from step : Ctrl + F5
Step Into : F11
Step Over : F10
Step Out : Shift + F10
Insert Breakpoint : F9
Remove Breakpoint : Ctrl + F9

Clear All Breakpoints : Shift + Ctrl + F9

Object Repository Menu


Open Object Repository : Ctrl + R

ALM Connection Menu


ALM Connection : Ctrl + Q

Help: F1


How to Export/Import tests in QTP

Test in QTP can be exported to a zipped file with all the objects. In a similar manner, test from previously exported file can be imported to a QTP test.


Export Test – A test can be exported to a zipped file following below steps

export test in QTP

  •  In QTP/UFT, Navigate to File>Export Test
  • Provide the path of the location where exported zip file will be saved.
  • The test is exported to a zip file saved at the location provided.

 

Import Test – Similarly we can import the test in zip file to a QTP test or solution following below steps

import test in QTP

  • In QTP/UFT, Navigate to File>Import Test.
  • Provide the path of the location from where zip file will be imported.
  •  Provide the path of qtp test where the zip file will be converted to a test.

How to compare arrays after sort data in Array using VBScript in QTP

In this article, we will discuss how to work with arrays explaining the below concepts:
  • How to sort data in the array.
  • How to compare two arrays.
  • How to view elements in an array


'''''''''''''''''''''''''''''''''''''''''''''''''Test Data for the example''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
arrayDataA = Array(43,54,65,76,87)
arrayDataB = Array(87,65,54,43,7)


'''''''''''''''''''''''''''''''''''''''''''''''''Calling the functions for arrays''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
call funcArrayComparision(arrayDataA, arrayDataB)
arrayData = sortArray(arrayDataA)
ViewsortArray(arrayDataA)

'''''''''''''''''''''''''''''''''''''''''''''''''Function to sort data in an array'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

public function sortArray(arrayData)
For i = LBound(arrayData) to UBound(arrayData)
  For j = LBound(arrayData) to UBound(arrayData)
    If j <> UBound(arrayData) Then
      If arrayData(j) > arrayData(j + 1) Then
         TempValue = arrayData(j + 1)
         arrayData(j + 1) = arrayData(j)
         arrayData(j) = TempValue
      End If
    End If
  Next
Next
sortArray = arrayData
End Function


'''''''''''''''''''''''''''''''''''''''''''''''''Function to view data in an array'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

public function ViewsortArray(arrayData)
For i = LBound(arrayData) to UBound(arrayData)
 msgbox arrayData(i)
Next
End Function


'''''''''''''''''''''''''''''''''''''''''''''''''Function to compare two arrays'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Public Function funcArrayComparision(arrayA, arrayB)
''Firstly we will check whether the size of array matches, In case, It does not match, we can conclude values do not match 
   If ubound(arrayA) <> ubound(arrayB) Then
msgbox ("The array size is not same, so it is not possible array will match")
   else
   ''Now first of all we need to sort the array content, since we are compring array value by value, we are sorting the data without taking as/desc order in focus
  arrayA = sortArray(arrayA)
  msgbox ("Sorted data in the ArrayA")
  arrayB = sortArray(arrayB)
msgbox ("Sorted data in the ArrayB")
  boolflag = 0
For i = 0 to ubound(arrayA)-1
If arrayA(i) = arrayB(i) Then
msgbox arrayb(i)
boolflag = 1
Exit For
End If
Next
If (boolflag > 0) Then
msgbox ("congratulation ! array content in both the files match")
else
msgbox ("array content in both the files does not match")
End If
End If
End Function