Introduction to Robotframework and its working principle~

The following is a brief introduction to Robotframework and its working principle through the official website and online information.

Official description:

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.

The translation is as follows:

Robot Framework is a general-purpose test automation framework for acceptance testing and acceptance test-driven development (ATDD). It has an easy-to-use tabular test data syntax and uses a keyword-driven testing approach. Its testing capabilities can be extended through testing libraries implemented in Python or Java, and users can create new higher-level keywords from existing keywords using the same syntax as creating test cases.

My understanding is as follows:

Robot Framework is a completely keyword-based test-driven framework, which can import the test library you need based on its certain rules (for example: it integrates selenium's test library, which can be understood as the underlying test library for operating web controls ), then based on these test libraries, you can write your own keywords in the form of HTML, TXT and other documents (these keywords are composed of your library), and then write test cases (test cases are composed of test keywords) for testing . For example: a simple login test consists of three keywords: login + password input + logout, or it can also be composed of a keyword login, and the size of the keyword particles can be customized.

mainly include:

Built-in standard library, such as BuiltIn

External (third-party) extension libraries such as Selenium2Library

Keywords, mainly including built-in keywords that are always available, library keywords from imported test libraries and user keywords created by users using table syntax when creating test cases

Create tests, mainly including test projects, suites, and use cases

run test

To generate a test report, three files will be generated: Output.xml, Log.html, and Reprot.html, among which Log.html is mainly used to display the execution process of the test script, and report.html is a test report, which shows the running status of the test case and result.

working principle:

The basic operation process of Robot Framework is as follows:

1. Robot starts testing by inputting commands from cmd, and the initial running program receives command characters (mainly test case sets written in txt or html)

2. After receiving, Mr. robot generates and initializes the global variable configuration, mainly to define a series of field names and file names (for example: log file name, etc.) (completed by the class in settings.py)

3. Then, start parsing the use case file to generate data objects, which contain various data of the test set, such as: test case set name, each test case name, each keyword name, etc.

4. Then transfer the test data object to the test collection class for processing, and generate the test set suite object

5. Then run the use case test in the suite, then call the keyword, find the library file corresponding to the keyword, and perform the operation

6. Write each operation and result in the output xml file (there is a class specially called to operate on the output xml)

7. Finally, after the test is completed, call the conversion class to convert the xml file into the corresponding HTML log report, and the test is completed.

From the working principle of Robot Framework, we can learn well the application of keyword test-driven thinking and data test-driven thinking.

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:

insert image description here

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can use your mobile phone to do the quizzes, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. I hope it can help you too!      

Guess you like

Origin blog.csdn.net/nhb687095/article/details/132495489