Forum Discussion

eykxas's avatar
eykxas
Frequent Contributor
7 months ago

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.

 



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

  • eykxas's avatar
    eykxas
    Frequent Contributor

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

  • rraghvani's avatar
    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's avatar
    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's avatar
    rraghvani
    Champion Level 3

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

  • eykxas's avatar
    eykxas
    Frequent Contributor

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

  • jkrolczy's avatar
    jkrolczy
    Regular Contributor

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