Ask a Question

Unable to find the content of Word Document using Object Spy in test Complete

secloreqa
New Contributor

Unable to find the content of Word Document using Object Spy in test Complete

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,but I am not able to get any property for the same,

 

Object Spy is not able to identify the Document Content.

Also office Controls are not being identified by the spy.

Please let me know if there is something which I am missing.

6 REPLIES 6
Marsha_R
Community Hero

This previous thread may be of some help:

 

http://community.smartbear.com/t5/Getting-Started-with/Working-with-MS-Word-Documents-using-Test-Com...


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
Kamal_chennai
Contributor

Hi,

 

Please Activate MSAA and Text Recognition in Project Properties Then Try with object spy it may work

 

Thanks

Kamal

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..

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.? 

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

HKosova
SmartBear 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();

Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: