How to Indetify a the Window name

2008-12-12
2013-05-28
  • shery shery

    shery shery - 2008-12-12

    HI,

    I was trying to automate the SAP windows GUI application.

    I have installed the python 2.4 with pywinauto 0.3.7 along with Ctypes and Sendkeys. Setup was successful and example was running efficiently.

    When I tried to open a SAP window, now i am confused how to get the name of the window and also the objects in that window so that we can use the properties of the same to automate the application.

    Like we do in commericial vendor based software we have a object repository in QTP and GUI Map files in winrunner which can specify what is the window prop or objects in that window, but when using pywinauto how to do the same.

    Thanks
    Shery

     
  • laurent vanboquestal

    I also have similar problems with SAP application ….

    Using this code, I get the application … but I can't see any control …

    from pywinauto import application

    app = application.Application.start("C:\\WINDOWS\\SAPwksta\\setup\\SapStart.exe -sal=\"C:\\WINDOWS\\SAPwksta\\setup\\SAL\\SapLogon.sal\"")

    app.top_window_()._ctrl_identifiers()
    app.top_window_().PrintControlIdentifiers()

    and I got this error:

    D:\pywinauto-0.3.9\pywinauto-0.3.9>python sap_test.py
    Traceback (most recent call last):
      File "sap_test.py", line 4, in <module>
        app.top_window_()._ctrl_identifiers()
      File "pywinauto\application.py", line 986, in top_window_
        criteria = windows
    IndexError: list index out of range

     
  • Mark Mc Mahon

    Mark Mc Mahon - 2009-11-27

    Hi,

    You have spotted a bug in Pywinauto - though it only occurs when there are no windows for the process.

    I have fixed the code - it will now raise a runtime error when there are no windows available. (which will not be an awful lot better for you - but at least the message will be clearer).

    I think you need to verify that the process you start is the one that has the application, for example if SAP opens up a 2nd process for the UI - then you will need to connect to it rather than starting it (i.e. start it through an os.system call or similar - and then use Application.Connect() afterwards.

    Hope this helps,
      Mark

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks