Automação Microsoft SQL Server 2008 R2 usando Python (pywinauto)

Estou criandoMicrosoft SQL Server Management Studio Ferramenta de automação usando python. O problema é que não consigo selecionar oChild_treeBanco de dados (Northwind) Está selecionando oParent_tree(Bancos de dados). Preciso fazer muito mais, clicando na opção child_tree (Northwind) com o botão direito do mouse (Ex. Tarefas-> backup). Ajude-me a fazer o melhor código de automação. Desde já, obrigado.


import pywinauto
import socket
import binascii
host = socket.gethostname()   #Getting system host name
n2 = int('0b111000001100001011100110111001101110111011011110111001001100100', 2) #password
n1 = int('0b111010101110011011001010111001001101110011000010110110101100101', 2) # username
n  = int('0b1110011011001010111001001110110011001010111001001101110011000010110110101100101', 2) #servername av
if (host == "systemhostXXX" or host == "systemhostyyy"): # checking the host name 
     try:
        pwa_app = pywinauto.application.Application()
        path = pwa_app.start_(r"C:/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn/VSShell/Common7/IDE/Ssms.exe") #Opening the .exe file<br>
        print("Status: Application Launched successfully!!")
    except:
            print("Error: Applicatin Launching Error!!")
    try:<p></p>

    pwa_app.ConnecttoServer.ComboBox1.Select("Database Engine")   #Selecting the combobox value 
    pwa_app.ConnecttoServer.edit1.SetText(binascii.unhexlify('%x' % n))
    pwa_app.ConnecttoServer.ComboBox3.Select("SQL Server Authentication")
    pwa_app.ConnecttoServer.edit2.SetText(binascii.unhexlify('%x' % n1))   # convert binary into string
    pwa_app.ConnecttoServer.edit3.SetText(binascii.unhexlify('%x' % n2))
    print("Status: Log-in Process!!")
    pwa_app.ConnecttoServer.Connect.Click()
except:
    print("Error: Log-In Failed!!Please Relaunch!")

try:
    pwa_app.ConnecttoServer.Ok.Click()  #Button click (OK)
    pwa_app.ConnecttoServer.Cancel.Click()
    print("Error: Restoration going-on!!")
except:
    print("Status: Log-in Success!!")

    try:
        w_handle = pywinauto.findwindows.find_windows(title=u'Microsoft SQL Server Management Studio', class_name='wndclass_desked_gsk')[0]
        window = pwa_app.window_(handle=w_handle)
        ctrl = window['TreeView']  
        ctrl.GetItem([u'SQL Server 8.0.2039']).Click() 
        ctrl.GetItem([u'SQL Server 8.0.2039', u'Databases', u'Northwind']).Click() #Selecting the database

    except:
        print("Database selection failed !!")

else: print 'Dear', host, 'Você não está autorizado a executar este programa \ n'

questionAnswers(1)

yourAnswerToTheQuestion