Robot Framework + Pywinauto 框架实现Windows GUI Automation
Robot Framework is a generic test automation framework for acceptance testing and acceptance test-driven development (ATDD). It has easy-to-use tabular test data syntax and it utilizes the keyword-driven testing approach.
Its testing capabilities can be extended by test libraries implemented either with Python or Java, and users can create new higher-level keywords from existing ones using the same syntax that is used for creating test cases.
Robot Framework itself is open source software and most of the libraries and tools in the ecosystem are also open source.
With a lot of standard and external libraries.
Pywinauto is a GUI automation library written in pure Python and well developed for Windows GUI. At its simplest it allows you to send mouse and keyboard actions to dialogs and controls on both Windows and Linux, while more complex text-based actions are supported on Windows only so far (Linux AT-SPI support is under development).
This big release introduces MS UI Automation (UIA) support (WinForms, WPF, Qt, browsers, Store apps and more).
Modules keyboard and mouse can be used out of any window context now. And they work on Linux as well! Multi-backend architecture allows to add new platforms support.
Robot Framework + Pywinauto

1. Encapsulate the pywinauto codes(functions) to self defined libraries for Robot Framework

2. Add self defined Library to robot framework
2.1 Method#1: Add Library in Test Suite

2.2 Method#2: Import the Library directly in the Test Case

Launch RIDE
1. Add New Project:
2. Add New Test Suite:

3. Add New Test Case:

4. Write test case:

Run the Scripts via RIDE

Click Log/Report button to view the Log/Report in browser:

