Robot Framework test summary

Source: Internet
Author: User

In 2014, I met the robot framework due to a chance. A testing predecessor recommended the robot framework. Robot framework is a testing framework of the python language. After a brief introduction, I think it is good and suitable for beginners. In addition, the testing department leaders also support the introduction of open-source automated testing tools.

Let's talk about how to set up the environment, which is the most important for the publisher. First install Python, Jython (if java-related libraries are not used, Jython may not be installed), Wxpython; then install the robot Framework and Ride (test case editing and executors are not required. But it is best to install ride for ease of use ). The robot framework itself comes with many test libraries, including Builtin, Operating System, Collections, and String. These libraries do not need to be installed and can be directly used after the framework is installed; additional installation is required for the Test library provided by a third party. You can install the test library as required. For example, test the web program, install selenium or watir library, test the database using the db library, and test the java program using the swing library. The installation details of the library are not described here. You can refer to the documentation provided by the library for installation.

       Case 1: Use RemoteApplication + Swing Library to test the java program (failed)

      Refer to the demo on the official website to start the test program using swing, but there are many problems. The main reason is that the program to be tested is started through another program, but swing does not recognize the program to be started later.

      Therefore, use RemoteApplication to start the tested program and then introduce swingLibrary to test the application. Although it is okay to start, Swing can be used normally. However, some controls (some dialog, checkbox) cannot be found in Swing. After studying for a long time, no answer was found. Although the results ended with failures, they still gained a lot. During the study, it was found that the use of swing is very simple. If some controls are excluded, we can use it as the main test tool.


        Case 2: Use the Db library to test the database (successful)

       Then you can start the test.For more information, see the examples on the official website.


         Case 3: use AutoIT library to test C language applications (failed)

It was found that AutoItLibrary was not recognized and could not be used normally after it was installed in Windows. Later, it was found that it was an issue with AutoItX3.dll under the 3rdPartyTools \ AutoIt directory. Because AutoItX3.dll is 32-bit, I searched for a 64-bit dll on the Internet to replace it. After the installation is completed, no problem occurs.

You want to use it to implement a simple data import function: open the window, click the Import button, select a path in the tree in the pop-up window, and then click the Import button. However, such a simple use case has not been successfully executed, and I do not know why. Symptom: pass is displayed after the use case is executed, but no action is performed when the tree structure is selected.

I was puzzled. Later I studied the autoIT tool directly and used the existing methods to achieve my goal. Of course, there are also some small episodes, such as the wait time is too short, resulting in execution failure; when the tree is expanded, only one level can be expanded at a time.

I compared the keyword of the robot script with the method in the autoit script, and it feels similar. But I don't know why the robot is not successful. I have to go back and study it later.


        Case 4: Use selenium2Library to test the web (successful)

     Install selenium2library and decorato. I simply opened the webpage and executed some simple actions without in-depth research.


Case 5: Use the built-in operating0000e (successful)

       Purpose: to test whether the folder is empty. If it is empty, stop the check.

* ** Settings ***
Library OperatingSystem

* ** Test Cases ***
CheckFolderIfEmpty
Wait Until Keyword Succeeds 1 min 10 sec Directory shocould Be Empty C: \ TestFolder


This is my summary of the use of the robot framework over the past three months. There are successes, failures, and twists and turns. However, it was this experience that made me understand that when selecting a tool, we should make a careful investigation and use it to confirm whether it is in sync with your tested program. The tool should also be the same as the human, use its length, avoid its short.

Robot Framework test summary

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.