what is keyword driven framework in qtp.
Answer Posted / deven
Keyword Driven Framework is a type of QTP Framework where
for a particular test case, you would first identify a set
of Keywords and then associate an action (or function)
which each of these keywords.
'Option Explicit
'Include library files
executefile "C:\Test\Library5.qfl"
'add sheets
datatable.AddSheet "dtSheet1"
datatable.AddSheet "dtSheet2"
datatable.AddSheet "dtLogin"
'import test case and test steps sheets from excel to data
table
datatable.ImportSheet "C:\Test\testcase.xls","Sheet1","dtShe
et1"
datatable.ImportSheet "C:\Test\testcase.xls","Sheet2","dtShe
et2"
datatable.ImportSheet "C:\Test\testcase.xls","Login","dtLogi
n"
Dim tcrows,tsrows
'get row count from data table sheets
tcrows=datatable.GetSheet("dtSheet1").GetRowCount
tsrows=datatable.GetSheet("dtSheet2").GetRowCount
For i=1 to tcrows
datatable.GetSheet("dtSheet1").SetCurrentRow(i)
If datatable.Value("Execute","dtSheet1")="Yes" Then
For j=1 to tsrows
datatable.GetSheet("dtSheet2").SetCurrentRow(j)
If datatable.Value("TCID","dtSheet1")=datatable.Value
("TCID","dtSheet2") Then
Select Case datatable.Value("Keyword","dtSheet2")
Case "openapp"
tsresult= openapp()
Case "login"
tsresult= login(datatable.Value
("Agentname",dtLogin),datatable.Value("Password",dtLogin))
End Select
If tsresult="Pass" Then
TestCaseResult=tsresult
End If
'Else
Exit for
End If
datatable.Value("Result","dtSheet2")=tsresult
Next
datatable.Value("Result","dtSheet1")=TestCaseResult
datatable.Value("Result","dtSheet2")=tsresult
End if
Next
datatable.Exportsheet "C:\Test\testcase.xls","dtSheet1"
datatable.exportSheet "C:\Test\testcase.xls","dtSheet2"
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
If u r using library files (Instead of Check Points) , How do u do bitmap check ?
Is it possible to refer the same object for referring more than one object that are of different class using the descriptive programming approach? Suppose my code is 'To create the object named as obj Set obj=Description.Create() 'To define the values obj("title").value="IE" obj("type").value="text" obj("html tag").value="INPUT" 'To set the value Browser("IE").Page("Yahoo").WebEdit(obj).Set "xyz" Can I refer the "obj" object for the three objects like Browser,page and webedit objects? If so how?
What if recovery scenarios is also failed for identify the alert ? (We are handling unexpected popup through recovery scenarios but if still recovery scenarios also failed than what should be the approach)
Where you are storing your script?
How many types of recording modes in the qtp?
Can anyone tell me how i used QTP 9.2 use for GIS based S/w with an example?
Which recording modes need more memory?
Discuss the QTP Environment?
How to add synchronisation points in qtp?
What is a recovery scenario?
HOW AUTOMATE TEST SCRIPT ? what time it will do? after gneration of basic script or Any , Plz explain detailed?
Explain the concept of object repository & how qtp recognizes objects?
How would you directly trigger javascript in a test?
Dis advantages of XML checkpoint ?
Without integrating QC/Testdirector with QTP, is it possible to keep track of the defects?If yes how? How to export QTP results to an excel sheet?