[go: up one dir, main page]

CN119537213A - A method for interface automation testing based on RPA - Google Patents

A method for interface automation testing based on RPA Download PDF

Info

Publication number
CN119537213A
CN119537213A CN202411497943.XA CN202411497943A CN119537213A CN 119537213 A CN119537213 A CN 119537213A CN 202411497943 A CN202411497943 A CN 202411497943A CN 119537213 A CN119537213 A CN 119537213A
Authority
CN
China
Prior art keywords
test
testing
rpa
code
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411497943.XA
Other languages
Chinese (zh)
Inventor
柴亚团
李燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Rongzhi Information Technology Co ltd
Wuxi Rongzhi Technology Co ltd
Original Assignee
Shanghai Rongzhi Information Technology Co ltd
Wuxi Rongzhi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Rongzhi Information Technology Co ltd, Wuxi Rongzhi Technology Co ltd filed Critical Shanghai Rongzhi Information Technology Co ltd
Priority to CN202411497943.XA priority Critical patent/CN119537213A/en
Publication of CN119537213A publication Critical patent/CN119537213A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明公开了一种基于RPA进行接口自动化测试的方法,包括以下步骤:制定测试计划;搭建测试框架;编写测试脚本;集成测试;执行测试脚本;测试结果分析;维护测试脚本。本发明基于RPA工具,通过图形化界面和预定义的操作,使得测试人员无需编写任何代码即可创建自动化测试脚本,测试人员只需通过简单的拖拽、点击和配置,就能定义复杂的测试流程;RPA工具通常设计得直观易用,即使是没有任何编程经验的测试人员也能快速上手,通过简单的培训和练习,测试人员就能掌握自动化测试的基本技能;RPA对于需要验证的登录系统具有独特的验证方式,可以进行有针对性的系统验证,便于登录接口获取token。

The present invention discloses a method for performing interface automation testing based on RPA, comprising the following steps: formulating a test plan; building a test framework; writing a test script; integrating the test; executing the test script; analyzing the test results; and maintaining the test script. The present invention is based on the RPA tool, and through a graphical interface and predefined operations, the tester can create an automated test script without writing any code. The tester can define a complex test process by simply dragging, clicking, and configuring. The RPA tool is usually designed to be intuitive and easy to use, so that even testers without any programming experience can quickly get started. Through simple training and practice, the tester can master the basic skills of automated testing. RPA has a unique verification method for the login system that needs to be verified, and can perform targeted system verification, which is convenient for the login interface to obtain a token.

Description

