Results 1 to 4 of 4

Thread: Qtp

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Answers
    2

    Qtp

    How to compare output of 2 database in QTP?


  2. #2
    Expert Member
    Join Date
    Jan 2007
    Answers
    211

    Re: Qtp

    1. Database checkpoint are there for validating the Columns of Tables against the Expected one's.

    2. For Comparision of Data... Use VBScript .

    Please revert if this doesn't solve the purpose

    Regards,
    Nawab


  3. #3
    Junior Member
    Join Date
    Apr 2008
    Answers
    2

    Re: Qtp

    thanks nawab.. can u please provide me the script for that..???


  4. #4
    Expert Member
    Join Date
    Jan 2007
    Answers
    211

    Re: Qtp

    ''''i am providing the second part of my reply......

    '''''Section I...database connection
    set conn=createobject("adodb.connection")
    'on error resume next conn.provider="microsoft.jet.oledb.4.0"
    conn.open "d:\web_auto.mdb"
    if err.number <>0 then
    'reporter.reportevent micpass,"database connection","successfully connected."
    end if
    if isempty(conn) then
    'reporter.reportevent micfail, "database connection","connection failed error code:<<" & & ">>"
    end if

    '''''Section II..........database comparision.
    Set rs = createobject("adodb.recordset")
    set rs = conn.execute("select * from tbl_seq_flow where script_name ='" & scriptname & "' order by object_sequence")

    ''''Section III.....you need to create a similar record set for other database with whom you want to compare the current one ...say rs_1

    Section IV........now the loop

    while rs.eof <> null
    if rs.rs.fields.item(1)<> rs_1.rs.fields.item(1) then
    reporter.reportevent micfail,"failure","database inconsistent"
    end if
    wend

    will update on the db inbuilt checkpoint.

    Regards,
    Nawab

    Last edited by NawabShaikh; 04-24-2008 at 10:19 AM. Reason: Alignment

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