How will we compare the texts in the two word files using
QTP writing the script in Descriptive Programming.
Thanks
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 |
what is descriptive.create()in qtp?
How QTP recognizes Objects in AUT?
What exactly is the difference among all the three recording modes.
What is Regular Expressions?
Write a script to delete a specific row in a webtable.
hi i want write code for "test engineer" in this i want write reverse how ca plz let me know through script
can any one tell me How exactly data drivent testing is done in.explain with any example and the exact steps to fallow?
What is diff betwee datatable.importsheet "path" and datatable.import
what is the framework followed by ur company in qtp
Why use Regular Expressions?
Where the text version of script file located in file system?
what are the parameters you are considering for object identification?