Python + Selenium framework version (a) - What is the automated testing framework

1. What is the automated testing framework

      In short, automated testing framework by a few standards, protocols, rules of composition, provides an environment to run the script. Automated testing framework provides a lot of convenience to users to efficiently get something done, for example, clearly structured script development, in many ways, the platform executes the script, a good script execution reports to track the results.

Frame has the following advantages:

1) code reuse

2) maximum coverage

3) very low-cost maintenance

4) very little human intervention

5) Simple Report Output

2. Common Framework Classification Test

Selenium automated testing many developers have QTP turn over there, so they are in the early design of the framework can be divided into the following categories:

1) based on the test frame module

2) based on the library (Library) structure of the test frame

3) frame data driving test, and the like QTP

4) keyword-driven testing framework, but also over the QTP

5) mixing test frame, and an integrated 34

6) Behavior Driven Development Testing Framework

 Here we do not introduce one by one these frameworks, literally imagine some of the background of these frameworks and components, this is only a basic understanding of the framework.

3. The basic components of the frame

We have to think about the framework components:

1) requires a configuration file management

2) a test script code and business logic separated

3) reports and log file output

4) a custom library package

5) management, script execution mode

6) the introduction of third-party plug-ins

7) Continuous Integration

Explanation:

      We need a configuration file to control some of the environmental information, switches, configuration file can be txt / xml / yaml / properties / ini, use more general .properties in JAVA, the article is Python series, I might choose the ini file.

       Business logic code and test scripts separation, as we have just started to learn Selenium as demo code and scripts in a class file. We do not use code refactoring, reuse. After separation of code and use case documents, clearer, than to develop scripts for easy debugging.

       Reports and log file output, the number of case you perform, how case results, which are required to report to show the general use of third-party plug-ins to achieve this, a lot of reporting formats are html, simple, clear style. Log output is also very important, if an error occurs, the script fails, locate the position of a problem quickly through the log.

      User-defined library, this is well understood, many of us need to repeat the function call, so we write a public method, put under kits, each time convenient to call, for example, the browser engine class and basepage.py package.

      Manage and execute scripts manner, for example, in unit testing framework Python unittest usage is very high.

      Third-party plug-ins, sometimes, some of the features we need to use third-party plug-ins, better able to achieve, for example AutoIT, to achieve file upload and download. As well as the use of third-party plug-ins to generate reports based on test reports in html format.

      Continuous integration, git, svn, ant, maven, jenkins, we will integrate it into jenkins, achieve continuous integration, a key to execute test scripts.

According to the above features introduced, I generally use the following diagram to describe a simple automated test framework, part of which might contain.

 

       Brief framework on here, some people think the framework is too complicated, nothing more than a collection of software frameworks, to achieve a specific purpose. Here we have the picture out of the frame, is a simple automated test framework, do not laugh, this is indeed a simple but contains the necessary design examples automated testing framework components, if you learn the design ideas and thoughts, then you It has reached the level of the second phase of automated testing: automated testing framework and the ability to maintain the frame can be simply designed.

 


Original link: https: //blog.csdn.net/u011541946/article/details/70224870

Guess you like

Origin www.cnblogs.com/zhaocbbb/p/12664368.html