How to compare output of 2 database in QTP?
Printable View
How to compare output of 2 database in 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
thanks nawab.. can u please provide me the script for that..???
''''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