ENV Preparation
1. Install Python
Install python 2. x or python 3.x (https://wiki.python.org/moin/Python2orPython3)
Notes:
1.1 Add python.exe to the PATH Environmental Variable(Can check this via installation)
1.2 RIDE does not support Python3
1.3 pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4
2. Install wxPython (For RIDE UI)
Method#1: pip install wxPython
Method#2: cd to the source code and run python setup.py install in command line
Method#3: install wxPython-xxx.exe(You need to install wxPython 2.8.12.1 with unicode support to run RIDE)
3. Install Robot Framework
Method#1: pip install robotframework
Method#2: cd to the source code and run python setup.py install in command line
4. Install RIDE
Method#1: pip install robotframework-ride
Method#2: cd to the source code and run python setup.py install in command line
5. Install pywinatuo
Method#1: pip install pywinauto
Method#2: cd to the source code and run python setup.py install in command line
Notes: If pip can work, can install item#2 to item#5 together via one command: pip install -r requirements.txt
Add PYTHONPATH in Environmental Variable

Notes:
1. If the self defined library does not in the PATH, you can add related directory to the PYTHONPATH
IDE
For Python:
Eclipse (Use Python plugin)
PyCharm
For RobotFramework:
RIDE (A lightweight and intuitive editor for Robot Framework test data.)
Start RIDE: cd to x:\Python27\Scripts\ and execute python ride.py in command line
Eclipse (Use RobotFramework plugin)
Tools
GUI Inspect Tool
1. Swapy.exe
This tool based on
Pywinauto 0.5.4
2. Inspect.exe
3. AccExplorer.exe
RIDE Settings



WebSite:
http://robotframework.org/
https://pypi.org/project/robotframework/
https://github.com/robotframework/robotframework
http://pywinauto.github.io/
https://pywinauto.readthedocs.io/en/latest/
https://github.com/pywinauto/pywinauto/releases
Robot Framework + Pywinauto 框架实现Windows GUI Automation的更多相关文章
- Robot Framework自动化框架搭建的步骤
我把自己之前搭建Robot Framework自动化测试框架的步骤整理了一下,感兴趣的同学可以参考一下. Robot Framework自动化测试框架+ 可视化编辑工具RIDE+Selenium2 ...
- 三年磨一剑,robot framework 自动化测试框架核心指南,真正讲透robot framework自动化测试框架(笔者新书上架)。
序 关于自动化测试的工具和框架其实有很多.自动化测试在测试IT行业中扮演着越来越重要的角色,不管是在传统的IT行业还是高速发展的互联网行业或是如今的大数据和大热的人工智能领域,都离不开测试,也更加离不 ...
- Robot Framework自动化测试框架核心指南-如何使用Java编写自定义的RobotFramework Lib
如何使用Java编写自定义的RobotFramework Lib 本文包括2个章节 1. Robot Frdamwork中如何调用java Lib库 2.使用 java编写自定义的Lib 本文作者为: ...
- Robot Framework自动化测试框架核心指南-如何做好自动化测试平台框架的设计
自动化测试如果需要能高效快速的支撑软件项目的测试,项目的快速迭代以及上线,除了以上我们介绍的需要许多的Lib来支持以及需要高效的去编写自动化测试案例外,还需要一个好的自动化测试框架平台来支撑我们的自动 ...
- Robot Framework自动化测试框架初探
Robot Framework是一款python语言编写,通用的功能自动化测试框架.它使用了比较易用的表格数据语法,基于关键字驱动测试,主要用来验收测试和验收测试驱动开发(ATDD). 本文主要介绍R ...
- 基于Python3.7 Robot Framework自动化框架搭建
一.Robot Framework 和 Selenium 的区别(面试常问) 主流自动化测试框架有Robot Framework 和 Selenium,请根据实际场景选用不同的框架,以下总结各自优缺点 ...
- Robot Framework测试框架学习笔记
一.Robot Framework框架简介 Robot Framework是一种基于Python的可扩展关键字驱动自动化测试框架,通常用于端到端的可接收测试和可接收测试驱动的开发.可以 ...
- Robot Framework测试框架用例脚本设计方法
Robot Framework介绍 Robot Framework是一个通用的关键字驱动自动化测试框架.测试用例以HTML,纯文本或TSV(制表符分隔的一系列值)文件存储.通过测试库中实现的关键字驱动 ...
- Robot Framework 自动化框架大纲
Python + Robot Framework 环境搭建 Android SDK + Appium 环境搭建 RobotFramework - AppiumLibrary 之元素定位 RobotFr ...
随机推荐
- java操作properties配置文件
Java中有个类Properties(Java.util.Properties),主要用于读取Java的配置文件,将一些可能需要变化的值存放在properties中进行配置,通常为为.properti ...
- Java并发框架——AQS超时机制
AQS框架提供的另外一个优秀机制是锁获取超时的支持,当大量线程对某一锁竞争时可能导致某些线程在很长一段时间都获取不了锁,在某些场景下可能希望如果线程在一段时间内不能成功获取锁就取消对该锁的等待以提高性 ...
- 安卓仿QQ红包领取详情界面动画
为了能清楚的看到这个效果,本人不惜几次花费重金给众群叼发放红包,来查看红包领取详情界面的动画效果,QQ效果如图: 图中我们可以看到,动画处的头像和文字是一起的,即同时并且是整体,注意,是整体进行缩放的 ...
- android6.0SDK 删除HttpClient的相关类的解决方法
本文转载自博客:http://blog.csdn.net/yangqingqo/article/details/48214865 android6.0SDK中删除HttpClient的相关类的解决方法 ...
- UNIX环境高级编程——线程属性之分离属性
说到线程的分离状态,我认为,之所以会有这个状态,是因为系统对某些线程的终止状态根本不感兴趣导致的. 我们知道,进程中的线程可以调用: int pthread_join(pthread_t tid, v ...
- iOS开发之一:入门介绍
今天就介绍一下iOS开发的基本的东西,有很多东西都是经常用到的而我却经常记不住,所以还是写下来吧. iOS开发需要的开发工具是Xcode,而Xcode又必须运行在 OS X(苹果系统)环境下,所以我们 ...
- 【一天一道LeetCode】#114. Flatten Binary Tree to Linked List
一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 Given a ...
- iOS中 断点下载详解 韩俊强的博客
布局如下: 基本拖拉属性: #import "ViewController.h" #import "AFNetworking.h" @interface Vie ...
- iOS中大流中的自定义cell 技术分享
AppDelegate.m指定根视图 self.window.rootViewController = [[UINavigationController alloc] initWithRootView ...
- UNIX环境高级编程——线程同步之条件变量以及属性
条件变量变量也是出自POSIX线程标准,另一种线程同步机制.主要用来等待某个条件的发生.可以用来同步同一进程中的各个线程.当然如果一个条件变量存放在多个进程共享的某个内存区中,那么还可以通过条件变量来 ...