Robot Framework Usage 1-environment configuration and simple site compatibility testing

Source: Internet
Author: User

Introduction to the 0.Robot Framework

The Robot framework is a common automated testing framework for "acceptance testing" and "acceptance test driven Development (ATDD)" (ATDD is described in detail in other articles). It uses tabular test data syntax and implements a keyword-driven test strategy. Its testing capabilities can be extended using test libraries, which can be written using Python or Java methods, and users can extend new keywords from existing keywords.

1. Environment configuration

The Robot framework is an open-source test framework developed by Python that requires the installation of a Python environment when used. The use of Linux system in the last introduction, generally used in Windows system, you can use the client-side to script writing, here we use ride, because ride itself is based on Wxpyhton, but also need to install Wxpyhton.

1) Python

Because of the robot framework a series of plug-in version support reasons, Python3 support is not the night, here I use the Python2.7

https://www.python.org/downloads/

Robot Framework 2.9 supports Python 2.6, 2.7

Robot Framework un-official Python 3 Port support Python3

Robot Framework 2.5-2.8 Support Python 2.5

Robot Framework 2.0-2.1 supports Python 2.3 and 2.4

2) Robot Framework

https://pypi.python.org/pypi/robotframework/2.9

3) WxPython

Since ride does not support the new version of Wxpyhton, it is required to use 2.8

Http://sourceforge.net/projects/wxpython/files/wxPython/2.8.12.1/

4) RIDE

Https://pypi.python.org/pypi/robotframework-ride

5) Selenium2library

In the next test, we will do a simple browser compatibility test on the Baidu search results page, need to install selenium2library to drive the browser

https://pypi.python.org/pypi/robotframework-selenium2library/1.7.3

6) Iedriverserver

The Robot Framework comes with a library that can drive the Firefox browser by default, and for Chrome, ie and more, you need to use a separate driver

http://yun.baidu.com/share/link?shareid=2762910260&uk=3377238441

Now that the environment configuration is complete, let's run a simple compatibility test instance.

2. Simple website Compatibility test

In this example, we will use Robotframework to operate different browsers to open baidu.com, to search for keywords, to the search results page. Then watch the results for a simple test of browser compatibility.

A) After the ride installation is complete, you can see the ride shortcut on the desktop:

b) Run

c) New project, note type selection as Directory

d) Right-click on the project and create a new test Suite

e) Right-click on the Testsuite and create a new testcase

f) Before writing the test case, we need to import the required library selenium2library, click Testsuite, click the Library button in the Edit tab

g) The name of the library is filled in selenium2library

h) After the first time the library is added, the text of the library may be red, indicating that the library is not found and requires a reboot of the ride to reload the library. If it is still not red, it means that the library does not exist and needs to be reinstalled.

i) Start writing test cases, press the F5 key to search for keywords, find keywords to use, or view all keywords.

j) Add TestCase

k) Run the test, wait for the test to execute, and view the test results

L) Depending on the log record that is running, you can view the test log file, report file, and two browser search results in the project directory.

At this point, the test is complete.

Here we just implement a simple browser to open the site, do simple operations, and the process. The next article will explain the control of page elements.

Http://www.cnblogs.com/buaawp/p/4737128.html

Robot Framework uses 1-environment configuration and simple site compatibility testing (RPM)

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.