Robot Framework User's Guide

Source: Internet
Author: User
Tags documentation version control system
Robot Framework User's Guide version 2.8.6Copyright © Nokia Solutions and Network 2008-2014 3.0 Unported License authorization based on knowledge sharing

Table of Contents 1 Start 1.1 Introduction 1.2 Copyright and License 1.3 Installation Instructions 1.4 Model 2 Create test Data 2.1 test Data Syntax 2.2 Create test Case 2.3 Create test suite 2.4 Use test library 2.5 variable 2.6 Create user keywords 2.7 resources and variable files 2.8 Advanced features 3 Execute Test Case 3.1 Basic Usage 3.2 Test Execution 3.3 post processing output 3.4 Configuration execution 3.5 Create output 4 Expand Robot Framework 4.1 create test Library 4.2 remote library interface 4.3 Use listener Interface 4.4 Expand robot Framework jar 5 Support Tools 5.1 Library Documentation Tool (LIBDOC) 5.2 Test Data Document tool (TESTDOC) 5.3 Test Data Cleanup Tool (NEAT) 5.4 External Tools 6 Appendix 6.1 test data all available Settings 6.2 All command line Options 6.3 Test data Template 6.4 Document format 6.5 time format 6.6 Internal API 1 start /c3> 1.1 Introduction 1.2 Copyright and License 1.3 installation Notes 1.4 Model 1.1 Introduction

The Robot framework is a python, extensible, keyword-driven test automation framework for End-to-end acceptance testing and acceptance test-driven development (ATDD). It can be used to test distributed heterogeneous applications, where validation involves a variety of technologies and interfaces. Why 1.1.1 Use the robot Framework. 1.1.2 Advanced Architecture 1.1.3 Screenshot 1.1.4 Get more Information project page mailing list 1.1.1 Why use the robot Framework. Create a test case in a uniform way by creating easy-to-use table syntax. Provides the ability to create reusable, more advanced keywords from existing keywords. Provides Easy-to-read results reports and logs in HTML format. Platforms and applications are independent. Provides a simple library API to create a custom test library that can be executed locally in Python or Java. Provides a command-line interface and an xml-based output file for integration into an existing build infrastructure (continuous integration System). Provides support to selenium for web testing, Java GUI testing, running processes, telnet,ssh, and so on. Supports the creation of data-driven test cases. Built-in support for variables, especially for testing in different environments. Provides tags to categorize and select the test cases to be executed. Implement easy integration with source control: test suites are only files and directories that can be versioned with production code. Provides level setup and disassembly of test cases and test suites. Modular architecture supports the creation of tests, even for applications with many different interfaces 1.1.2 Advanced Architecture

The Robot framework is a general-purpose, application-and technology-independent framework. It has a highly modular architecture, as shown in the following illustration.

Robot frame Structure

The test data is simple and easy to edit in tabular format. When the robot framework is started, it processes test data, executes test cases, and generates logs and reports. The core framework does not know anything about the target being tested, and its interaction is handled by the test library. Libraries can use the application interface directly, or you can use the underlying test tools as drivers. 1.1.3 screenshot

The following screenshot shows examples of test data and the reports and logs created.

Test Case Files

Reports and logs 1.1.4 get more information project pages

The first place to look for more information about the robot framework and the rich ecosystem around it is http://robotframework.org. The Robot framework itself is hosted on GitHub. Mailing List

There are several robot frames mailing lists where to request and search for more information. The mailing list file is open to everyone (including search engines) and is free to be added to these lists. However, only list members can send messages, and in order to prevent spam, new users will be hosted, which means that your first message may take some time. Don't be afraid to send questions to the mailing list, but remember how to ask the question in an intelligent way. Robotframework User General discussion of all robot framework-related issues. Questions and questions can be sent to this list. Also used for information sharing for all users. Robotframework notices only the mailing list of the bulletin board, only the moderator can send mail. All announcements are also sent to the Robotframework-users mailing list, so you do not need to add these two lists. Robotframework-devel's discussion on the development of robot framework. Robotframework commits to automatically generate messages about submissions to the version control system, build results, new and edited issues, and more. Can be used to track the development of the robot framework. 1.2 Copyright and license

