Monday, August 17, 2009

QTP and SyncFusion Grid controls

Syncfusion grid control is a custom .net control. We can use various methods with syncfusion control to work on the grid from QTP.
e.g Grid.Object. [methods]
the methods can be pulled out from the class library located at
http://www.syncfusion.com/.
however to perform different keyboard operations like dbl click we need to use the below code.

Public function GridCellDBClick(row,col,Grid)
set objGrid = Grid.Object
If objGrid.RowCount <>
GridCellDBClick = False
End If
'get the cell in view by scrolling the view
objGrid.ScrollCellInView3 row,col,"dbclick"
'clear the selections
objGrid.Selections.clear
objGrid.SelectRow row
'get the current selected cell object
Set objcurrentcell= Grid.Object.CurrentCell
' move the selection to current cell

objcurrentcell.MoveTo row,col
objcurrentcell.ScrollInView
'get the coordinates of the cell
set rect = objGrid.RangeInfoToRectangle(objcurrentcell.rangeinfo)
'double click on the cell Grid.DblClick rect.X + rect.Width/2, rect.Y + rect.Height/2
End function


Thursday, August 13, 2009

QTP Automated Testing

I am currently working with QTP Automated testing..
People generally follow a crude approach with just start to write functions without design. This type of coding finally ends in a crappy test suite which does not work after some time. hence the approach should be well formed and designed, this design is called framework.

Automation Framework in qtp are mainly modular, data driven,keyword driven and hybrid.
Modular is just modularizing your code into different functions.
Data driven is the input are driven by the data.
Keyword driven is writing keywords which will drive your code.
keywords are generally a common english words which are used to call a chunck of code.
e.g. you write keywords in excel file which will drive your or call the specific functions in the code.
now keywords can be written at very low level like "Click_on_button" or at application business level like Login,create_message, verify_message etc..
people ususally use a mixture of keyword and data driven approach which is also called as a hybrid framework.