adspace


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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

hi, FOR 3+ QTP INTERVIEW, FOR EXAMPLE WE PUT ONLINE BANKING SYSTEM PROJECT IN OUR RESUME, IN PROJECT MANAGER ROUND...WHAT R THE MAJOR QUESTIONS ARE ASKED IN P.M? PLS TELL ME ATLEAST 10 QUESTIONS?.....AND IF POSSIBLE POST ANSWERS ALSO....

3001


how can you do retesting (datadriven test) using notepad amd by using functions NOTE u should not use datatable methods

2014


1.Write a CRITICAL test cases for calculator ? 2.What is the difference b/w FRS and SRS documents ? 3.What is Component ? 4.What is object ? 5.what is the difference b/w static and dynamic descriptive programming ?

2185


Hi. please provide license key for QTP 9.2, I have windows XP on my machine Thanks in Advance, moreshwar

3306


When to use shared and local object repository?

1160


Hi Sudhananda, plz send me the QTP framework with any diagram and PPTS . I want to switch to automatio, I done QTP from professional person, but he does not give me his knowledge properly. so pls help me Thaks send me on following address mirajkar.akash@gmail.com

2479


How are actions and functions different in QTP?

1151


can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?

2166


Hi friends did any budy attend accenture system test for qtp? if any budy pls drop questions.not only accenture any other mnc company which you attended system test(QTP)?it may helpful to others also

2396


hi can anybody help with an qtp 9.2 license key please. Thanks, Nitesh.

2428


Hi can anybody send me the QTP material, To my email ID: nuve1284@gmail.com ?

2188


how to use the regular expression for the below code-- swf("application name").swftreeview ("Treename").select"Medication;Pharmacy:56" There is a tree view window of the folder's ie Medication- >Pharmacy(sub folder)with 56 as count of records...The records can be different or if no records present in the specific folder..then it show "Paharmacy:-no records".Whe i record at the first time .....and try to rerun the same script with different records count say "pharmacy:800"..qtp is not regnizing it...therefore i want to user regular expression..but donot now how to use it and where to use...i have tried.... swf("application name").swftreeview ("Treename").select"Medication;Pharmacy:\*"..but it s of no use..plz help..me

3012


we use a file extension .properties why is it used and where do we use it plz help me out with detailed explanation and navigation of how to use on the QTP 8.2?

2151


What is the use of defining a newobject in the object repository "Define New TestOject". How to use this further. If we define new testobject, how can it recognizes the objects properties of any application.

2217


Can you brief the hurdles you faced during Automation testing?

1138