The Robot framework itself, the test libraries and support tools distributed with it, as well as the user's guide and other documented documents, have the following copyright notices.

Copyright 2008-2014 Nokia Solutions and networks are licensed under the Apache License version 2.0 ("license") and shall not be used except in compliance with the license. You can obtain a copy of the license    http://www.apache.org/licenses/LICENSE-2.0 unless applicable legal requirements or written consent, the software distributed according to the license according to the "Status quo" distribution, without any form of guarantee or condition, Whether it's explicit or implied. See licensing for specific languages on permissions and permissions based on license restrictions.
1.3 Installation Instructions

These instructions include installing and uninstalling the robot framework and its prerequisites on different operating systems. If you have already installed the PIP, then the operation is sufficient:

Point installation Robotframework
1.3.1 Introduction 1.3.2 Prerequisites Python Installation Jython installation IronPython installation configuration path settings Https_proxy 1.3.3 Install robot Framework package administrator (such as Pips) use Windows installation from source code installation Program independent jar Distribution manual installation verify installation where files 1.3.4 Uninstall and upgrade uninstall upgrade 1.3.5 Different entry point Runner Script Direct entry point 1.3.1 Introduction

The Robot framework is implemented in Python, or it can be run on Jython (JVM) and IronPython (. NET). Before installing the framework, an obvious prerequisite is to install at least one such interpreter. Please note that Python 3 is not yet supported, but there is an unofficial Python 3 port available.

The following is a list of different ways to install the robot framework itself, and explain in more detail in subsequent chapters. Package administrator (e.g. idea)

The Python Package Manager makes the installation trivial. For example, the PIP user only needs to perform:

Point installation Robotframework

However, using Package Manager first adds a prerequisite to installing the Package Manager itself. Installing from a source code can work with either the operating system or the Python interpreter. You can obtain source code by downloading and extracting source code or cloning the GitHub repository from PyPI. Using Windows Installer, a graphical installer with 32-bit and 64-bit Windows systems can be found on the PyPI. Standalone jar distribution If you run tests with Jython, the easiest way to do this is to download the standalone robotframework-<version> jar from Maven. The jar release contains the Jython and robot Framework, so you only need to install Java. Manual installation if you have special requirements and no other work, you can customize the manual installation at any time. 1.3.2 Prerequisites

The Robot Framework supports Python,jython (JVM) and IronPython (. NET), or it can be run on pypy. You should install the interpreter you want to use before installing the frame.

In general, which interpreter is used depends on the test library and test environment that you want. Some libraries use tools or modules that can only be used with Python, while others may use Java tools that require jython or need. NET, and therefore need to use IronPython. There are also a number of tools and libraries that can be run with all the interpreters.

If you don't have special needs or just want to try the framework, it's recommended to use Python. This is the most mature implementation, much faster than Jython or IronPython (especially startup time) and is easily available on most Unix-like operating systems. Another good option is to use a stand-alone jar release that is only provided in Java. python installation

On most Unix-like systems (such as Linux and Os X), you installed Python by default. If you're using Windows, or if you need to install Python yourself, then a good start is http://python.org. There, you can download a suitable installer and get more information about the installation process and Python.

The Robot framework currently supports the Python version 2.5,2.6 and 2.7. The plan will support Python 3 in the future, while Python 2.5 's support will be discarded. The Robot Framework 2.0 and 2.1 support Python 2.3 and 2.4.

On Windows, it is recommended that you install Python to all users and run Setup as an administrator. In addition, you cannot set the environment variable Pythoncaseok.

After you install Python, you may still need to configure path so that the Pybot runner script is executable at the command prompt. Jython Installation

