Giter Site home page Giter Site logo

uimap's Introduction

uimap

Cross platform UI Automation Python Library

Installation

pip install uimap

Usage

  1. Create UI Map.
  2. Load UI Map and access UI elements by names.

Example

  1. Create UI Map: c:\itunes.yml

     ---
     __driver: wpf
     WND_ITUNES:
       __char:
         __scope: child
         Name: iTunes
         ClassName: iTunes
         ControlType: Window
       LCD:
         __char:
           __scope: child
           Name: LCD 部分
           ControlType: Text
         LCD_DOWNLOADING: lbl正在下载*
         LCD_ACCESSING: lbl正在访问*
         LCD_PAYING: lbl正在购买*
         LCD_BTN_CANCEL: btn停止
       NAV_BAR:
         __char:
           __scope: child
           Name: ""
           ControlType: Button
         LNK_HOME:
           __char:
             __scope: child
             Name: iTunes Store 主页
             ControlType: Button
    
  2. Load and access

     from uimap import UiMap
     ui = UiMap(r'c:\itunes.yml')
     if ui.WND_ITUNES.exist():
         print 'iTunes window is open.'
     else:
         print 'iTunes window is not found.'
    

Drivers

LDTP

A cross-platform opensource automation testing tool.

Homepage: http://ldtp.freedesktop.org/wiki/

To use ldtp driver, create UI map with

__driver: ldtp

and describe UI elements with LDTP naming convention.

WPF

UI Automation Library provided by Microsoft with .NET Library.

Homepage: http://msdn.microsoft.com/en-us/library/ms747327.aspx

To use wpf driver, create UI map with

__driver: wpf

and describe UI elements by properties of AutomationElement.

.NET 4.0 and IronPython required.

Actions

click()

Simulate user click on UI element.

exist()

Determine whether the UI element exists.

sendkeys(keys)

Simulate key strokes to UI element.

Example:

ui.TXT_USERNAME.sendkeys('my_name<enter>')

activate()

If the specified UI element is a window, bring it to the front, otherwise set focus to it.

Example:

ui.WND_ITUNES.activate()

maximize()

Maximize the specified window.

value()

Get the value of the UI element.

Example:

print 'the username is', ui.TXT_USERNAME.value()

set_value(val)

Set the value of the UI element.

Example:

ui.TXT_USERNAME.set_value('my_name')

close()

Close the specified window.

uimap's People

Contributors

renorzr avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.