In my application I was supposed to test two columns.The
first column1 belongs to one module and the other column2
belongs to other module.The content in both the columns is
same.I supposed to check whether the data present in the
column1 is same as the one in column2.

Each column contains number of rows.So checking each row
manually is diificult.Is there any option available in
WinRunner or QTP to check the column data.These two columns
are available in Data Base Tables.

One way is that I can just number of rows in each column so
that I can get rows count of both the columns,but apart
from that I was supposed to check whether the data is also
same in both the tables.

Can anybody suggest me how I can go about this.

Answer Posted / poonam

Following is the solution for your query.

# Fetching Information from Database
j = db_connect
("query1","DSN=<name>;UID=<user_id>;PWD=<user_pwd>",30);
if (j == E_OK) {
db_execute_query("query1", "select * from
<table name>", record_no);
for(i = 1;i <= record_no; i++) {
k = i-1;
val = db_get_field_value
("query1", "#"&k, "#0");
val1 = db_get_field_value
("query1", "#"&k, "#1");
if (val == val1)
report_msg("Values are
same "&val "and " &val1);
else
report_msg("Values are not
same");
}
}
else
report_msg("Database Connection Failed");

db_disconnect("query1");

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

you hae a inbox and got a mail how can you know it is there or not write script.

1559


two file is there how will compate it by useing qtp.

1663


How enviornment veriable can be included into my script. I want to include some information into my Excel file using Test run in WR. like User name of system? waht is function to be used? Please clarify.....

1751


hi this is uday iam trying for testing job with 3+ yrs of exp if u have qtp faqs materil plz send me thanks in advance

1589


Could you anyone share me the path to download the automation tools which are having trial license version?

1687






what is qtp licence

1563


What is the difference between gui map and gui map files?

560


Explain data parameterization in winrunner?

595


What do you verify with the gui checkpoint for single property and what command it generates, explain syntax?

845


i this is priya speaking, any 1 tell me project detail for NETBANKING and HELTHCARE pls send to this E-MAIL ADDRESS; (priyadharshni2@yahoo.com)pls qik, thank u once agajn.

1583


What are the virtual objects and how do you learn them?

717


what are the differences you see in e-commerce and banking domain in testing point of view Thanks in Advance

1034


descriptive program for web application.

1500


When do you feel you need to modify the logical name?

636


Where did you learn winrunner and testdirector?

684