Wednesday, October 1, 2008

QTP Testing process

  1. Create your test plan - Prior to automating there should be a detailed description of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application.
  2. Recording a session on your application - As you navigate through your application, Quick Test graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.
  3. Enhancing your test - Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly. NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process. Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data. Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.
  4. Debugging your test - If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption.
  5. Running your test on a new version of your application - You run a test to check the behavior of your application. While running, Quick Test connects to your application and performs each step in your test.
  6. Analyzing the test results - You examine the test results to pinpoint defects in your application.
  7. Reporting defects - As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.

Tuesday, August 19, 2008

How to call a function from a action to another action

' create a environment variable called my_var
'Action where to want to call the function i ,e ex: -Action2

environment("my_var")="login"
runaction "Action1",environment("my_var")

'Action1

If environment("my_var")="login" Then
Call func_login()
End If


Regards,

PavanKumar Nandagiri..............

Tuesday, August 5, 2008

To load the object repository

Dim objQTP
Dim QTP_OR
Set objQTP = CreateObject("QuickTest.Application")
Set QTP_OR = objQTP.Test.Actions("Action2").ObjectRepositories
If QTP_OR.Find("D:\pavan\Test1\new.tsr") = -1 Then
QTP_OR.Add "D:\pavan\Test1\new.tsr", 1
End If
Set QTP_OR = Nothing
Set objQTP = Nothing


Regards,

Pavankumar Nandagiri..............

To find the child objects & their class in the application

Dim oDesc
Set oDesc = Description.Create()
Set parent = Window("Text:=Flight Reservation")
Set children = parent. ChildObjects (oDesc)
co = children.Count
MsgBox co
k=0
For j = 1 to (co-1)
cln= children(j).GetROProperty("micclass")
Select Case(cln)
case("WinEdit")
Objpr = children(j).GetROProperty("attached text")
case("WinButton")
Objpr = children(j).GetROProperty("text")
case("WinComboBox")
Objpr = children(j).GetROProperty("attached text")
case("AciveX")
Objpr = children(j).GetROProperty("Progid")
case("WinObject")
Objpr = children(j).GetROProperty("text")
case("Static")
Objpr = children(j).GetROProperty("text")
End Select
If Objpr <> "" Then

msgbox cls & " " & Objpr
End If

Objpr = ""
Next
MsgBox k


Regards,

PavanKumar Nandagiri.....................

Deleting the dupliacte data from Excel sheet

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True

Set objWorkbook = objExcel.Workbooks.Open("D:\Qtp_ framewrk_Keyworddriven\16June_Final_Test_Scenarios_phpcollab.xls")

nor = objExcel.sheets(3).usedrange.rows.count

for i = 1 to nor
cd = objExcel.sheets(3).Cells(i, 1)
j = i+1
do Until objExcel.Cells(j, 1).Value = ""
cd1 = objExcel.sheets(3).Cells(j, 1)
if Ucase(trim(cd)) = Ucase(trim(cd1)) then
Set objRange = objExcel.Cells(j, 1).EntireRow
objRange.Delete
j = j-1
End If
j = j + 1
Loop
Next


Regards,

PavanKumar Nandagiri...........

Google Search

Google