CN117539785A - CPE interface automatic test method, device, computer equipment and storage medium - Google Patents

CPE interface automatic test method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117539785A
CN117539785A CN202311634989.7A CN202311634989A CN117539785A CN 117539785 A CN117539785 A CN 117539785A CN 202311634989 A CN202311634989 A CN 202311634989A CN 117539785 A CN117539785 A CN 117539785A
Authority
CN
China
Prior art keywords
test
plan
interface automatic
library
cpe 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
CN202311634989.7A
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.)
Guangzhou Tongze Kangwei Technology Co ltd
Original Assignee
Guangzhou Tongze Kangwei 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 Guangzhou Tongze Kangwei Technology Co ltd filed Critical Guangzhou Tongze Kangwei Technology Co ltd
Priority to CN202311634989.7A priority Critical patent/CN117539785A/en
Publication of CN117539785A publication Critical patent/CN117539785A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

The embodiment of the invention discloses an automatic test method and device for a CPE interface, computer equipment and a storage medium. The method comprises the following steps: acquiring a test requirement; a test plan is formulated according to the test requirements and the test case library; deploying a python language and selenium library test environment; executing the test plan in the test environment, and running a test script to obtain a test result and an analysis report. The method of the embodiment of the invention can reduce the manpower input and the repeated test time, reduce human errors, simultaneously can perform a large number of repeated and uninterrupted tests, cover various limit scenes and improve the test efficiency.

Description

CPE interface automatic test method, device, computer equipment and storage medium
Technical Field
The present invention relates to CPE user interfaces, and more particularly, to a CPE interface automatic test method, apparatus, computer device, and storage medium.
Background
With the wide coverage and popularization of the internet, CPE (customer premise equipment ) has been applied to many sites as a common device. Currently, most manufacturers manually test all functions by adopting a manual operation mode when testing CPE equipment. The traditional method is simple and flexible, and has the problems of high cost and low efficiency.
With the increase and change of the demands, the functions are updated more and more, and each time the functions are changed, the functions are tested; while version updates require extensive regression testing. All of these tests, if performed manually, are quite costly in terms of labor and time, and are prone to error due to the large number of repeated manual operations, and are inefficient.
Therefore, a new method is necessary to be designed, so that the labor input and the repeated test time are reduced, the human error is reduced, a large number of repeated and uninterrupted tests can be performed, various limit scenes are covered, and the test efficiency is improved.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides an automatic test method and device for a CPE interface, computer equipment and a storage medium.
In order to achieve the above purpose, the present invention adopts the following technical scheme: the CPE interface automatic test method comprises the following steps:
acquiring a test requirement;
a test plan is formulated according to the test requirements and the test case library;
deploying a python language and selenium library test environment;
executing the test plan in the test environment, and running a test script to obtain a test result and an analysis report.
The further technical scheme is as follows: before the test requirement is obtained, the method further comprises:
and obtaining all the test cases and manufacturing a test case library.
The further technical scheme is as follows: the test case library comprises all test cases comprising specified format contents; the specified format content includes a functional description, associated features, test parameters, and expected assertions.
The further technical scheme is as follows: the step of making a test plan according to the test requirements and the test case library comprises the following steps:
setting a test group according to the test requirement;
selecting a necessary case set and a required case set with specific requirements from a test case library to form a test case set;
setting the test type of the test case set;
and writing the set test case set into a test script by using the python language to obtain a test plan.
The further technical scheme is as follows: executing the test plan in the test environment, running a test script to obtain a test result and an analysis report, including:
executing the test plan in the test environment, and running a test script to drive a browser to send a request;
acquiring a page object;
analyzing the page object and positioning the test object;
simulating a test action according to the test parameters in the test plan, and returning a test result by the browser;
according to the test case test language, a test result is asserted;
and outputting the test result.
The further technical scheme is as follows: the analyzing the page object and positioning the test object includes:
and positioning and acquiring the test object according to the associated characteristic in the test plan.
The further technical scheme is as follows: the simulation test action according to the test parameters in the test plan and the browser returns the test result, comprising:
and executing input, clicking and reading operations on the page object according to the test parameters in the test plan, simulating manual test actions to obtain a test result, and returning the test result by the browser.
The invention also provides an automatic test device for the CPE interface, which comprises:
the demand acquisition unit is used for acquiring the test demand;
the plan making unit is used for making a test plan according to the test requirements in combination with the test case library;
a deployment unit for deploying the python language and the selenium library test environment;
and the running unit is used for executing the test plan in the test environment and running the test script to obtain a test result and an analysis report.
The invention also provides a computer device which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the method when executing the computer program.
The present invention also provides a storage medium storing a computer program which, when executed by a processor, implements the above method.
Compared with the prior art, the invention has the beneficial effects that: the invention combines the existing test cases in the test case library to make a test plan according to the test requirements, deploys the environment, automatically executes the test plan, reduces the time of manpower input and repeated test, reduces human errors, can perform a large number of repeated and uninterrupted tests, covers various limit scenes and improves the test efficiency.
The invention is further described below with reference to the drawings and specific embodiments.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a CPE interface automatic test method according to an embodiment of the present invention;
fig. 2 is a schematic sub-flowchart of a CPE interface automatic test method according to an embodiment of the present invention;
fig. 3 is a schematic sub-flowchart of a CPE interface automatic test method according to an embodiment of the present invention;
fig. 4 is a flow chart of a CPE interface automatic test method according to another embodiment of the present invention;
FIG. 5 is a schematic block diagram of a CPE interface automatic test equipment provided by an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a planning unit of the CPE interface automatic test equipment provided by an embodiment of the present invention;
FIG. 7 is a schematic block diagram of an operation unit of the CPE interface automatic test equipment provided by the embodiment of the invention;
FIG. 8 is a schematic block diagram of a CPE interface automatic test equipment provided by an embodiment of the present invention;
FIG. 9 is a schematic block diagram of a computer device provided by an embodiment of the present invention;
fig. 10 is a schematic diagram of a selenium test procedure according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1, fig. 1 is a schematic flowchart of a CPE interface automatic test method according to an embodiment of the present invention. The CPE interface automatic test method is applied to CPE equipment, and by arranging all test cases, the automatic test is performed on part of repeated tests such as old functions, regression tests and the like, so that an excellent and reliable test process is created, the time of manpower input and repeated tests can be reduced, human errors are reduced, a large number of repeated and uninterrupted tests can be performed, the situation which cannot be achieved by manual tests is realized, various limit scenes are covered, and the test efficiency is improved.
Fig. 1 is a flow chart of an automatic CPE interface test method according to an embodiment of the present invention. As shown in fig. 1, the method includes the following steps S110 to S140.
S110, acquiring test requirements.
In this embodiment, the test requirements refer to requirements of which functions of the CPE user interface are currently required to be tested.
S120, a test plan is formulated according to the test requirements and the test case library.
In this embodiment, the test plan refers to a plan meeting test requirements formed by screening cases from a test case library and then setting the cases.
In one embodiment, referring to fig. 2, the step S120 may include steps S121 to S124.
S121, setting a test group according to the test requirement.
In this embodiment, the test packet may be a single test, a full test, a random test; of course, the test cases can be divided into different groups according to the test requirements, for example, the groups are grouped according to modules, functions, scenes and the like, so that the test can be managed and executed better.
S122, selecting a necessary case set and a required case set with specific requirements from the test case library to form the test case set.
In this embodiment, the test case set includes a must case set and a demand case set.
A set of cases that must be executed is selected from a library of test cases, which cover the core functions and important test scenarios of the system. Meanwhile, the related use case sets are selected according to specific requirements so as to verify the performance of the system under different requirements.
As shown in Table 1, compared with a common router, a typical CPE functional framework has one more 4G/5G module connected to a WAN port as an external data interface, which is a core function of the CPE, and in Table 1, a 'WAN network' is a functional module for realizing the setting and management of the 4G/5G module. For this feature of the CPE, this must be taken into account for the organization of the test plan. And correspondingly, the test cases of the 4G/5G module and the WAN network function module are required to be used as a necessary case set, and then the application case is selected for each test requirement, and the requirement case set is added. The necessary case set and the demand case set are combined together to form a complete test plan case.
In this embodiment, the test case library performs information such as function description and test attribute classification on the page object. When a single test is implemented, the corresponding test cases are selected from the generated test case library according to the test requirements, and meanwhile, the test groups, such as single test, comprehensive test or random test, are set according to the test requirements.
TABLE 1 typical CPE functional framework
S123, setting the test type of the test case set.
In the present embodiment, the test types include a function test, a pressure test, a capacity test, and the like.
And determining the test type of the test case set, such as a functional test, a performance test, a safety test and the like, according to the test requirement. Each test type has different objectives and methods, and by setting the test type, various aspects of the overall coverage system can be ensured.
S124, writing the set test case set into a test script by using the python language so as to obtain a test plan.
In this embodiment, a test script is written in Python language, and the set test case set is converted into an executable automation test script. Therefore, the testing efficiency can be improved, the error of manual operation is reduced, and repeated execution and result analysis are convenient.
The purpose of making a test plan is to plan and organize system test work, ensure test coverage and quality, discover and repair potential problems in time, so as to improve the reliability and stability of the system.
S130, deploying a python language and a selenium library test environment.
In this embodiment, since the automated testing principle is to write an automated testing python code, a request is sent to the webDriver browser driver through the selenium library api, the webDriver driver drives the browser to perform simulation operation on the object of the web page, after the browser finishes executing, the result is returned in sequence, and finally the automated script code performs the speaking and subsequent operations.
Referring to fig. 10, the entire test environment needs to install python language package, selenium library, browser corresponding driver. The browser referred to herein may be a Chrome browser, an internet explore browser, and a Firefox browser. The engine corresponding to the Chrome browser is Webkit, the engine corresponding to the Internet Explore browser is Trident, and the engine corresponding to the Firefox browser is Gecko.
And S140, executing the test plan in the test environment, and running a test script to obtain a test result and an analysis report.
In one embodiment, referring to fig. 3, the step S140 may include steps S141 to S146.
S141, executing the test plan in the test environment, and running a test script to drive a browser to send a request.
Specifically, according to the instruction in the test plan and the instruction written by the test script, the test execution environment runs the corresponding test script. These test scripts use a specific programming language (e.g., python) to drive the browser to send requests and simulate the test actions of the user.
S142, acquiring the page object.
In this embodiment, the page object refers to a page including an object to be tested.
Specifically, after the browser sends the request, the test execution environment obtains the response data of the page and parses the response data into the page object. A page object is an abstract data structure that contains the individual elements, attributes, and state information of a page.
S143, analyzing the page object and positioning the test object.
In this embodiment, the test object is located and acquired according to the associated feature in the test plan.
Specifically, the method is realized by the ' associated feature ' in the test case library, and the test object is positioned and acquired through the ' feature of the page object such as id/class/tag/name. By parsing the page object, the test execution environment can accurately locate objects that need to be tested, such as buttons, input boxes, links, and the like. This allows manipulation and verification of specific elements.
S144, simulating the test action according to the test parameters in the test plan, and returning a test result by the browser.
In this embodiment, input, clicking and reading operations are performed on the page object according to the test parameters in the test plan, so as to simulate a manual test action, and a test result is obtained and returned by the browser.
Specifically, the method is realized by reading the test parameters in the test case library. And executing operations such as inputting, clicking, reading and the like on the page object according to the test parameters corresponding to the test plan, and simulating manual test actions.
According to the test parameters in the test plan, the test execution environment simulates the test actions of the user on the page, such as clicking, inputting, submitting forms and the like. Then, the browser returns corresponding test results, such as page skip, data submission, error prompt, and the like, according to the test action.
S145, according to the test case test language, a test result is asserted.
In this embodiment, this is accomplished by reading the "expected assertion" in the test case library. And judging whether the execution result is consistent with the expectations according to the expected assertion.
The test execution environment asserts the actual test results based on the expected results defined in the test cases. This means that it will check if the actual results agree with the expected results to determine if the test passed or failed.
S146, outputting the test result.
Finally, the test execution environment will output the test results, typically in the form of a log or report. These results include the number of cases that passed the test, the number of cases that failed, error information, etc., for further analysis and decision making.
The step S140 is to automatically execute the testing process, thereby improving the testing efficiency and accuracy. By simulating the test action of the user and asserting the test result, the correctness, usability and stability of the system under various conditions can be verified. Meanwhile, the output test result can help developers and test teams to quickly locate and solve the problems, and improve the quality and performance of the system.
The method of the embodiment can reduce the manpower input and repeated test time in the CPE user interface test process, reduce human errors, simultaneously can perform a large number of repeated and uninterrupted tests, realize the situation that the manual test cannot reach, cover various limit scenes and improve the test efficiency.
According to the CPE interface automatic test method, the existing test cases in the test case library are combined, the test plan is formulated according to the test requirements, the environment is deployed, the test plan is automatically executed, the time for reducing the manpower input and repeated test is realized, the human error is reduced, a large number of repeated and uninterrupted tests can be performed, various limit scenes are covered, and the test efficiency is improved.
Fig. 4 is a flowchart of a CPE interface automatic test method according to another embodiment of the present invention. As shown in fig. 4, the CPE interface automatic test method of the present embodiment includes steps S210-S250. Steps S220 to S250 are similar to steps S110 to S140 in the above embodiment, and are not described herein. Steps S260 to S270 added in the present embodiment are described in detail below.
S210, acquiring all test cases and manufacturing a test case library.
In this embodiment, the test case library includes all test cases including specified format contents; the specified format content includes a functional description, associated features, test parameters, and expected assertions.
Specifically, from the selection of the account type, the main interface, the secondary menu, the tertiary menu … N-level menu are entered in order. And filling corresponding attributes into each page object according to the format, and compiling a single test case. All of these test cases are assembled into a test case library. Wherein the format content comprises: description of the functions: a description of the functional specification of the page object; correlation characteristics: positioning features of page objects such as id/class/tag/name; test parameters: input parameters, operation modes and the like aiming at the page object; expected assertion: expected effects after manipulating the page object.
Specifically, firstly, arranging test cases, entering account type setting, namely setting a common account, a high-level account and a super account to form an account test set, entering a main interface to perform setting to form a main menu test set, and entering a secondary menu to perform setting to form a secondary menu test set; and then entering the setting of the N-level menu to form an N-level menu test set.
In this embodiment, the test case library is a repository that integrates multiple test cases, each describing the functionality, locating features, test parameters, and expected assertions of a particular page object. The following are the format contents and meanings of the test cases:
description of the functions: the description of the function of the page object is described, and the roles and functions of the object are briefly summarized. The purpose and purpose of the tested object can be clearly known.
Correlation characteristics: specifying locating features for page objects such as id, class, tag, name, etc. These features are used to accurately locate objects under test in a page for correlation operations and verification.
Test parameters: input parameters and operation modes for page objects. For example, if the page object is an input box, the test parameters may include entering specific text content; if the page object is a button, the test parameters may include clicking on the button.
Expected assertion: the expected effect after operating the page object is described. I.e. what the expected result should be after performing the test action by the test parameters. In this way it is possible to verify whether the system is working as intended, achieving the intended function and effect.
The use of formatted test cases may provide the following benefits:
easy to understand and maintain: each test case has a clear functional description and expected assertion that enables the tester to quickly understand the purpose and expected outcome of the case. This is easier to maintain and update at a later date.
Accurate positioning and operation: through designating the associated features of the page object, the tested object can be accurately positioned, and misoperation and unnecessary testing steps are avoided.
The test efficiency is improved: by using a unified format, the test case library can be automatically executed, and the test efficiency and accuracy are improved. The tester only needs to write the use cases, and does not need to manually execute each test step.
Verification of system function and stability: the expected assertion defines the expected effect of operating the page object and can verify whether the system is operating as expected. This can find potential problems and ensure the function and stability of the system.
In a word, the formatted test case library is helpful for organizing and managing test work, and the test efficiency and quality are improved. By explicit functional descriptions, positioning features, test parameters, and expected assertions, the various functional modules of the system can be fully and accurately verified, providing a reliable software product.
Fig. 5 is a schematic block diagram of a CPE interface automatic test apparatus 300 according to an embodiment of the present invention. As shown in fig. 5, the present invention further provides a CPE interface automatic test apparatus 300 corresponding to the above CPE interface automatic test method. The CPE interface automatic test apparatus 300 includes a unit for performing the CPE interface automatic test method described above, and may be configured in CPE equipment. Specifically, referring to fig. 5, the CPE interface automatic test apparatus 300 includes a demand acquisition unit 302, a planning unit 303, a deployment unit 304, and an operation unit 305.
A requirement acquisition unit 302, configured to acquire a test requirement; a planning unit 303, configured to combine the test case library according to the test requirement to plan a test plan; a deployment unit 304 for deploying the python language and the selenium library test environment; and the operation unit 305 is used for executing the test plan in the test environment and operating a test script to obtain a test result and an analysis report.
In one embodiment, as shown in fig. 6, the planning unit 303 includes a packet setting subunit 3031, a use case set forming subunit 3032, a type setting subunit 3033, and a writing subunit 3034.
A packet setting subunit 3031, configured to set a test packet according to a test requirement; a case set forming subunit 3032, configured to select a necessary case set and a requirement case set with a specific requirement from the test case library to form a test case set; a type setting subunit 3033, configured to set a test type of the test case set; and the compiling subunit 3034 is configured to compile the set test case set into a test script by using the python language so as to obtain a test plan.
In one embodiment, as shown in fig. 7, the execution unit 305 includes an execution subunit 3051, an object acquisition subunit 3052, an object positioning subunit 3053, an analog subunit 3054, an assertion subunit 3055, and an output subunit 3056.
An execution subunit 3051, configured to execute the test plan in the test environment, and run a test script to drive a browser to send a request; an object acquiring subunit 3052, configured to acquire a page object; an object positioning subunit 3053, configured to parse the page object and position the test object; the simulation subunit 3054 is configured to simulate a test action according to the test parameters in the test plan, and return a test result by the browser; an asserting subunit 3055, configured to assert a test result according to the test case test language; and an output subunit 3056, configured to output the test result.
In one embodiment, the object localization subunit 3053 is configured to locate and obtain a test object according to the associated feature in the test plan.
In an embodiment, the simulation subunit 3054 is configured to perform input, click, and read operations on the page object according to the test parameters in the test plan, simulate a manual test action to obtain a test result, and return the test result by the browser.
Fig. 8 is a schematic block diagram of a CPE interface automatic test apparatus 300 according to another embodiment of the present invention. As shown in fig. 8, the CPE interface automatic test apparatus 300 of the present embodiment is formed by adding a use case library creating unit 301 to the above-described embodiment.
The case library making unit 301 is configured to obtain all test cases and make a test case library.
It should be noted that, as will be clearly understood by those skilled in the art, the specific implementation process of the CPE interface automatic test apparatus 300 and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, the description is omitted here.
The CPE interface automatic test apparatus 300 described above may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 9.
Referring to fig. 9, fig. 9 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a terminal, where the terminal may be an electronic device having a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device.
With reference to FIG. 9, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a CPE interface automatic test method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a CPE interface automatic test method.
The network interface 505 is used for network communication with other devices. It will be appreciated by those skilled in the art that the structure shown in fig. 9 is merely a block diagram of a portion of the structure associated with the present application and does not constitute a limitation of the computer device 500 to which the present application is applied, and that a particular computer device 500 may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to execute a computer program 5032 stored in a memory to implement the steps of:
acquiring a test requirement; a test plan is formulated according to the test requirements and the test case library; deploying a python language and selenium library test environment; executing the test plan in the test environment, and running a test script to obtain a test result and an analysis report.
In one embodiment, before implementing the step of obtaining the test requirement, the processor 502 further implements the following steps:
and obtaining all the test cases and manufacturing a test case library.
The test case library comprises all test cases containing specified format contents; the specified format content includes a functional description, associated features, test parameters, and expected assertions.
In one embodiment, when the processor 502 performs the step of creating a test plan according to the test requirements in combination with the test case library, the following steps are specifically implemented:
setting a test group according to the test requirement; selecting a necessary case set and a required case set with specific requirements from a test case library to form a test case set; setting the test type of the test case set; and writing the set test case set into a test script by using the python language to obtain a test plan.
In one embodiment, when the processor 502 implements the steps of executing the test plan in the test environment and running a test script to obtain test results and analyze reports, the following steps are specifically implemented:
executing the test plan in the test environment, and running a test script to drive a browser to send a request; acquiring a page object; analyzing the page object and positioning the test object; simulating a test action according to the test parameters in the test plan, and returning a test result by the browser; according to the test case test language, a test result is asserted; and outputting the test result.
In one embodiment, when the processor 502 implements the parsing page object and locating the test object, the following steps are specifically implemented:
and positioning and acquiring the test object according to the associated characteristic in the test plan.
In one embodiment, when the processor 502 realizes the simulation of the test action according to the test parameters in the test plan and returns the test result from the browser, the following steps are specifically implemented:
and executing input, clicking and reading operations on the page object according to the test parameters in the test plan, simulating manual test actions to obtain a test result, and returning the test result by the browser.
It should be appreciated that in embodiments of the present application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program comprises program instructions, and the computer program can be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program which, when executed by a processor, causes the processor to perform the steps of:
acquiring a test requirement; a test plan is formulated according to the test requirements and the test case library; deploying a python language and selenium library test environment; executing the test plan in the test environment, and running a test script to obtain a test result and an analysis report.
In one embodiment, the processor, prior to executing the computer program to perform the step of obtaining the test requirements, further performs the steps of:
and obtaining all the test cases and manufacturing a test case library.
The test case library comprises all test cases containing specified format contents; the specified format content includes a functional description, associated features, test parameters, and expected assertions.
In one embodiment, when the processor executes the computer program to implement the step of creating a test plan according to the test requirements in combination with a test case library, the method specifically includes the following steps:
setting a test group according to the test requirement; selecting a necessary case set and a required case set with specific requirements from a test case library to form a test case set; setting the test type of the test case set; and writing the set test case set into a test script by using the python language to obtain a test plan.
In one embodiment, when the processor executes the computer program to implement the step of executing the test plan in the test environment and running a test script to obtain a test result and an analysis report, the following steps are specifically implemented:
executing the test plan in the test environment, and running a test script to drive a browser to send a request; acquiring a page object; analyzing the page object and positioning the test object; simulating a test action according to the test parameters in the test plan, and returning a test result by the browser; according to the test case test language, a test result is asserted; and outputting the test result.
In one embodiment, when the processor executes the computer program to implement the step of parsing the page object and locating the test object, the steps are specifically implemented as follows:
and positioning and acquiring the test object according to the associated characteristic in the test plan.
In one embodiment, when the processor executes the computer program to implement the simulation test action according to the test parameters in the test plan, and the browser returns the test result, the following steps are specifically implemented:
and executing input, clicking and reading operations on the page object according to the test parameters in the test plan, simulating manual test actions to obtain a test result, and returning the test result by the browser.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

  1. The CPE interface automatic test method is characterized by comprising the following steps:
    acquiring a test requirement;
    a test plan is formulated according to the test requirements and the test case library;
    deploying a python language and selenium library test environment;
    executing the test plan in the test environment, and running a test script to obtain a test result and an analysis report.
  2. 2. The CPE interface automatic test method of claim 1, further comprising, prior to the obtaining the test requirement:
    and obtaining all the test cases and manufacturing a test case library.
  3. 3. The CPE interface automatic test method of claim 2, wherein the test case library comprises all test cases including specified format content; the specified format content includes a functional description, associated features, test parameters, and expected assertions.
  4. 4. The CPE interface automatic test method of claim 3, wherein the creating a test plan in combination with a test case library according to the test requirements comprises:
    setting a test group according to the test requirement;
    selecting a necessary case set and a required case set with specific requirements from a test case library to form a test case set;
    setting the test type of the test case set;
    and writing the set test case set into a test script by using the python language to obtain a test plan.
  5. 5. The CPE interface automatic test method of claim 4, wherein executing the test plan in the test environment, running a test script to obtain test results and analysis reports, comprises:
    executing the test plan in the test environment, and running a test script to drive a browser to send a request;
    acquiring a page object;
    analyzing the page object and positioning the test object;
    simulating a test action according to the test parameters in the test plan, and returning a test result by the browser;
    according to the test case test language, a test result is asserted;
    and outputting the test result.
  6. 6. The CPE interface automatic test method of claim 5, wherein the parsing the page object and locating the test object comprises:
    and positioning and acquiring the test object according to the associated characteristic in the test plan.
  7. 7. The CPE interface automatic test method of claim 5, wherein the simulating a test action according to the test parameters in the test plan and returning a test result by a browser comprises:
    and executing input, clicking and reading operations on the page object according to the test parameters in the test plan, simulating manual test actions to obtain a test result, and returning the test result by the browser.
  8. Cpe interface automatic test equipment, characterized by comprising:
    the demand acquisition unit is used for acquiring the test demand;
    the plan making unit is used for making a test plan according to the test requirements in combination with the test case library;
    a deployment unit for deploying the python language and the selenium library test environment;
    and the running unit is used for executing the test plan in the test environment and running the test script to obtain a test result and an analysis report.
  9. 9. A computer device, characterized in that it comprises a memory on which a computer program is stored and a processor which, when executing the computer program, implements the method according to any of claims 1-7.
  10. 10. A storage medium storing a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.
CN202311634989.7A 2023-11-30 2023-11-30 CPE interface automatic test method, device, computer equipment and storage medium Pending CN117539785A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311634989.7A CN117539785A (en) 2023-11-30 2023-11-30 CPE interface automatic test method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311634989.7A CN117539785A (en) 2023-11-30 2023-11-30 CPE interface automatic test method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117539785A true CN117539785A (en) 2024-02-09

Family

ID=89791637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311634989.7A Pending CN117539785A (en) 2023-11-30 2023-11-30 CPE interface automatic test method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117539785A (en)

Similar Documents

Publication Publication Date Title
US11797298B2 (en) Automating identification of code snippets for library suggestion models
US11494181B2 (en) Automating generation of library suggestion engine models
JP7270764B2 (en) artificial intelligence chip verification
US10732966B2 (en) Library model addition
US7093238B2 (en) Automated software testing and validation system
US9152731B2 (en) Detecting a broken point in a web application automatic test case
CN111832236B (en) Chip regression testing method and system, electronic equipment and storage medium
US10229042B2 (en) Detection of meaningful changes in content
CN109189479B (en) Parallel automatic verification method for processor instruction set
US9342439B2 (en) Command coverage analyzer
CN112241370B (en) API interface class checking method, system and device
CN117009243A (en) Chip performance automatic test method, device, computer equipment and storage medium
CN117112060A (en) Component library construction method and device, electronic equipment and storage medium
EP2105837A2 (en) Test script transformation analyzer with change guide engine
US11132286B1 (en) Dynamic reordering of test case execution
CN117632710A (en) Method, device, equipment and storage medium for generating test code
CN112988578A (en) Automatic testing method and device
CN116841543A (en) Development method for dynamically generating cross-platform multi-terminal application based on Flutter
CN117539785A (en) CPE interface automatic test method, device, computer equipment and storage medium
CN114661615A (en) FPGA software testing method and device
CN114780420A (en) Method, device, equipment and storage medium for automatic test based on test case
US10949327B2 (en) Manipulation of complex variables in orchestration applications
CN117056221A (en) Automatic testing method and device for application program, computer equipment and storage medium
CN116362230A (en) Parameter verification method, device and computer equipment storable medium
KR20240041017A (en) Method and apparatus for selecting the optimal test case for software regression testing

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