Method for automatically testing interfaces based on RPA
Technical Field
The invention belongs to the technical field of automatic testing, and particularly relates to a method for automatically testing interfaces based on RPA.
Background
Automated testing is a process of converting human-driven testing behavior into machine execution, automatically executing predefined test cases using software tools or scripts to check whether the functions, capabilities, user interfaces, etc. of a software application meet an expected one, i.e., simulating manual testing steps automatically tests software by executing test scripts programmed in a programming language, including all test phases, which are cross-platform compatible and process independent.
In practice, it is strictly said that automated testing is in a broad and narrow sense. The broad sense is test automation, and it is emphasized that the whole test process is completed by a computer system, and the scope is wider. In a narrow sense, we refer to an automated test, mainly to the fact that a certain test task is automatically performed by a certain automated tool, and the processing scope is relatively small.
The current automatic test method comprises making test plan, analyzing test requirement, designing test case, setting up test environment, writing test script, executing test and analyzing result, maintaining and optimizing test script
However, the prior art has some problems of 1, high initial investment and maintenance cost, that is, a great deal of time and resources are required for developing an automatic test framework, tools and test scripts, and that the test scripts are required to be updated and maintained continuously along with the update and change of a software system, which also increases additional cost.
2. The technical threshold is high, the requirements on personnel skills are strict, and automatic testing requires that the testers have certain programming and script writing capabilities and deep knowledge of the use of the testing framework and tools. This requires that at least some of the members of the test team have a high level of skill. When the skill of the tester is insufficient, the quality of the test script is possibly low, thereby affecting the accuracy and reliability of the test result
3. The strict dependence on the test environment is that the consistency requirement of the automatic test on the test environment is high, and any environmental difference can cause test failure. Accordingly, a great deal of effort is required in configuring and maintaining the test environment. When a software operating environment changes (e.g., operating system upgrades, browser updates, etc.), the automated test scripts may need to be modified and adapted accordingly.
4. The system which can be logged in only by the verification code or the short message verification code needs special treatment.
Therefore we propose a method for automated testing of interfaces based on RPA.
Disclosure of Invention
Aiming at the problems existing in the prior art, the invention aims to provide a method for automatically testing interfaces based on RPA, which can complete the automatic flow design by only opening the RPA and dragging out nodes and configuring the nodes through automatically testing on the basis of the RPA, and has relatively simple and convenient operation.
The invention is realized in such a way that a method for carrying out interface automation test based on RPA is based on RPA, and comprises the following steps:
S1, making a test plan, namely analyzing the requirements of interface tests, determining the targets and the ranges of the tests, identifying test resources, determining test types and methods, making test strategies and determining quality standards;
s2, building a test framework, namely building an environment suitable for interface test, wherein the environment comprises configuration hardware equipment, installation of an operating system and installation of a development tool;
S3, compiling a test script, namely firstly creating an automatic test flow by utilizing an RPA design tool, and then compiling the automatic script by utilizing an RPA development tool according to the designed test flow, wherein the script is used for simulating user operation, sending a request and receiving a response;
S4, integrated testing, namely combining an automatic testing process with a Continuous Integration (CI) process and a Continuous Deployment (CD) process to ensure that codes can automatically execute testing and timely find problems;
S5, executing a test script, namely running the written test script and performing automatic test;
s6, analyzing test results, namely analyzing test execution results, verifying whether the functions of the software accord with expectations or not, and simultaneously evaluating the effect of automatic test;
And S7, maintaining and updating the test script to ensure the continuity and effectiveness of the test.
Optionally, the hardware devices in the S2 building test framework comprise a server, a client device and a network device,
The development tools include automated, performance, and security test tools to support different types of testing.
Optionally, the step S3 of writing the test script is realized based on a script language of RPA, and the automatic test procedure creation comprises the steps of starting an RPA design tool, creating a project procedure, dragging out nodes and configuration information and conditions;
The automated testing includes interface automated testing and UI automated testing.
Optionally, the step of automatically testing the interface includes:
s31, organizing and managing parameters and expected results by using an interface test platform and form data;
S32, performing system login to obtain token identity verification, which is based on an information verification mode of RPA;
s33, acquiring parameters of the interface, and splicing the parameters into the interface;
s34, inquiring whether to configure SQL database inquiry language, and judging whether to use database configuration nodes to connect the database;
S35, configuring HTTP request nodes, assembling the acquired parameter information, and carrying out test interface requests;
s36, acquiring a field which is configured in the form data and participates in the assertion, extracting a field value to be asserted, comparing an expected result with an actual result, and filling the actual value of the test result into the form data;
the parameters and expected results include the address of the access API, the type of interface request, the entry, the database query result sql, the field name of the assertion, the expected result and whether testing is required
The UI automation test includes:
S37, acquiring a browser to be tested, and opening a corresponding browser by using a node;
s38, using navigation to a website to open the website;
s39, acquiring verification and logging in;
s310, acquiring actual values of the display values and the attribute values of the webpage elements, and comparing expected values.
Optionally, the S4 integrated test includes version control, automatic construction, trigger mechanism, execution test, result report, and continuous deployment;
the version control ensures that all test scripts and related resources are stored in the version control system;
Setting a CI server for automatically constructing an interface automatic test project;
The trigger mechanism is used for determining the time for triggering construction and testing of the CI server through a polling mechanism;
executing an automatic test script on the CI server;
the result report is that a detailed report is generated for the tested result;
The continuous deployment is to deploy the codes passing the test into the production environment so as to shorten the release period and improve the delivery speed.
Optionally, the automatic construction includes the steps of:
Step one, selecting corresponding construction tools according to the language and the framework of the project;
Step two, defining construction tasks and processes;
Integrating the construction process into a Continuous Integration (CI) tool;
step four, setting codes to be submitted to specific events in a code warehouse for triggering automatic construction;
Step five, after the triggering condition is met, the CI tool automatically detects codes, executes the construction script and generates corresponding output;
Step six, an automatic test is included in the construction process so as to ensure the code quality;
And step seven, after the construction is successful and all tests are passed, the test environment is further automatically deployed.
Optionally, in the step five automatic code detection process, the Jenkins automation server divides the construction process into a plurality of stages through a parallel construction mechanism, and the stages are respectively executed in parallel on a plurality of computers under the control of the server;
the automatic code detection in the fifth step and the automatic detection in the sixth step comprise incremental construction, wherein the incremental construction comprises the following steps:
Detecting a file which is changed from the last construction through a version control system;
when compiling the code again, only compiling the source code which is changed;
Running unit tests and integrated tests associated with the change code to ensure that the change does not introduce new errors;
and deploying the compiled file and the changed configuration into a test environment.
Optionally, the step of analyzing the S6 detection result includes:
After the test execution is completed, collecting all relevant test results including the execution condition (passing or failing), error information and screenshot of the test case;
Identifying failed test cases and analyzing failure reasons;
checking whether any abnormal conditions exist for the passed test cases;
Evaluating the test coverage rate, checking whether all the functional points are detected, and detecting whether missing test scenes exist or not, so as to judge whether corresponding test cases need to be supplemented or not;
According to the analysis result, corresponding improvement measures are formulated, including software defect repair, test case optimization and test strategy adjustment;
After implementing the improvement measure, re-executing the test case to verify whether the problem is solved;
The whole test process and results are consolidated into reports for knowing the overall condition and quality level of the test.
Optionally, the test coverage includes a demand coverage and a code coverage;
the evaluation of the requirement coverage rate is used for analyzing the corresponding relation between the requirement and the test case, so that the requirement is ensured to be completely converted into the test case and executed;
and the evaluation of the code coverage rate adopts a Git version control system, and a coverage rate report with incremental information is generated by combining coverage rate information.
Compared with the prior art, the invention has the beneficial effects that:
1. The RPA tool creates an automatic test script through a graphical interface and predefined operation without writing any code. The tester can define a complex test flow simply by dragging, clicking and configuring.
RPA tools are often designed to be intuitive and easy to use, and even a tester without any programming experience can quickly get his hands on. Through simple training and practice, the testers can master the basic skills of the automatic test.
2. The labor cost is reduced, and the automatic test can replace part of manual test work, so that the dependence on a large number of test staff is reduced. Enterprises can concentrate limited test resources on more complex and challenging test tasks, improving test efficiency and quality.
The test period is shortened, and the RPA tool can quickly construct and execute the automatic test script, so that the test period is greatly shortened. This helps the enterprise to release the product faster, preempt the market.
The automatic test reduces the possibility of human errors and improves the accuracy and reliability of the test. Meanwhile, through automatic error positioning and reporting, a tester can find out the problem and repair the problem more quickly, so that reworking time and cost are reduced.
3. Maintainability of scripts RPA tools typically provide script editing and management functionality so that testers can easily modify and maintain automated test scripts. When the test requirement changes, the tester only needs to simply adjust the script without writing a new script from the beginning, and the integration and expansibility that the RPA tool can be integrated with other test tools and systems generally to form a complete test solution. Meanwhile, with the development of technology and the change of test requirements, the RPA tool can be expanded and upgraded to meet new test requirements.
4. The RPA has a unique verification mode for a login system to be verified, can perform targeted system verification, and is convenient for a login interface to acquire a token.
Other features of the present invention and its advantages will become apparent from the following detailed description of exemplary embodiments of the invention, which proceeds with reference to the accompanying drawings.
Drawings
FIG. 1 is a schematic diagram of a method architecture provided by the present invention;
FIG. 2 is a schematic diagram of an automated test algorithm provided by the present invention;
Fig. 3 is a schematic flow chart of a verification code picture system provided by the invention.
Detailed Description
For a further understanding of the invention, its features and advantages, reference is now made to the following examples, which are illustrated in the accompanying drawings.
As shown in fig. 1 to 3, a method for performing an automated interface test based on RPA according to an embodiment of the present invention includes the following steps:
S1, making a test plan, namely analyzing the requirements of interface tests, determining the targets and the ranges of the tests, identifying test resources, determining test types and methods, making test strategies and determining quality standards;
s2, building a test framework, namely building an environment suitable for interface test, wherein the environment comprises configuration hardware equipment, installation of an operating system and installation of a development tool;
S3, compiling a test script, namely firstly creating an automatic test flow by utilizing an RPA design tool, and then compiling the automatic script by utilizing an RPA development tool according to the designed test flow, wherein the script is used for simulating user operation, sending a request and receiving a response;
S4, integrated testing, namely combining an automatic testing process with a Continuous Integration (CI) process and a Continuous Deployment (CD) process to ensure that codes can automatically execute testing and timely find problems;
S5, executing a test script, namely running the written test script and performing automatic test;
s6, analyzing test results, namely analyzing test execution results, verifying whether the functions of the software accord with expectations or not, and simultaneously evaluating the effect of automatic test;
And S7, maintaining and updating the test script to ensure the continuity and effectiveness of the test.
It should be noted that, at present, enterprises perform automated testing, and first, high initial investment and maintenance costs are required:
development of automated test frameworks, tools, and test scripts requires significant time and resources. For some small projects or rapidly iterated projects, automated testing may not be the most economical option.
As software systems are updated and changed, test scripts need to be continually updated and maintained, which also adds additional costs.
Secondly, the technical threshold is high, and the requirements on personnel skills are strict:
automated testing requires a tester to have certain programming and scripting capabilities, as well as in-depth knowledge of the test framework and tool usage. This requires that at least some of the members of the test team have a high level of skill.
When the skill of the tester is insufficient, the quality of the test script is possibly low, thereby affecting the accuracy and reliability of the test result
Third, strict dependence on test environment:
automated testing requires high consistency of the test environment, and any environmental differences may result in test failures. Accordingly, a great deal of effort is required in configuring and maintaining the test environment.
When a software operating environment changes (e.g., operating system upgrades, browser updates, etc.), the automated test scripts may need to be modified and adapted accordingly.
Fourth, special processing is needed for the system which can only log in with the verification code or the short message verification code.
Common processing methods are 1) requiring the development team to provide a version of the removal verification code or to set a generic verification code in the code. 2) Some third party verification code identification tools are used.
Further, automated testing essentially creates test scripts to test the code written by development, which does not cost significantly less than developing a product. The use of RPA can greatly shorten development time.
Furthermore, after the automatic test script is developed by the traditional automatic test, a professional automatic test engineer is required to maintain in a later operation stage, when an interface or an element is changed, the script is required to be changed, and meanwhile, the robustness of the script is required to be continuously improved. In the case of RPA, only a general procedure is required to be designed, and only the Xpath of an element needs to be picked up again by using the element picking function in the following step.
Specifically, the hardware devices in the S2 set up test framework comprise a server, a client device and a network device,
The development tools include automated, performance, and security test tools to support different types of testing.
Furthermore, the hardware requirements for building the test framework are mainly used for ensuring the stability and reliability of the test environment and simulating the real user use environment. The performance requirements are that the hardware resources such as servers, computers or mobile devices need to have enough processing capacity, memory capacity and storage space to run the test framework and execute the test cases, the compatibility requirements are that various operating systems, browser versions and mobile device models may be required in order to simulate the use environments of different users, and the network requirements are that network bandwidth and connection stability are critical to performing automated tests and accessing network resources (such as API tests).
Further, the software requirements include test tools for selecting proper test frames and tools, such as JUnit, selenium, appium, according to test types (such as unit test, integration test, functional test, etc.), development tools for compiling and maintaining test scripts, integrated Development Environments (IDE), compilers, code editors, etc., management tools for organizing test cases, tracking test results, and coordinating team cooperation, and auxiliary tools for hardware test, which may require specific instruments and equipment, such as oscilloscopes, spectrometers, etc.
In general, by meeting these hardware and software requirements, an effective test framework can be established that helps to improve test efficiency, discover potential problems, and ensure software quality.
The automatic test algorithm provided by the invention is shown in fig. 2 and 3, wherein the step S3 of writing test scripts is realized based on the script language of RPA, and the step S of creating the automatic test flow comprises the steps of starting an RPA design tool, creating a project flow, dragging out nodes, configuration information and conditions;
The automated testing includes interface automated testing and UI automated testing.
Further, the automatic test of the interface is mainly aimed at testing the back end or service interface of the system. Such testing methods typically do not care about the user interface, but rather verify that the interfaces between the various modules of the system are functioning properly. The interface test generally adopts a gray box test method, i.e. a test case is designed to call an API, and whether a request and a response meet expectations is checked, and the interface test has higher stability and efficiency because data and functions are focused on. Once the interface is well defined, the test case can be repeatedly executed multiple times without frequent modification;
Unlike interface automation testing, UI automation testing is closer to the behavior of a real user. It verifies whether the function of the application is operating properly by simulating the user's operation on the software interface. UI testing typically requires the use of tools such as Selenium to drive a browser or other user interface and to check that the results of the various user interactions are correct.
The interface automatic test step comprises the following steps:
s31, organizing and managing parameters and expected results by using an interface test platform and form data;
S32, performing system login to obtain token identity verification, which is based on an information verification mode of RPA;
s33, acquiring parameters of the interface, and splicing the parameters into the interface;
s34, inquiring whether to configure SQL database inquiry language, and judging whether to use database configuration nodes to connect the database;
S35, configuring HTTP request nodes, assembling the acquired parameter information, and carrying out test interface requests;
s36, acquiring a field which is configured in the form data and participates in the assertion, extracting a field value to be asserted, comparing an expected result with an actual result, and filling the actual value of the test result into the form data;
the parameters and expected results include the address of the access API, the type of interface request, the entry, the database query result sql, the field name of the assertion, the expected result and whether testing is required
The UI automation test includes:
S37, acquiring a browser to be tested, and opening a corresponding browser by using a node;
s38, using navigation to a website to open the website;
s39, acquiring verification and logging in;
s310, acquiring actual values of the display values and the attribute values of the webpage elements, and comparing expected values.
By adopting the scheme, the automatic test flow based on the RPA is simple to operate, the automatic flow design can be completed by only opening the RPA and pulling out the node and configuring, and the RPA has the scheme aiming at the verification system:
Aiming at the system of the verification code picture, an HTTP interface request node is used, a correct url and a request mode are configured to request to a verification code picture interface, a response is received, the code of the verification code picture is extracted from the response, then the code/decode node is used for decoding the verification code picture into a picture, a verification code identification node is configured, a corresponding verification code type is selected according to the verification code type, the verification code picture obtained in the last step is taken as a node reference, and an identification result can be obtained after the node is executed. Then using an HTTP request interface to configure an account password and a verification code identification result, and requesting a login interface to acquire a token;
Aiming at the system of the short message verification code, rong Zhi RPA is provided with a short message box, and a user can realize the automatic receiving and processing of the verification code by only inserting a telephone card into the short message box. Firstly, configuring an HTTP interface request node in Rong Zhi RPA, requesting the node to send an authentication code interface by using the HTTP interface request node, then acquiring a short message authentication code by using a received short message authentication code, and then acquiring a token by using an HTTP request login interface;
And Rong Zhi RPA can set task execution mode, timing, cron expression and other operations.
In the invention, the S4 integrated test comprises version control, automatic construction, a trigger mechanism, execution test, result report and continuous deployment;
the version control ensures that all test scripts and related resources are stored in the version control system;
it should be noted that version control is a key practice to ensure that all test scripts and related resources are properly stored and managed, and by tracking all code changes and histories, version control ensures that teams can work cooperatively while reducing the risk of errors and data loss during development. For example, when a developer edits code, the version control system may take snapshots for the code files and permanently save the snapshots so that they may be recalled later as needed. The technology not only helps the team to effectively manage project progress, but also improves development efficiency and code quality.
Setting a CI server for automatically constructing an interface automatic test project;
the automatic construction is to set up the interface automatic test project of the automatic construction of CI server, guarantee to carry on the process of constructing, testing and disposing immediately after the code is submitted, the automatic construction is a part of Continuous Integration (CI), aim to realize constructing and testing immediately after the code is changed, in order to guarantee the stability and consistency of the software function.
The trigger mechanism is used for determining the time for triggering construction and testing of the CI server through a polling mechanism;
The Polling mechanism (Polling) is a processing mode for making CPU query every peripheral equipment in turn according to a certain period to see if there is data input or output requirement, and its working principle is that the CPU continuously inquires about every I/O equipment according to a certain sequence, if the equipment has requirement, it can make correspondent data processing, if not, the CPU can continuously query next equipment
Executing an automatic test script on the CI server;
the result report is that a detailed report is generated for the tested result;
The continuous deployment is to deploy the codes passing the test into the production environment so as to shorten the release period and improve the delivery speed.
The method and the system have the advantages that the integrated test can check interaction and integration among a plurality of modules, the interface problem and the integrated problem which cannot be revealed in the unit test are found, so that the test coverage rate is improved, more potential problems such as data transmission errors, functional conflicts, logic errors and the like are facilitated to be discovered, the stability and the reliability of the system are guaranteed, the overall software quality is improved, the integrated test can be carried out at the early stage of software development to find problems early, the problem of the later integration is avoided, the development efficiency is improved, the reworking cost is reduced, the unit test can be carried out before the integrated test, the effect of the integrated test is guaranteed, the code error correction cost is reduced, the integrated test has good flexibility, different strategies and implementation modes such as a large explosion method and an increment method (top-down, bottom-up and sandwich method) can be adopted, and the most suitable test strategy can be selected according to the specific conditions of projects.
In summary, the integrated test is not only helpful to improve the overall quality and development efficiency of the software, but also ensure the correctness and stability of the system. By effectively integrating the test, the risk and cost after the software is released can be reduced to the maximum extent
Specifically, the automatic construction includes the steps of:
Step one, selecting corresponding construction tools according to the language and the framework of the project;
Build Tools (Build Tools) are software Tools for automating the process of building a software project, which can automatically perform a series of Build tasks such as compiling code, running tests, packaging and distributing, play a vital role in modern software development, and from automated compiling, testing to optimized deployment, the Build Tools significantly improve development efficiency and software quality.
Step two, defining construction tasks and processes;
Integrating the construction process into a Continuous Integration (CI) tool;
step four, setting codes to be submitted to specific events in a code warehouse for triggering automatic construction;
Step five, after the triggering condition is met, the CI tool automatically detects codes, executes the construction script and generates corresponding output;
Step six, an automatic test is included in the construction process so as to ensure the code quality;
And step seven, after the construction is successful and all tests are passed, the test environment is further automatically deployed.
In the step five, in the automatic code flow detection, a Jenkins automation server divides a construction process into a plurality of stages through a parallel construction mechanism, and the stages are respectively executed in parallel on a plurality of computers under the control of the server;
Furthermore, the parallel construction can improve the calculation speed, namely the construction task is decomposed into a plurality of subtasks to be executed in parallel, and the calculation resources of the multi-core processor and the computers can be fully utilized, so that the construction time is obviously shortened, the calculation capability is improved, the construction task is more flexible and flexible, and the project requirements of different scales and complexity can be met.
Under the condition of the multi-core processor, CPU resources can be fully utilized by parallel construction, and the throughput and the resource utilization rate of the system are improved.
The parallel construction brings remarkable advantages to the software development process by improving the computing speed, expanding computing resources, improving the reliability and stability, improving the resource utilization rate, reducing the waiting time, optimizing the user experience, saving the memory consumption and reducing the response time.
Specifically, the automatic code detection in the fifth step and the automatic detection in the sixth step include incremental construction, and the incremental construction includes the following steps:
Detecting a file which is changed from the last construction through a version control system;
when compiling the code again, only compiling the source code which is changed;
Running unit tests and integrated tests associated with the change code to ensure that the change does not introduce new errors;
and deploying the compiled file and the changed configuration into a test environment.
Further, incremental construction is achieved by monitoring changes in the inputs. If the input is detected to be changed, the construction system can re-execute the related tasks, otherwise, the construction of the unchanged part can be skipped, and the result of the last construction is directly used.
This approach significantly improves the efficiency of construction, especially in large projects. In the incremental build process, each build task is divided into three parts, input, the task itself, and output. The input may be source code, configuration files, etc., and the output is typically a compiled class file or a packaged archive file.
Furthermore, incremental construction is not only applied to the compilation stage, but also to the testing and deployment stages. In a continuous integration and continuous deployment (CI/CD) process, incremental construction can quickly feed back construction and test results, helping development teams to discover and solve problems in time.
In general, incremental construction is an important construction optimization technology in modern software development, and by intelligently identifying and processing the change part, the construction efficiency is remarkably improved, the feedback period is shortened, and the requirement of rapid iterative development is met.
Specifically, the step of analyzing the S6 detection result includes:
After the test execution is completed, collecting all relevant test results including the execution condition (passing or failing), error information and screenshot of the test case;
Identifying failed test cases and analyzing failure reasons;
checking whether any abnormal conditions exist for the passed test cases;
Evaluating the test coverage rate, checking whether all the functional points are detected, and detecting whether missing test scenes exist or not, so as to judge whether corresponding test cases need to be supplemented or not;
According to the analysis result, corresponding improvement measures are formulated, including software defect repair, test case optimization and test strategy adjustment;
After implementing the improvement measure, re-executing the test case to verify whether the problem is solved;
The whole test process and results are consolidated into reports for knowing the overall condition and quality level of the test.
The test coverage rate comprises a demand coverage rate and a code coverage rate;
the evaluation of the requirement coverage rate is used for analyzing the corresponding relation between the requirement and the test case, so that the requirement is ensured to be completely converted into the test case and executed;
and the evaluation of the code coverage rate adopts a Git version control system, and a coverage rate report with incremental information is generated by combining coverage rate information.
Further, the test coverage rate is an important test technical index, and is used for balancing the coverage condition of the test case on the software codes, and the test coverage rate shows how many proportion of codes are actually operated and tested when the test case is executed. This helps identify which code regions have not yet been tested, or are under-tested, requiring additional test cases to cover, and by testing coverage we can evaluate the quality of the test cases as an indicator of risk of evaluating the project to ensure quality and reliability of the software.
In summary, the invention performs the automated interface test based on the RPA, first analyzes the test requirements according to the software requirement specification and the system test cases, determines which test scenes and test cases, and designs the automated test cases capable of covering all the requirement points;
maintaining url of the interface, interface request type, entering into the database, inquiring result sql, field name asserted, expected result, whether testing is needed or not, logging in the interface to obtain token,
If the interface is maintained by the interface automation platform mode, the interface is sequentially acquired by using HTTP request interface in the RPA, and variable processing related nodes are used for carrying out parameter entering processing and splicing;
Acquiring table data or whether query SQL is configured in an interface platform mode, if so, connecting a database by using a database configuration node, and executing the acquired SQL by using an execution SQL node;
then configuring HTTP request nodes, configuring acquired URLs, entries, token and the like, and requesting test interfaces;
Finally, the fields which are configured in the form data and participate in the assertion are obtained, the field values to be asserted are extracted from the response values requested by the previous interface by using the regular extraction nodes, the expected results and the actual results are compared by using the nodes such as variable comparison and the like, and the test results, the actual values and the like are written into the form data, so that the automatic flow design is completed. Compared with the existing automatic test, the automatic test device has the advantages that the automatic test device is more superior to common testers, the functions of script editing and management are provided, so that testers can conveniently modify and maintain the automatic test scripts, part of manual test work is replaced, and dependence on a large number of testers is reduced.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (9)

