Micro Focus QTP (UFT) Forums
How to compare two sentences(Para's) - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to compare two sentences(Para's) (/Thread-How-to-compare-two-sentences-Para-s)



How to compare two sentences(Para's) - bostonma - 03-07-2009

I need to compare expected and actual values which is nothing but two paragraphs.
Is there a best way experts suggest to do this?

I have been using the strcomp built in function but the problem I am seeing is it always results in "-1" as the two paras differ by spaces per my understanding.
I did a diff between these two I do not see any difference in text but again I cannot make out if there is any extra space in one para between any of the two words.

I am thinking there might be a better way to debug this as I am tired looking at the text differences which I couldn't find and now I hae to look at Space difference between each words... This looks to be quite impossible for me as there are like 100 words in one para.

I haven't used wdiff.exe , not sure how this works.Any ideas?

Any help/ideas appreciated.


RE: How to compare two sentences(Para's) - tarunlalwani - 03-09-2009

Try this API

http://knowledgeinbox.com/forums/feedback/text-comparison-api-beta/


RE: How to compare two sentences(Para's) - bostonma - 03-09-2009

Tarun,

Thanks much for your input. I tried executing the script(Copied code) in qtp but I get error message
"ActiveX component can't create object: 'KnowledgeInbox.AdvancedTextCompare'"


RE: How to compare two sentences(Para's) - tarunlalwani - 03-09-2009

Read this

http://knowledgeinbox.com/forums/feedback/re-text-comparison-api-beta/