Results 1 to 8 of 8

Thread: Data -driven testing in qtp

  1. #1
    Junior Member
    Join Date
    Jun 2007
    Answers
    6

    Data -driven testing in qtp

    hi..

    kindly let me know how to use data driven testing in qtp using vbscript
    i would be glad if provided with example.


    regards
    gouthami


  2. #2
    Junior Member
    Join Date
    May 2007
    Answers
    5

    Re: Data -driven testing in qtp

    Data Driven testing is nothing but passing parameters repeatedly and executing the same script with different values
    like if you see the below script,
    Dim url
    url = DataTable.Value ("url",dtLocalSheet)
    Create a column in the localsheet of QTP test script and from there passing values to the script


  3. #3
    Expert Member
    Join Date
    Nov 2006
    Answers
    518

    Re: Data -driven testing in qtp

    This one was recorded and enhanced when I was learning QTP. I am still learning .

    With Window("Flight Reservation")
    .Activate
    .WinMenu("Menu").Select "File;Open Order..."
    With .Dialog("Open Order")
    .WinCheckBox("Order No.").Set "ON"
    .WinEdit("Edit").Set DataTable("A", dtGlobalSheet)
    .WinButton("OK").Click
    End With
    .WinButton("Update Order").Check CheckPoint("Update Order")
    .WinRadioButton("First").Set
    .WinButton("Update Order").Check CheckPoint("Update Order_2")
    .WinButton("Update Order").Click
    End With

    Lack of WILL POWER has caused more failure than
    lack of INTELLIGENCE or ABILITY.

    -sutnarcha-

  4. #4
    Junior Member
    Join Date
    Jun 2007
    Answers
    6

    Re: Data -driven testing in qtp

    well now,i wanted to know abt environment variables.


  5. #5
    Junior Member
    Join Date
    Nov 2008
    Answers
    1

    Re: Data -driven testing in qtp

    Hope this will help u for Data Driven Testing in QTP by passing different values thru external data files such as excel.
    SystemUtil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE","","C:\Documents and Settings\Jimohan","open"
    Datatable.Import("D:\TestData.xls")
    Datatable.AddSheet(1)
    row_cnt=datatable.getrowcount
    Msgbox row_cnt
    For i=1 to row_cnt
    Uid=Datatable.Value("Uid",1)
    msgbox Uid
    Password=Datatable.Value("Password",1)
    msgbox Password
    Browser("Browser").Page("Yahoo! India").Link("Mail").Click
    Browser("Browser").Page("Sign in to Yahoo! India").WebEdit("login").Set DataTable("Uid")
    Browser("Browser").Page("Sign in to Yahoo! India").WebEdit("passwd").SetSecure DataTable("Password")
    Browser("Browser").Page("Sign in to Yahoo! India").WebButton("Sign In").Click
    Browser("Browser").Page("Yahoo! Mail (santhu_2k4)").WebElement("Sign Out").Click
    Browser("Browser").Page("Page").Sync
    Browser("Browser").Close

    Next
    datatable.setnextrow


  6. #6
    Junior Member
    Join Date
    Jul 2009
    Answers
    6

    Re: Data -driven testing in qtp

    Data driven testing :we will separate the test data from the test case such that data can be changed with out making any effect to the testcase.
    So for that we use parameter.
    ex:you want to check your application with differernt users.click on username u can see this sign.give parameter click ok.
    It takes to data table you can add any number of users you want.


  7. #7
    Junior Member
    Join Date
    Jul 2010
    Answers
    2

    Re: Data -driven testing in qtp

    Data driven means that we run same QTP script using different data.
    For example you can create Login script and then use data driven methods to
    run that script multiple times with multiple sets of userid and passwords.

    1- Using QTP datatables
    2- Using Excel sheets
    3- Using Access database

    You can use ADODB object to get data from Excel and Access and put that data in Arrays or Dictionary object and then can use that data in different scripts.

    You can also define in Data that which Actions are going to run. It will be hybrid framework.


  8. #8
    Junior Member
    Join Date
    Jan 2011
    Answers
    1

    Re: Data -driven testing in qtp

    give values in datatable like username and password and import the data using datatable.import method.
    exatatable.import "C\:Programfiles:\QTP"
    Window(" ").page(" ").WinEdit(" ").set Datatable.value("Username")
    Window(" ").page(" ").WinEdit(" ").set Datatable.value("Password")


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact