Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Comparision Of whole 1 webtable to another
#1
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?
Reply
#2
You can try the following code to compare two different web tables:-

Code:
Dim TableMatched = True Set Table1 = Browser("abcd").Page("efgh").WebTable("xyz") Set Table2 = Browser("abcd").Page("efgh").WebTable("pqr") For rowcntr=1 to Table1.RowCount For colcntr=1 to Table1.ColumnCount If Table1.getCellData(rowcntr,colcntr) = Table2.getCellData(rowcntr,colcntr) Then TableMatched = TableMatched AND True Else TableMatched = TableMatched AND False End If Next Next if TableMatched Then Print "Table Matched" Else Print "Table Not Matched" End If
Reply
#3
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
Reply
#4
Reply
#5
BadrinarayananR

Thanks.

But these two webtables are not at same page. Sad.
Anyways, thanks for your response.



Parke - Thanks. But can I use these codes if these webtables are not at same page?
Reply
#6
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Genaralised code for checking the comparision of two xml files having child nodes. Ganta 4 4,675 11-18-2009, 07:26 PM
Last Post: Ganta

Forum Jump:


Users browsing this thread: 1 Guest(s)