1.一种基于RPA进行接口自动化测试的方法,其特征在于:该方法基于RPA,包括以下步骤:1. A method for performing interface automation testing based on RPA, characterized in that: the method is based on RPA and includes the following steps: S1,制定测试计划:分析接口测试的需求、确定测试的目标和范围、识别测试资源、确定测试类型和方法、制定测试策略和确定质量标准;S1, develop a test plan: analyze the requirements for interface testing, determine the test objectives and scope, identify test resources, determine the test type and method, develop a test strategy, and determine quality standards; S2,搭建测试框架:搭建适用于接口测试的环境,包括配置硬件设备、安装操作系统和安装开发工具;S2, build a test framework: build an environment suitable for interface testing, including configuring hardware devices, installing operating systems, and installing development tools; S3,编写测试脚本:首先利用RPA的设计工具创建自动化测试流程,再根据设计的测试流程,使用RPA的开发工具编写自动化脚本,该脚本用于模拟用户操作、发送请求和接收响应;S3, write test scripts: First, use RPA's design tool to create an automated test process. Then, based on the designed test process, use RPA's development tool to write an automated script. The script is used to simulate user operations, send requests, and receive responses. S4,集成测试:将自动化测试流程与持续集成(CI)和持续部署(CD)流程相结合,用以确保代码可以自动执行测试,并及时发现问题;S4, Integration Testing: Combine the automated testing process with the continuous integration (CI) and continuous deployment (CD) processes to ensure that the code can be automatically tested and problems can be discovered in a timely manner; S5,执行测试脚本:运行编写好的测试脚本,进行自动化测试;S5, execute test script: run the written test script to perform automated testing; S6,测试结果分析:对测试执行的结果进行分析,验证软件的功能是否符合预期,同时评估自动化测试的效果;S6, test result analysis: analyze the test execution results to verify whether the software functions meet expectations and evaluate the effectiveness of automated testing; S7,维护测试脚本:对测试脚本进行维护和更新,用以确保测试的连续性和有效性。S7, Maintain test scripts: Maintain and update test scripts to ensure the continuity and effectiveness of testing. 2.根据权利要求1所述的一种基于RPA进行接口自动化测试的方法,其特征在于:所述S2搭建测试框架中硬件设备包括服务器、客户端设备和网络设备,2. According to the method for performing interface automation testing based on RPA in claim 1, it is characterized in that: the hardware devices in the test framework built in S2 include servers, client devices and network devices, 所述开发工具包括自动化测试工具、性能测试工具和安全测试工具,用以支持不同类型的测试。The development tools include automated testing tools, performance testing tools and security testing tools to support different types of testing. 3.根据权利要求1所述的一种基于RPA进行接口自动化测试的方法,其特征在于:所述S3编写测试脚本是基于RPA的脚本语言实现的,所述创建自动化测试流程包括:启动RPA设计工具、创建项目流程、拖出节点和配置信息与条件;3. According to claim 1, a method for performing interface automation testing based on RPA is characterized in that: the S3 test script writing is implemented based on the RPA scripting language, and the creation of the automated test process includes: starting the RPA design tool, creating a project process, dragging out nodes and configuring information and conditions; 所述自动化测试包括接口自动化测试和UI自动化测试。The automated testing includes interface automated testing and UI automated testing. 4.根据权利要求1所述的一种基于RPA进行接口自动化测试的方法,其特征在于:所述接口自动化测试步骤包括:4. According to a method for performing interface automation testing based on RPA according to claim 1, it is characterized in that: the interface automation testing step comprises: S31,使用接口测试平台和表格数据两种方式组织和管理参数和预期结果;S31, use interface test platform and tabular data to organize and manage parameters and expected results; S32,进行系统登录获取token身份验证,这基于RPA的信息验证方式;S32, log in to the system and obtain a token identity authentication, which is based on the information verification method of RPA; S33,以此获取接口的参数、并拼接入参;S33, thereby obtaining the parameters of the interface and splicing them into the parameters; S34,查询是否配置SQL数据库查询语言,判断是否使用数据库配置节点连接数据库;S34, query whether the SQL database query language is configured, and determine whether to use the database configuration node to connect to the database; S35,配置HTTP请求节点,装配获取的参数信息,进行测试接口请求;S35, configure the HTTP request node, assemble the acquired parameter information, and make a test interface request; S36,获取表格数据中配置的参与断言的字段,提取要断言的字段值,比较期望结果和实际结果,并将测试结果的实际值填入表格数据;S36, obtaining the fields involved in the assertion configured in the table data, extracting the field values to be asserted, comparing the expected results with the actual results, and filling the actual values of the test results into the table data; 所述参数和预期结果包含访问API的地址、接口请求类型、入参、数据库查询结果sql,断言的字段名称,期望结果和是否需要测试The parameters and expected results include the address of the API access, the interface request type, the input parameters, the database query result sql, the asserted field name, the expected result, and whether testing is required. 所述UI自动化测试包括:The UI automation test includes: S37,获取需要测试的浏览器,利用节点打开对应浏览器;S37, obtaining the browser to be tested, and using the node to open the corresponding browser; S38,使用导航到网址打开网址;S38, use navigation to open the URL; S39,获取验证,并进行登录;S39, obtain verification and log in; S310,获取网页元素显示值和属性值的实际值,并比较预期值。S310, obtaining actual values of the web page element display value and attribute value, and comparing them with expected values. 5.根据权利要求1所述的一种基于RPA进行接口自动化测试的方法,其特征在于:所述S4集成测试包括版本控制、自动构建、触发机制、执行测试、结果报告和持续部署;5. According to claim 1, a method for performing interface automation testing based on RPA is characterized in that: the S4 integration test includes version control, automatic construction, trigger mechanism, execution test, result reporting and continuous deployment; 所述版本控制为确保所有测试脚本和相关资源都存储在版本控制系统中;The version control is to ensure that all test scripts and related resources are stored in the version control system; 所述自动构建:设置CI服务器用以自动构建接口自动化测试项目;The automatic construction: setting up a CI server to automatically build an interface automation test project; 所述触发机制:通过轮询机制确定CI服务器触发构建和测试的时间;The trigger mechanism: determines the time when the CI server triggers the build and test through a polling mechanism; 所述执行测试:在CI服务器上执行自动化测试脚本;The test execution: executing the automated test script on the CI server; 所述结果报告:对测试完的结果生成详细的报告;The result report: generates a detailed report on the test results; 所述持续部署:将通过测试的代码部署到生产环境中,用以缩短发布周期并提高交付速度。Continuous deployment: Deploy tested code to the production environment to shorten the release cycle and increase delivery speed. 6.根据权利要求5所述的一种基于RPA进行接口自动化测试的方法,其特征在于:所述自动构建包括以下步骤:6. According to a method for performing interface automation testing based on RPA according to claim 5, it is characterized in that: the automatic construction comprises the following steps: 步骤一、根据项目的语言和框架选择相应的构建工具;Step 1: Select the corresponding build tool according to the language and framework of the project; 步骤二、定义构建任务和流程;Step 2: Define build tasks and processes; 步骤三、将构建过程集成到持续集成(CI)工具中;Step 3: Integrate the build process into the continuous integration (CI) tool; 步骤四、设置代码提交为代码仓库中的特定事件,用以触发自动构建;Step 4: Set code submission as a specific event in the code repository to trigger automatic building; 步骤五、满足触发条件后,CI工具自动检出代码、执行构建脚本,并生成相应的输出;Step 5: After the trigger conditions are met, the CI tool automatically detects the code, executes the build script, and generates the corresponding output; 步骤六、构建过程中包括了自动化测试,以确保代码质量;Step 6: Automated testing is included in the build process to ensure code quality; 步骤七、构建成功后并且通过全部测试,进一步自动部署到测试环境。Step 7: After the build is successful and passes all tests, it is automatically deployed to the test environment. 7.根据权利要求6所述的一种基于RPA进行接口自动化测试的方法,其特征在于:所述步骤五自动检出代码流程中,Jenkins自动化服务器通过并行构建机制将构建过程划分为多个阶段,并让这些阶段在服务器控制下的多个计算机上分别并行执行;7. According to claim 6, a method for performing interface automation testing based on RPA is characterized in that: in the automatic code detection process of step 5, the Jenkins automation server divides the construction process into multiple stages through a parallel construction mechanism, and allows these stages to be executed in parallel on multiple computers under the control of the server; 所述步骤五中自动检出代码和步骤六中自动化检测包含增量构建,所述增量构建包括以下步骤:The automatic code detection in step 5 and the automatic detection in step 6 include incremental construction, and the incremental construction includes the following steps: 通过版本控制系统检测自上次构建后发生变更的文件;Detect files that have changed since the last build through the version control system; 再次编译代码时只编译发生改变的源代码;When you compile the code again, only the changed source code is compiled; 运行与变更代码相关联的单元测试和集成测试,确保变更没有引入新的错误;Run unit tests and integration tests associated with the changed code to ensure that the changes did not introduce new errors; 将编译后的文件和变更的配置部署到测试环境中。Deploy the compiled files and changed configuration to the test environment. 8.根据权利要求1所述的一种基于RPA进行接口自动化测试的方法,其特征在于:所述S6检测结果分析的步骤包括:8. According to a method for performing interface automation testing based on RPA in claim 1, it is characterized in that: the step of analyzing the S6 detection results comprises: 测试执行完成后,收集所有相关的测试结果包括:测试用例的执行情况(通过或失败)、错误信息和截图;After the test execution is completed, collect all relevant test results including: test case execution status (pass or fail), error messages and screenshots; 识别失败的测试用例,并分析失败原因;Identify failed test cases and analyze the reasons for failure; 对于通过的测试用例,检查是否存在任何异常情况;For the passed test cases, check if there are any anomalies; 评估测试覆盖率,检查是否检测了所有的功能点,并检测是否有遗漏的测试场景,用以判断是否需要补充相应的测试用例;Evaluate test coverage, check whether all functional points have been tested, and detect whether there are any missing test scenarios to determine whether corresponding test cases need to be supplemented; 根据分析结果,制定相应的改进措施,包括修复软件缺陷、优化测试用例和调整测试策略;According to the analysis results, formulate corresponding improvement measures, including fixing software defects, optimizing test cases and adjusting test strategies; 在实施改进措施后,重新执行测试用例,以验证问题是否得到解决;After implementing the corrective actions, re-execute the test cases to verify whether the problem has been resolved; 将整个测试过程和结果整理成报告,用以了解测试的整体情况和质量水平。Organize the entire testing process and results into a report to understand the overall situation and quality level of the test. 9.根据权利要求8所述的一种基于RPA进行接口自动化测试的方法,其特征在于:所述测试覆盖率包括需求覆盖率和代码覆盖率;9. According to the method for performing interface automation testing based on RPA in claim 8, it is characterized in that: the test coverage includes requirement coverage and code coverage; 所述需求覆盖率的评估用以分析需求与测试用例之间的对应关系,确保需求全部转化为测试用例并执行;The evaluation of the requirement coverage is used to analyze the correspondence between requirements and test cases to ensure that all requirements are converted into test cases and executed; 所述代码覆盖率的评估采用Git版本控制系统,结合覆盖率信息生成具有增量信息的覆盖率报告。The code coverage is evaluated using the Git version control system, and coverage information is combined to generate a coverage report with incremental information.
CN202411497943.XA 2024-10-25 2024-10-25 A method for interface automation testing based on RPA Pending CN119537213A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411497943.XA CN119537213A (en) 2024-10-25 2024-10-25 A method for interface automation testing based on RPA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411497943.XA CN119537213A (en) 2024-10-25 2024-10-25 A method for interface automation testing based on RPA

