--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Mary:
Is it safe to assume that the excel sheets you are comparing have the same number of rows and columns?
I am assuming that most of the time, the cells match, so most of the time, a cell by cell comparison is a waste of time. (hmmm, a lot of time in that sentence.)
The code assumes that column A is a unique key and is the same in both workbooks. I like to use the dictionaries from Dot Net as they are much improved over the dictionary object in vbscript.
In the code, I am only comparing “Sheet1” in each workbook.
There is more coding than in the original method but I believe the time to complete the comparisons should be much less. Please let me know if I am correct.
Thanks,
Parke
Mary:
I setup two spreadsheets with 6 columns, 500 rows and had 12 differences between the two spreadsheets.
I ran Mary’s script with and without the Else statement and the code using dictionaries. The code is pasted below:
Results are an average of six runs:
Compare every cell |
Compare every cell |
Using dictionary | |||
with else statement |
removing else statement | ||||
60.7 sec |
39.4 sec |
35.2 sec |
The most surprising result for me was the increase in speed when the else statement was removed from the code.
Using the dictionary method to find cells that are not the same between the two spreadsheets is slightly faster than using the standard QTP method for comparing two spreadsheets.