Results 1 to 2 of 2
  1. #1

    Database checkpoint

    I'm testing a java application with qtpro. There are a dinamic java table. I want check that the information displayed in the java table is the same that are in the database. I don't want check database information , I suppose it is correct. I only need compare the information displayed with the information stored. I'm trying to use a database checkpoint, but it is useful to check the database and not the dinamic displayed information. How can I do that?

  2. #2

    Re: Database checkpoint

    To achieve this you need to do two things before you validate or check.

    1. First you need to get the Table from the content which you would like to compare with DB
    2. Query the Database for the value by passing parameters(Use ADODB connection and recordset object)

    go ahead with verifing the content displayed in the application once you have data in global datatable from db to compare with value displayed in the application Table.

    I hope this would help you out, here i took mdb as example.

    database = "C:\Praveen\DBConnect\Test.mdb"
    strTestName = "TC_01"

    Function GetData(strTestName,database)
    Dim con,rs
    Set con = createobject("adodb.connection")
    set rs = createobject("adodb.recordset")
    con.provider = "microsoft.jet.oledb.4.0"
    rs.open "SELECT CompanyId.CompanyID, CompanyId.CompanyName, CompanyId.Address, CompanyId.City FROM CompanyId where CompanyId.TestCaseID='"&strTestName&"' AND CompanyId.ProcLevel='1';",con
    If rs.EOF = True Then
    Reporter.ReportEvent 1, "Get Data" ,"Unable to get Records from the Macro Control Database. Check the TableName and/or TestName and/or the Proclevels in the table"
    GetData = micFail
    'DataTable.AddSheet (strTableName)
    intColNum = 1
    While rs.EOF=false
    DataTable.SetCurrentRow (intColNum)
    For each strFields in rs.Fields
    If intColNum = 1 Then
    DataTable.GetSheet(dtGlobalSheet).AddParameter strFields.name,""
    DataTable.Value(strFields.name,dtGlobalSheet) = rs(strFields.name)
    DataTable.Value(strFields.name,dtGlobalSheet) = rs(strFields.name)
    End If
    intColNum = intColNum + 1
    Reporter.ReportEvent 0, "Get Data" ,"Extracted all the Records from the Macro Control Database for this test script"
    GetData = micPass
    End If
    End Function

    intTemp = GetData(strTestName,database)
    msgbox intTemp

    All the best

    praveen Kumar Araveti



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 03:59 PM.

Copyright BetaSoft Inc.