当前位置:网站首页>Answer questions! This article explains the automated testing framework in software testing from beginning to end

Answer questions! This article explains the automated testing framework in software testing from beginning to end

2022-06-24 05:18:00 Code start



Answer your questions about the framework



Preface

   Before we design the automation framework, let's look at two problems , What is an automation framework , What principles should we pay attention to when designing , Then what to do ? This article will focus on a web Terminal UI Take the design of automatic test framework as an example

What is automated testing framework



What is a framework
   In particular, it refers to a constrained supporting structure designed to solve an open problem . In this structure, it can be extended according to specific problems 、 Insert more components , So as to build a complete solution to the problem more quickly and conveniently . A framework is a reusable design of a whole or part of a system , It represents a group of abstract components and methods of interaction between component instances . In other words, the framework itself does not solve specific problems , It solves problems by extending various components or tools , And it can easily add or modify the functions of some components .



What is automated testing framework
   What is automated testing framework , If we split it up , In fact, there are three aspects , automation 、 test 、 frame , What is a frame? It says , And he can perform tests , And it's automated , Therefore, the main function of each component of the framework revolves around how to automate and execute tests .
️ To reassure ! This article explains the automation testing framework in software testing from beginning to end ️_python
   Here, the functions of the framework can be called modules , Let's take a look at the modules we need , Need a basic module , Mainly how to realize script writing , Management module , The main behavior is continuous integration , Timing execution 、case management , Statistics module , Mainly sending test reports , Statistical analysis . To sum up, the definition of automated testing framework is : Put some functions or tools used in the process of automated testing , Sub assemble into various modules , It includes the basic modules of how to write automatic scripts and hierarchical functions , Continuous integration 、 Timing task management module , Send test report 、 Statistical module for statistical analysis of test results, etc , These modules form a set of reusable skeleton



Design principles of automated test framework


  • generality : It can be used in a variety of systems and platforms
  • Maintainability : Can put our data 、 Use cases 、 The implementation of the framework is maintained independently , In the process of achieving perfection , Quickly define the maintenance point , Without affecting other functions of the framework
  • Timing processing : Be able to execute... At a specified time
  • Continuous integration : When the tested program and test code are updated, it can be executed automatically
  • debugging : Debuggable line strength
  • test result : Test report 、 Statistical analysis of test data

Frame design idea

   The main body of the automated test framework can be divided into two parts , One is the internal framework , One is the external framework , The internal framework is our own test framework code , The external framework is to put aside the core code of our implementation , Some third-party tools used in the design of automatic test framework .


  • The external framework
  • Mainly refers to webdriver At the core , Supplemented by external third placement frame and tools . For continuous integration 、 Automatic deployment 、 Script execution 、 The remote invocation 、 Report optimization 、 Functional frameworks such as mail sending Guide , Some peripheral components that implement the design principles of the automation framework .
  • The internal framework
  • That is, the layered framework , The purpose is to better optimize and manage test cases , More convenient data processing 、 Elements 、 Script maintenance and faster creation of new scripts

Design idea of automatic test framework

  • General external framework to realize logic

  • maven perhaps tox- Automatic compilation , perform TestNG or junit, Integrated mail sending, etc
  • TestNG or Junit、pytest, call webdriver Or the method of sending the request , Execute automated test cases , Standardize automated test scripts
  • selenium Script or interface use case script
  • reportNG perhaps allure Report optimization template
  • main Automatically html Email notification or Jenkins Send E-mail

The internal framework


  • Layer frame - That is, code structure optimization , According to the specific business and needs, it can be roughly divided into the following layers , Sometimes you don't need all the levels below , Just choose the one suitable for your business test .
  • TestCase layer : Executed use case script
  • Task layer : Public business sub packaging , Is not needed for other projects , Only relevant to the current project , Such as public login 、 Search and other businesses
    -utils layer : Business independent methods , For example, data-driven - That is, read and write data files 、 Browser operation 、 Element positioning method, etc
  • page Layer or po layer : Page layer , The page layer mainly maintains all elements of a page , The operation of the page 、 Operation of elements and interaction with other pages , Business is actually an element to another element or a page to another page , This is the sum of task The layers are a little repetitive. Generally, one is enough .
  • element layer : Maintenance of common elements or components , Or custom component encapsulation
  • data layer : data storage
  • properties layer : The configuration file 、 Global variables
  • ️ To reassure ! This article explains the automation testing framework in software testing from beginning to end ️_ Continuous integration _02
    If you want to learn to communicate , Join us soon :893694563, Group learning software testing , Share technology and learning materials , Grow and learn with you . It would be : Start on the yard


原网站

版权声明
本文为[Code start]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211626267617.html

随机推荐