How will we compare the texts in the two word files using
QTP writing the script in Descriptive Programming.
Thanks



How will we compare the texts in the two word files using QTP writing the script in Descriptive Pr..

Answer / Pooja Yadav

"To compare the texts in two word files using QTP, you can use the following VBScript code:nnFunction CompareTextFiles(strFile1, strFile2)nDim objWordApp1, objWordDoc1, objRange1, objWordApp2, objWordDoc2, objRange2, intCountnSet objWordApp1 = CreateObject("Word.Application")nSet objWordDoc1 = objWordApp1.Documents.Open(strFile1)nSet objRange1 = objWordDoc1.ContentnSet objWordApp2 = CreateObject("Word.Application")nSet objWordDoc2 = objWordApp2.Documents.Open(strFile2)nSet objRange2 = objWordDoc2.ContentnintCount = 0nWhile Not objRange1.EndOfDocumentnIf objRange1.Text = objRange2.Text Then intCount = intCount + 1nobjRange1.MoveNextnWendnIf intCount = objWordDoc1.Content.TextLength Then Exit FunctionnError intCount & " of the words in file1 do not match the corresponding words in file2."nEnd Function"

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

what is descriptive.create()in qtp?

3 Answers  


How QTP recognizes Objects in AUT?

1 Answers   Crea,


What exactly is the difference among all the three recording modes.

5 Answers   Accenture,


What is Regular Expressions?

2 Answers  


Write a script to delete a specific row in a webtable.

2 Answers   Tech Mahindra,


hi i want write code for "test engineer" in this i want write reverse how ca plz let me know through script

4 Answers  


can any one tell me How exactly data drivent testing is done in.explain with any example and the exact steps to fallow?

2 Answers  


What is diff betwee datatable.importsheet "path" and datatable.import

2 Answers  


what is the framework followed by ur company in qtp

5 Answers  


Why use Regular Expressions?

1 Answers  


Where the text version of script file located in file system?

1 Answers  


what are the parameters you are considering for object identification?

1 Answers  


Categories