![]() |
Comparision Of whole 1 webtable to another - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Comparision Of whole 1 webtable to another (/Thread-Comparision-Of-whole-1-webtable-to-another) |
Comparision Of whole 1 webtable to another - Anand Saboo - 10-06-2013 Hi Team, In one of the application, it is generating 1 webtable depending on the inputs we provide. So, the row the column are not fixed. The same webtable will generate on the another page. So, I need to compare these two webtables. Is their any way that I can compare the whole webtable? RE: Comparision Of whole 1 webtable to another - BadrinarayananR - 10-08-2013 You can try the following code to compare two different web tables:- Code: Dim TableMatched = True RE: Comparision Of whole 1 webtable to another - Parke - 10-09-2013 Anand: Question: if there is a difference between the two tables, do you need to know which cell(s) is different or simply that the two tables are not identical? How many rows / columns will be in a table? Your needs affect the programming that would be required. Parke RE: Comparision Of whole 1 webtable to another - Parke - 10-10-2013 Anand: I am including two subs which will find all cells that are different between the two web tables. I have hard coded the number of rows and columns. You will need to modify those values. Both programs will print which rows and cells are different. Method 1 using the standard OR technique. Method 2 uses the DOM technique. The article that caused me to work with DOM is http://qtpprashanth.blogspot.com/2011/03/how-to-reduce-execution-speed-with-qtp.html. In my experiments the web tables had 20 rows and 6 columns. The OR technique took around 100 sec while the DOM method took around 5 sec. hth, Parke Code: Sub Compares_rows_of_two_web_tables Code: Sub Compares_rows_of_two_web_tables_DOM_2 RE: Comparision Of whole 1 webtable to another - Anand Saboo - 10-13-2013 BadrinarayananR Thanks. But these two webtables are not at same page. ![]() Anyways, thanks for your response. Parke - Thanks. But can I use these codes if these webtables are not at same page? RE: Comparision Of whole 1 webtable to another - Parke - 10-14-2013 Anand: In math, the browser name, page title, etc, are just dummy variables. Your page might not have a frame and I would be surprised if your table was named "1". Adjust those "variables" to suite your needs. As you might have noticed, I used two different browsers. I did this to make my programming easier. You would run the oTable part on the first page and the oTable2 on the second page. Just remember to set the names to what is in your OR. hth, Parke |