Forum Discussion
6 Replies
- Marsha_RChampion Level 3
This previous thread may be of some help:
- secloreqaNew Contributor
This is the last thing which I would try..
At the start of the evaluation I don't want to perform programming however it's the most reliable and robust solution.
Also,for my Test environment,the script is not running as it's disabling my Word Plugin and hence issues..
- HKosovaSmartBear Alumni (Retired)
secloreqa wrote:
I am trying to add a validation point in my Test Script using the Content of File Document.
So,for making sure the file has opened successfully, I want to check the content of the file against the base initial Text
There's an extension for TestComplete to compare Word files; you can download it here:
http://support.smartbear.com/viewarticle/17635/
Copy this extension to <TestComplete>\Bin\Extensions\ScriptExtensions, and then you can use this code:
WordDocs.Compare(file1path, file2path, 1);
For details and parameters, see this article: Compare Word files.
If you need just to read a Word file (and not compare 2 files), you can use the Word COM object, Word.Application. Here's an example:
// JScript
// Open a file in Word var oWord = Sys.OleObject("Word.Application"); oWord.Visible = true; var oDoc = oWord.Documents.Open("C:\\Test.doc"); // Read the paragraphs one by one, and post them to the log for (var i = 1; i <= oDoc.Paragraphs.Count; i++) { Log.Message(oDoc.Paragraphs.Item(i).Range.Text); } oDoc.Close(); - Kamal_chennaiContributor
Hi,
Please Activate MSAA and Text Recognition in Project Properties Then Try with object spy it may work
Thanks
Kamal
- secloreqaNew Contributor
I tried these options, MSAA was already selected,I just selected * which was unselected ,now atleast test Complete is able to identify the Commandbar controls,
For Text Recognition it's asking to add Window,so is this window generic.if I have to recognise text of Word Document,which window should I add .Also will this work even of another Word document is opened.?
- Kamal_chennaiContributor
Hi
You can Add Text Recognition for Generic window like add * in Text Recognition panel after that you can try with Object Spy
Thanks
Kamal
Related Content
- 4 years agoLeela1
- 2 months agoStoplight
- 10 months agoKimdoengart
Recent Discussions
- 2 days agovladd1