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


Please Help Members By Posting Answers For Below Questions

if numbers are always changing write a script for that

3388


What are the advantages of Object Repository?

587


When QTP object wait time is 10 seconds, and in test script wait time is 5 seconds and in function library wait time is 2 seconds how much time does the wait occur? or which is given priority.

1627


What are main panes available in qtp test browser?

531


how could i download qtp in which i get add-in support for 'oracle' is there any way to get it? i finding but not getting pls help me out :)

1429






I am sathish , i want to test the Application of JIL.org ,Mobile Emulator ,by using QTP10.0. I am trying to do testing on that Application , but Child Objects are not identified by the QTP. Please can any one help me

1420


any body plz send health care domain project to me with explanation any two modules on that project. mail_id: ranjith_99reddy@yahoo.co.in

3440


tell me abt a time when u had to go above &beyind the call of duty to get the job done

1438


What are the types of data tables in qtp?

581


What is clean sweep?

1374


What is difference between shared and local object repository?

587


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?

1490


Hi, Can anyone please tell me how to connect the QC with QTP using QTP script? Thanks in advance

1519


Hello everyone! I am just writing a small test for a windows application. I have a problem with a text output value. The value i am trying to catch is presented in a scrollable textbox. When the text is too long, only a portion of it gets captured. Do you have any experience with this?

2141


What is the difference between per-action and shared?

588