Skip to content

Python realisation of basic Microsoft UI Automation functionality

Notifications You must be signed in to change notification settings

moden-py/pyuiautomation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

pyuiautomation

Python realisation of basic Microsoft UI Automation functionality

Please note, this one contais only functionality that I currently need. New functionality may be added occasionally, when I need it.

Example of usage:

import subprocess
import time

import pyuiautomation

if __name__ == '__main__':
    subprocess.Popen('calc.exe')
    time.sleep(1)
    root_element = pyuiautomation.GetRootElement()
    print root_element
    calc = root_element.findfirst('descendants', Name='Calculator',
                                  ControlType=pyuiautomation.UIAutomationClient.UIA_WindowControlTypeId)
    print calc
    button_2 = calc.findfirst('descendants', Name='2')
    print button_2
    button_add = calc.findfirst('descendants', Name='Add')
    print button_add
    button_equals = calc.findfirst('descendants', Name='Equals')
    print button_equals
    button_2.Invoke()
    button_add.Invoke()
    button_2.Invoke()
    button_equals.Invoke()
    result = calc.findfirst('descendants', AutomationId='158').Name
    print '2 + 2 = %s' % result

About

Python realisation of basic Microsoft UI Automation functionality

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%