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的overload与override
概括 方法的重写(Overriding)和重载(Overloading)是Java多态性的不同表现.重写(Overriding)是父类与子类之间多态性的一种表现,而重载(Overloading)是一个 ...
- iOS中 项目开发易错知识点总结 韩俊强的博客
每日更新关注:http://weibo.com/hanjunqiang 新浪微博! 点击return取消textView 的响应者 - (BOOL)textFieldShouldReturn:(UI ...
- 浅谈C语言 extern 指针与数组
/* * d.c * * Created on: Nov 15, 2011 * Author: root */ #include "apue.h" int a[] = {3,2}; ...
- 《java入门第一季》之集合框架TreeSet存储元素自然排序以及图解
这一篇对TreeSet做介绍,先看一个简单的例子: * TreeSet:能够对元素按照某种规则进行排序. * 排序有两种方式 * A:自然排序: 从小到大排序 * B:比较器排序 Comp ...
- tar 压缩和解压缩使用笔记
tar 压缩和解压缩使用笔记 1 文件 1.1 打包 1.1 压缩 $ tar czf myfile.txt.tar.gz ./myfile.txt 1.2 解压缩 解压缩到目录: $ mkdir o ...
- TableEdit UI_10
1.tableView的编辑的步骤: 1.让tableView处于编辑状态,(默认所有的cell都处于编辑状态,默认下的编辑样式是删除) 2.设置哪些cell可以编辑 3.设置编辑的样式(删除,插 ...
- 11.1、Libgdx的音频之音效
(官网:www.libgdx.cn) 音效通常是比较小的音频文件,通常是几秒钟的长度.通常用在特定的游戏事件中,比如跳跃或者射击. 音效可以保存为多种格式.Libgdx支持MP3.OGG和WAV文件. ...
- PO标准form的一点疑问
最近在修改采购订单form的时候,发现采购订单form往数据库中插数据的地方找不到,程序太多.我们又需要根据界面上的item的值在订单界面数据生成数据库数据时插值时,只能是想其他办法,一种是在on-i ...
- 【一天一道LeetCode】#61. Rotate List
一天一道LeetCode系列 (一)题目 Given a list, rotate the list to the right by k places, where k is non-negative ...
- Vi/Vim 替换使用方法
vi/vim 中可以使用 :s 命令来替换字符串.该命令有很多种不同细节使用方法,可以实现复杂的功能,记录几种在此,方便以后查询. :s/vivian/sky/ 替换当前行第一个 vivian 为 s ...