Unable to acess the controls in Microsoft Lyn

Gomathi
2011-12-20
2013-05-28
  • Gomathi
    Gomathi
    2011-12-20

    I am trying to automate the Microsoft Lync communicator (.Net application).

    Following the documentation step, able to connect to the Lync communicator like,

    from pywinauto.application import Application

    app = Application()

    app.start_(r"C:\Program Files\Microsoft Communicator\Lync.exe")

    Lync communicator launches..

    Using PrintControlIdentifiers printed the controls inside the Lync window using ,

    Lync'PrintControlIdentifiers()

    it retruns the control as ,

    NativeHWNDHost - 'DUIBaseHWDHost' (L849,T84,R1171,B698)

             ''DUIBaseHWDHost' 'DUIBaseHWDHostNativeHWNDHost' 'NativeHWNDHost'

    DirectUIHWND - "(L849,T84,R1171,B698)"

             "'DirectHWND'

    Prints the Classname instead of controlsnames. Not able to access the widgets in Lync using these classname.

    But while automating Notepad , print control identifier prints control names.Using the control names .

    app.Notepad.MenuSelect("Edit -> Replace")

    app.Replace.PrintControlIdentifiers()

    Control Identifiers:

    Static - 'Fi&nd what:' (L1018, T159, R1090, B172)

                 'Fi&nd what:' 'Fi&nd what:Static' 'Static' 'Static0' 'Static1'

    Edit - '' (L1093, T155, R1264, B175)

              'Edit' 'Edit0' 'Edit1' 'Fi&nd what:Edit'

    While debugging understood that Ctypes lib is not producing any output for Lync Communicator , but for Notepad it gives the control names.

    Please help me to finding the controls in Lync application.

    Queries:

    Is it possible to automate the Lync applicaiton ( .Net applicaiton)using Pywinauto.If it is possible to automate .Net applcation, upto which version pywinauto supports?

    Is it possible to extract the controls inside the wrapper classes( classname printed while executing Lync'PrintControlIdentifiers()) and access them?

    Used the Pywinauto on Windows VM with Windows XP and Vista. Is it possible use pywinauto for Win64.

    Is their anything to do with Ctypes lib or OS?

    Thanks in Advance!

     
  • Denis
    Denis
    2012-02-01

    Hi gomathiu, it seems like pywinauto was not able to detect controls for window class 'DUIBaseHWDHost'.
    PrintControlIdentifiers() had to print children for the window, but .Children() method returned .
    To check this theory please try swapy-ob tool http://code.google.com/p/swapy/.
    It is a GUI tool for pywinauto. You immediately determine whether the automated your app.

    > Is it possible to automate the Lync applicaiton ( .Net applicaiton)using Pywinauto.If it is possible to automate .Net applcation, upto which version pywinauto supports?
    >Is it possible to extract the controls inside the wrapper classes( classname printed while executing Lync'PrintControlIdentifiers()) and access them?

    Please, try swapy-ob if you can access subitems in the objects tree you will access this controls in pywinauto.

    >Used the Pywinauto on Windows VM with Windows XP and Vista.
    Yes

    >Is it possible use pywinauto for Win64.
    Yes, in this case you have to use python 32, or see to pywinauto 64bit fork http://code.google.com/r/vasilyvryabov-pywinauto-x64/source/browse