Using a Java-implemented test library or a test library that uses Java tools internally requires that the robot Framework be run on Jython, while Jython requires either the Java Runtime Environment (JRE) or Java Development Kit (JDK). Installing any of these Java implementations is outside the scope of these instructions, but you can find more information from http://java.com if you need to.

Installing Jython is a fairly simple process, and the first step is to get the installer from http://jython.org. The installer is an executable jar package that can run Java-jar jython_installer-<version>.jar like the command line. Depending on your system configuration, you can also double-click the installer.

The minimum supported Jython version is 2.5, which requires Java 5 (also known as Java 1.5) or an updated version. The upcoming Jython 2.7 will require a minimum of Java 7, and future support for Jython 2.5 will be minimal for the robot framework. The Robot Framework 2.0 and 2.1 support Jython 2.2.

After you install Jython, you may still need to configure path to make the Jybot runner script executable at the command prompt. IronPython Installation

IronPython allows you to run the robot Framework on the. NET platform and interact with C # and other. NET languages and APIs. Only IronPython 2.7 is supported.

When using IronPython, an additional dependency is to install the ElementTree Module 1.2.7 Preview version. This is required because the ElementTree module that is distributed using IronPython is corrupted. You can install the package by downloading the source code release, decompressing and ipy setup.py install at a command prompt in the directory you created.

After you install IronPython, you may still need to configure path so that the Ipybot runner script is executable at the command prompt. Configure Path

The PATH environment variable lists the commands that are executed in one system from the search location. In order for the command prompt to use the robot Framework more easily, it is recommended that you add the installation location of the runtime script to the path. The runner script itself needs a matching interpreter in path, so the interpreter installation directory must also be added there.

When using Python on a Unix-like machine, both Python itself and the installed script should be automatically in path without additional action. On Windows and other interpreters, path must be configured separately. what directory to add to path

Which directories you need to add to path depends on the interpreter and the operating system. The first location is the installation directory for the interpreter (for example, C:\ Python27) and the location of the interpreter installation script. Both Python and IronPython install scripts into the Scripts directory under the Windows installation directory (such as C:\ Python27 \ Scripts), Jython use the bin directory regardless of the operating system (for example, C:\ jython2.5.3 \ BIN).

Note that scripts and bin directories may not be created as part of an interpreter installation, but only later when the robot framework or other Third-party modules are installed. to set path on Windows

On Windows, you can configure path by following these steps. Note that the exact setting name may vary from version to Windows, but the basic method should still be the same. Open Start > Settings > Control Panel > System > Advanced > Environment Variables. There is a user variables and system variables, and the difference is that users ' variables affect only the current user, and that systems variables affect all users. To edit an existing path value, select Edit and add at the end of the value (for example). Note that semicolons () are important when separating different entries. To add a new path value, select and set the name and value without a leading semicolon this time.;<installationdir>;<scriptsdir>; C:\Python27; C:\Python27\Scripts; New exits the dialog box OK to save the changes. Start a new command prompt for the changes to take effect.

Note that if you install multiple versions of Python, the Execute Pybot script will always use a script that is the first to be installed in the path regardless of the version of the Python. To avoid this, you can use the direct entry point and the interpreter C:\Python26\python.exe-m Robot.run at any time.

Also note that you should not add quotes around the directory you add to the path (for example, "C:\Python27\Scripts"). Quotes can cause problems with your Python program, even if the directory path contains spaces, and path does not need them. set path on a Unix-like system

On a Unix-like system, it is often necessary to edit a system-wide or user-specific configuration file. which file to edit and how to rely on the system, and need to consult the operating system documentation for more detailed information. Set Https_proxy

If you plan to use the PIP for installation and after the agent, you need to set the HTTPS_PROXY environment variable. It is required when you install the PIP and use it to install the robot framework and other Python packages.

How you set up Https_proxy depends on the operating system, similar to configuring path. The value of this variable must be the URL of the proxy, such as http://10.0.0.42:8080. 1.3.3 installation Robot Framework package administrator (e.g. idea)

The most popular P

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.