Publications (1)

Publication Number Publication Date
CN119537213A true CN119537213A (en) 2025-02-28

Family

ID=94710109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411497943.XA Pending CN119537213A (en) 2024-10-25 2024-10-25 A method for interface automation testing based on RPA

Country Status (1)

Country Link
CN (1) CN119537213A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119847939A (en) * 2025-03-18 2025-04-18 浙江实在智能科技有限公司 Method and system for RPA (remote procedure for assembly) automatic regression testing

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119847939A (en) * 2025-03-18 2025-04-18 浙江实在智能科技有限公司 Method and system for RPA (remote procedure for assembly) automatic regression testing
CN119847939B (en) * 2025-03-18 2025-06-24 浙江实在智能科技有限公司 Method and system for RPA (remote procedure for assembly) automatic regression testing

Similar Documents

Publication Publication Date Title
US11366747B2 (en) Unified test automation system
WO2020140820A1 (en) Software testing method, system, apparatus, device, medium, and computer program product
US10055338B2 (en) Completing functional testing
US7596778B2 (en) Method and system for automatic error prevention for computer software
US7895565B1 (en) Integrated system and method for validating the functionality and performance of software applications
Polo et al. Test automation
JP2010231782A (en) Method and system for function automation
US8661414B2 (en) Method and system for testing an order management system
CN119537213A (en) A method for interface automation testing based on RPA
CN116774987A (en) A web-based multi-terminal software development control method and system
CN102144221B (en) Compact framework for automated testing
CN119544497A (en) Server configuration method, computer equipment and storage medium
Tiwari et al. Combining model-based testing and automated analysis of behavioural models using graphwalker and UPPAAL
CN117056221A (en) Automatic testing method and device for application program, computer equipment and storage medium
Orjala Unit testing methods for internet of things Mbed OS operating system
Ahmed et al. An Adaptation Model for Android Application Testing with Refactoring
CN120631769A (en) Automatic testing method, device and terminal based on front-end UI
Sundbaum Automated Verification of Load Test Results in a Continuous Delivery Deployment Pipeline
CN119782195A (en) Method, device and electronic device for creating automated testing framework
Vilkko et al. COMPATIBILITY TESTS FOR AUTOMA-TION PLATFORM
Mattila et al. DESIGN AND IMPLEMENTATION OF A DATA VALIDATION SYSTEM FOR A VIRTUAL UNDERGROUND DRILLING MACHINE
CN118626390A (en) White box component testing method, device and readable storage medium
CN117331822A (en) Interface testing and repair methods, devices and electronic equipment and storage media
Di Ruscio et al. EVOSS: A tool for managing the evolution of free and open source software systems
CN114579437A (en) SDK development method, system, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination