当前位置:网站首页>Automated testing framework

Automated testing framework

2022-07-07 11:31:00 The elegance of testing

A key component of any successful automated test process is the test automation framework . Reduce maintenance costs , Improve the efficiency of testing work and the return on investment of quality assurance team ROI It's one of the main advantages of optimizing agile processes .

 Automated testing framework

For the following reasons , Automation is essential to an efficient testing process :

  1. Improve test efficiency
  2. Reduce maintenance costs
  3. As little human intervention as possible
  4. Try to test as much as possible
  5. Code reusability

Managers in the field of software development have a broad understanding of how implementing automation frameworks can benefit their business , And many people in this field have begun to often use the term framework , It is the key to the success of a software automation project .

But for many people , The problem is still there :

  1. What are test automation frameworks and automation scripts ?
  2. How test frameworks work together ?
  3. What advantages can testing framework bring to testing ?

One 、 Define test automation

In any industry , Automation is often interpreted as automatic process flow , And these processes require little human intervention . In the software industry , Test automation means using licensed versions or open source automation tools to perform various tests on software applications . In technical terms , The test automation framework is a customized set of interactive components , They help to perform scripted tests and fully report test results .

Two 、 Different types of frameworks

According to the way the team creates the framework and the goal automation requirements , It can be divided into different test framework types .

3、 ... and 、 A tool centric framework

Both commercial automation tools and open source automation tools have their own system infrastructure , Help generate reports in their test environment , Test suite and distributed test execution . An example is Selenium Automation framework , The framework has the main components WebDriver, The component acts as a Web Browser plug-ins , In the Web Control and operate the application in the browser DOM Model .Selenium The test automation framework also has a useful coding library and record playback tools .

Another important tool specific framework example is Serenity, It revolves around Selenium Webdriver Build and be an accelerator . under these circumstances , In order to speed up the test automation implementation process , Communities bring specific components together .

When it comes to things like QTP、RF And so on , Sometimes it's hard to make decisions , Because they all simulate user operations 、 Reports and scripts IDE Our infrastructure is pre built , There is no obvious difference or comparative advantage between them , How to choose also needs to consider the current actual situation .

1. Project oriented framework

This kind of automation framework is customized , To automate specific application projects . The project specific framework supports certain target application test automation requirements , And driven by components built from open source libraries . It creates a test friendly environment , To run some basic functions . These include deploying developed applications , Run the application , Execute test case , Direct test result reporting and packaging program control for simplified coding . A project specific framework should also have a component , To support in different OS And a variety of cloud environments on the browser . This kind of testing framework is common in cross browser testing .

2. Keyword driven framework

Keyword Driven frameworks are those designed to attract developers and testers with less code . They may be tool specific or project specific frameworks , Enable unskilled employees to write and understand automated scripts . Keyword set for encoding ( for example Login,NavigateToPage,Click,TypeText) Is installed as a keyword repository in the code base . The spreadsheet that the tester scripts based on the keyword reference provided will be passed to the keyword interpreter , And perform tests .

Four 、 The main components of the automation framework

Most powerful and excellent test automation frameworks ( Whether it's open source or commercial ), You have to consider including some of the components that make up its core .

The main components of an ideal test automation framework based on various tests are :

1. Test library

unit testing

Unit test libraries can be used to shape an important part of any test automation framework . It needs to be used for :

Annotate... In a specific form ( Such as @Test etc. ) Define the test method used

(1) Perform assertions that affect the final result of automated testing

(2) Run straightforward tests

(3) Whether you are from command、IDE、 Special tools or CI( Continuous integration ) System running test , To ensure that unit tests run in an intuitive way , Unit test library can provide test running program .

Integration and end to end testing

When performing integration and end-to-end test automation , It is generally recommended to ensure that the functions provided by the existing test library are stable and healthy . By the application's UI Driven API Level testing requires components that make it easier to interact with the application under test , Because it eliminates unnecessary coding burden . So you can focus more on more aspects of your work , Instead of coding the content :

Connect to the app

Send a request

Receiving response

Behavior driven development

Dedicated to BDD The library of is aimed at behavioral norms , Create executable specifications in the form of executable code . ad locum , Different functions and expected behavior scenarios can be converted into code , Although they don't work the way test tools interact directly with the application under test . They can be used as BDD Process support , To create real-time documents consistent with the scope and intent of automated testing .

2. Test data management

In the process of software test automation and test creation , The biggest challenge is to use the test data management system . As the number of automated tests increases , There is always the problem of ensuring that some of the test data required to perform a particular test is available or created . The challenge is , There is no foolproof solution to this problem , This requires a reliable test data management method to make the automation work successful .

One way to solve this problem is to have the right moco Tools , To simplify the data , Clear and easy to digest .

5、 ... and 、 virtualization

Virtualization in software testing

While exploring and researching many ideas for automated testing , The following conditions may be encountered :

Want to isolate the module from the connectivity components that you normally experience in unit testing

We need to deal with the common tedious and critical dependencies in application integration or end-to-end testing

under these circumstances , Testers will feel like creating a model that reflects the behavior patterns of the connected components mock and Stubs And virtualization is crucial . It's a huge task to deal with this , It is very important to choose useful virtualization tools in the process of developing automated testing framework .

6、 ... and 、 The general mechanism of the implementation mode

In addition to the automation framework components discussed above , There are also some useful mechanisms to help create , Use and maintain automated testing , for example :

Wrapper method : Use Selenium Webdriver When the component , Creating custom wrappers makes error handling easier , Can handle timeouts better , Exception handling and fault reporting .

Abstract method : Abstract mechanism means improving readability and hiding redundant implementation details . for example , Creating Selenium WebDriver The purpose of using page objects in the test is to expose user input operations on the web page , This includes entering credentials or clicking somewhere on the page . The goal is to achieve advanced testing methods by transcending or bypassing the requirements of exploring specific elements of a page . This method is suitable for many similar applications and automated testing .

1. Test result report

When selecting a library or mechanism to report test results to an automation framework , The main focus should be on the target audience who will read or view the generated report . In this regard , We can make a few points for attention :

Such as JUnit and TestNG The reports generated by unit testing frameworks such as are mainly for CI( Continuous integration ) Receiving systems like servers , These systems will eventually interpret it and use it in other software XML Format .

When we look for tools that have the reporting function of the language that is most accessible to humans , Consider using business tools that are compatible with the unit testing framework , For example Junit Of UFT Pro、NUnit and TestNG.

Another option is to use things like ExtentReports Third party libraries like that , The library creates test result reports in a format that is easy for humans to understand , Including through pie chart , A visual interpretation of a figure or image .

2.CI platform

In order to be faster , More unified application testing , The continuous integration platform can help teams build software and run various tests for new versions on a regular basis . When developing and deploying new features and updating existing ones , This approach gives developers and stakeholders the opportunity to get regular feedback and faster response on application quality .

3. Source control

As with manual testing , Automated testing also involves writing and storing source code and test case versions . Every development company has a select source code and version control system to save and protect the source code . Automatic testing needs perfect source code management system , The system will come in handy when dealing with production code . Some typical source code management examples that any developer will give are Git,Mercurial,Subversion and TFS.

4. Create a dependency Manager

The main purpose of the dependency manager is to assist in the process of collecting and managing existing dependencies and libraries used in the functionality of automated software solutions . Some tools ( for example Maven and Gradle) It also acts as a dependency manager and helps build tools . Build tools are designed to help you develop automation software from source code and support libraries , And run the test . Other dependent tools include Ant,NPM and NuGet.

7、 ... and 、 The process of building and implementing the framework

There are several ways to plan ways to implement automated testing solutions .

Explore the practical applicability of automation from the perspective of users . Check whether it is like PPT Avoid as mentioned in PPT Best practices for Automation ), Test it on the technology in use .

