Tuesday, June 14, 2011

Difference between bitmap check point and image check point



Image Check points checks the properties of Web Image, Bitmap check point checks an area of web page or application as bitmap.

Reporter object


Reporter Object is used for sending information to the test results.
Reporter.ReportEvent EventStatus, ReportStepName, Details
where EventStatus can be:
0 or micPass: If this step runs test passes which is shown in test report.
1 or micFail: If this step runs test fails which is shown in test report.
2 or micDone: Used to send message to the test report and does not affect status of test.
3 or micWarning: Again, used to send warning message to the test report and does not affect status of test.
ReportStepName: is name of step
Details: are the user defined details for the given step.
For Example:
Reporter.ReportEvent micPass, "Login Authorization", "The user-defined step passed."

Inner joins & Outer joins


Join is used to combine rows from multiple tables. A Join is performed whenever two or more tables are listed in the From clause of an SQL Statement.
a.     INNER JOIN- Inner joins return all rows from multiple tables where the JOIN condition is met.
E.g. Select Suppliers.SuppId,Suppliers.SuppName,Orders.OrderDt from Suppliers, Orders where Suppliers.SuppId=Orders.SuppId;
b.     OUTER JOIN-Outer Join returns all rows from one table and only those rows from secondary table where the joined fields are equal(Join condition is met)
           E.g. Select Suppliers.SuppId,Suppliers.SuppName,Orders.OrderDt from Suppliers, Orders where Suppliers.SuppId=Orders.SuppId(+);

What are the types of Object Repositories available in QTP

a.     Local Repository (.MTR extension)
b.     Shared Repository (.TSR extension)

Monday, June 6, 2011

SetToProperty


Sets the value of the specified property in the test object description.
Example: Browser("br").Page("pg").Frame("fr").WebList("cmb”). SetTOProperty("Property",Value)

What is a difference between GetToProperty & GetROProperty

1.     GetTOProperty returns the value from the test object's property and GetROProperty returns the current property value of the object in the application during the test run.

How to connect a database

a.     With DSN: DSN Name is mydsn
Function conData()
dim con,rs
con=CreateObject("ADODB.Connection")
rs=CreateObject("ADODB.Recordset")
con.open "mydsn"
rs=con.execute("Select * from Table")
set conData=rs
End Function

b.    Without DSN:

Dim column_name,column_value
set conn=Createobject("ADODB.Connection")
Srvname="Driver={Microsoft ODBC for
Oracle}:Server=DBserver,UID=Sa,Password=sa"
conn.open Srvname
Set Rec = CreateObject("ADODB.Recordset")
SQL="select * from Users"
Rec.open SQL ,conn
Do while not Rec.eof
            For i = 0 To Rec.Fields.Count -1
                        ‘msgbox Rec.Fields.Count //counts the number of records in record set Rec
                        column_value=Rec.Fields(i).value //Fetches the value of particular field stored in record set Rec
                        column_name=Rec.Fields(i).name
                        Msgbox "Record Exist :" & column_name & " " & column_value
            next
            rs.movenext
Loop

Invoke Application

Syntax: InvokeApplication("Full URL as Parameter")

Example: 

InvokeApplication "C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.google.com"

What are the Checkpoint Types

a.     Standard Checkpoint
b.     Image Checkpoint
c.     Table Checkpoint
d.     Page Checkpoint
e.     Text Checkpoint
f.      Text Area Checkpoint
g.     Bitmap Checkpoint
h.     Database Checkpoint

Friday, June 3, 2011

How to synchronize the test


a.     Inserting the synchronization point
Object.WaitProperty 

b.     Object.Exist

c.     Wait(5)