Search code examples
pythonpywin32win32comsap-gui

How to quit SAP using python and win32


I am automating a process with SAP using python and win32com.client. At the end of the process I want to quit the SAP application. For doing that I do click on "Abmelden" (session.findById("wnd[0]/tbar[0]/btn[15]").press()) and then appears a popup window to confirm the action (see image). My problem is that I can't find a way to proceed with the confirmation. Can anybody help me?

enter image description here


Solution

  • You could try like this:

    session.findById("wnd[1]/usr/btnSPOP-OPTION1").press
    

    Regards, ScriptMan