Pay close attention to the technology of the system under test , In order to find the most suitable test automation tool that can perfectly simulate user behavior , This is crucial .

A phase based approach is recommended , Each of these phases has a priority to deliver automated test scripts , At the same time, the framework function is added to realize the expected script execution .

Before starting Software Test Automation , To ensure that automated decisions are executed correctly , We must first calculate and estimate the return on investment after implementation , Time to run the manual regression or smoke test and the run cycle of each version .

8、 ... and 、 The inevitable demand for test automation framework

Describe and explain how the software test automation framework and scripts improve the test process , That doesn't always mean it can work successfully for all those who are committed to automation . however , There is no denying that , If the test automation framework is planned in detail and executed correctly , It will bring the following benefits to software development and testing companies :

Less time , More revenue : Building any viable test automation framework and automation scripts is to minimize the time required to write and run tests , So as to provide the maximum output in a short time . With an excellent automation framework , You can get rid of the usual worries , For example, synchronization , Error management , Local configuration , Report generation , Explanation and many other challenges .

Reusable and readable automation code : When using the code mentioned in the existing component library , It will remain readable and reusable for some time to come , And all the related tasks ( As reported , Synchronization and troubleshooting ) Will become more accessible .

resource optimization : The efficiency gained from creating automated tests depends on the flexibility of their adoption . If the automation system is flexible , And compatible with different teams working on different components , It can provide huge benefits in resource optimization and knowledge sharing .

Nine 、 Conclusion

In today's fast pace , In the brutal software development ecosystem , Automated testing and scripting maintain the speed of the software testing cycle , It plays an indispensable role in efficiency and clarity . As automated testing technology is instilled into software testing , Organizations considering the adoption of a test automation framework must go deep into the design of the final framework , Then we can get involved in this field . The well-designed framework design and the component strategy to be used will lay the foundation for the final test automation framework .

Build test automation framework mature , mature , The best way to have a flexible architecture is to start small , Frequent testing and review , Then step up to build the extended version . When implementing the automated testing framework , One recommended approach is to find a tool that can quickly and easily adapt to processes and workflows . Looking for a tool that is not only flexible but also supports multiple applications and languages , Because it will make QA Teams can contribute effectively regardless of their background or skills .

Last : It can be in the official account : Sad spicy bar ! Get one by yourself 216 Page software testing engineer interview guide document information 【 Free of charge 】. And the corresponding video learning tutorial is free to share !, It includes basic knowledge 、Linux necessary 、Shell、 The principles of the Internet 、Mysql database 、 Special topic of bag capturing tools 、 Interface testing tool 、 Test advanced -Python Programming 、Web automated testing 、APP automated testing 、 Interface automation testing 、 Testing advanced continuous integration 、 Test architecture development test framework 、 Performance testing 、 Safety test, etc. .

I recommend one 【Python Automated test communication group :746506216】, We can discuss communication software testing together , Learn software testing together 、 Interview and other aspects of software testing , Help you advance quickly Python automated testing / Test Development , On the road to high pay .

Friends who like software testing , If my blog helps you 、 If you like my blog content , please “ give the thumbs-up ” “ Comment on ” “ Collection ” One Key triple connection !

原网站

版权声明
本文为[The elegance of testing]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070907105732.html