Giter Site home page Giter Site logo

altran-pt-gdc / robot-framework-pywinauto-library Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 4.0 65 KB

A Python 3.x Pywinauto Library for RFW - Robot Framework to enable keyword-driven testing for Windows Desktop applications

License: MIT License

HTML 75.22% Python 24.38% RobotFramework 0.40%

robot-framework-pywinauto-library's Introduction

Robot Framework Pywinauto Library

This is a Robot Framework library that uses Pywinauto to test Windows desktop apps using keyword-driven test scripts. This library is based on a old winbot.py library located in https://groups.google.com/forum/m/#!topic/robotframework-devel/lTPC2H4XxW8 and developed by Dragonfyre13.

Altran created the library to be working in Python 3.x and the new versions of Pywinauto (0.6.8) and included the remote interface. New functionalities will be added in a near future.

Usage:

  1. install Robot Framework and PyWinAuto

    pip install robotframework
    pip install pywinauto
    
  2. Execute a local robotframework script that imports the library

    robot pywinauto.robot
    

Example Robot script:

*** Settings ***
Library  PywinautoLibrary

*** Test Cases ***
Test Notepad
    Log    Testing open notepad
    Start Application    notepad.exe
    sleep    1s
    Get Dialog    Untitled - NotepadNotepad
    Type Keys    Edit    Test
    Menu Select    File -> Save As...
    Get Dialog    Save As
    Type Keys    edit1    test.txt
    Click    Save
    Close Application

Remote Interface

Usage:

  1. install Robot Framework, Remote Library and PyWinAuto

     pip install robotframework
     pip install robotremoteserver
     pip install pywinauto
    
  2. Launch the remote server: in this example we're using the localhost ip (127.0.0.1), in a real scenario an accessible ip should be used:

     python PywinautoLibrary.py 127.0.0.1 8270
    

    Or a real scenario example:

     python PywinautoLibrary.py 192.168.0.2 8270
    
  3. Execute a local robotframework script that imports the remote library robot pywinauto_remote.robot

Example Robot script:

*** Settings ***
Library  Remote  http://127.0.0.1:8270  WITH NAME  remote0

*** Test Cases ***
Launch and Close Notepad
    remote0.Start Application    notepad.exe
    sleep   2s
    remote0.Close Application

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.