Robotframework软件测试测试员的那点事

RobotFramework简介(架构+标准库)

2017-09-25  本文已影响109人  Rethink

前言 : 本篇理论描述比较多,主要简单介绍了RobotFramework的基础架构以及标准库知识。要想学好RF并且少走弯路,了解这些基础知识我认为是很有必要的,因为它可以给你一个大致的入门思路和学习方向,让你不至于迷茫到底该从哪里下手学习RF。

RobotFramework 官网
Robot Framework User Guide

Robot Framework 介绍

Robot Framework is a Python-based keyword-driven test automation framework for acceptance level testing and acceptance test-driven development (ATDD). It has an easy-to-use tabular syntax for creating test cases and its testing capabilities can be extended by test libraries implemented either with Python or Java. Users can also create new higher level keywords from existing ones using the same simple syntax that is used for creating test cases.

Robot Framework是一个基于Python并且是关键字驱动的开源自动化测试框架,主要用于验收级别测试和验收测试驱动开发(ATDD)。它有一个易于使用的表格语法,用于创建测试用例,它的测试功能可以通过用Python或Java实现的测试库来扩展。用户还可以使用与创建用例时相似的简单语法,来从现有的关键字中创建新的更高级别的关键字。

Why Robot Framework ?

Copy From Robot Framework User Guide

RobotFramework 架构

Robot Framework is a generic, application and technology independent framework. It has a highly modular architecture illustrated in the diagram below.

机器人框架是一个通用的、应用和技术的独立框架。它有一个高度模块化的架构,如下图所示。


Robot Framework architecture

如果需要用一句话来形容下RobotFramework 可以做哪些事情的话,下面这句话或许很恰当:

The core framework does not know everything about the target under test,and the interactiuon with it is handled by test libraries.

RobotFramework 库介绍

RF的库分为标准库(standard library)和扩展库(external library)。
对于标准库,这些库是直接绑定在RF内的,在
..\Python27\Lib\site-packages\robot\libraries
下可以看到,无须再下载;而外部库,是需要根据个人需要,下载后再安装导入才能使用的。 对于标准库,又分两类,类似BuiltIn库是RF自动加载到内存的,安装后按下F5就能直接使用,不需要再次import,而XML库需要再次import才能正常使用。因为BuiltIn Library 提供了很多常用的关键字,比如Sleep, Log, Evaluate等,所以RF就把这个常用的库自动加载到了内存。

standard library

官网上标出的11个标准库在这里都能找到对应的.py文件。

image.png

不同的RF版本,相同的标准库之间也可能会有细微的差别,以下以 the latest version:v3.0.2 ,概括介绍下这几个标准库的作用。

Reference From Robot Framework documentation

上一篇下一篇

猜你喜欢

热点阅读