Ask a Question

Automation with Word

eykxas
Frequent Contributor

Automation with Word

Hi everyone !

I am facing an annoying issue with word automation. I use both MSAA and UIA recognition to get objects for my needs. The problem is that TC doesn't refresh the object tree properly when my routines are executed. (Find Method with refresh at true for example). The only way to refresh the object tree, is to use the object browser, expand every parent object to the desired child object then if I get lucky, the object is not greyed anymore and become available.

 

2023-08-03_11h25_53.gif

All these objects are not available via COM. (they are custom objects created by a plugin for Word). So the only way is to use UIAObjects recognition or MSAA.

How can I force TC to refresh and detect these objects properly ?

Thank you.

 

 

7 REPLIES 7
Bonibom
Contributor

Try to force refreshing the tree before FindChild or FindChildEx. Sometimes it helps. https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/refres...

eykxas
Frequent Contributor

I already tested this. It works in certain case, but not with Word.

rraghvani
Champion Level 3

I haven't worked with Component Object Model (COM) for a very long time, but I think it will only expose its methods when you interact with its interface (or query its interface). Enumerating the methods and properties exposed by a COM could possibly slow the application down.

 

 

eykxas
Frequent Contributor

I don't understand. I don't use COM and don't want to use it. I would like to get my UIA Objects available, without exploring the object browser manually.

rraghvani
Champion Level 3

MSAA is based on the Component Object Model (COM). COM defines a mechanism for applications to communicate.

eykxas
Frequent Contributor

Ok I didn't know that! Thanks, but that doesn't solve my problem.

jkrolczy
Regular Contributor

Do a Sys.Refresh() before the test steps having an issue.

JamesK
cancel
Showing results for 
Search instead for 
Did you mean: