Automatic testing method and system based on low codes

An automated testing and code technology, applied in software testing/debugging, error detection/correction, instruments, etc., can solve problems such as low efficiency and high requirements for testers' professional and technical capabilities, and achieve the effect of reducing R&D costs and improving writing efficiency

Pending Publication Date: 2022-05-10
WUHAN KOTEI INFORMATICS
0 Cites 0 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0004] The embodiment of the present invention provides a low-code-based automated testing method and system to solve the problem that t...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Method used

Fig. 5 is the test case modification interface schematic diagram that the embodiment of the present invention provides, with reference to Fig. 5, test system has provided test case repeated editing and modification capability. Test cases can be parsed into sequential behaviors through the aforementioned deserialization means. Then, according to the behavioral cloud model, it is displayed as an effect that is convenient for test case writers to view and modify.
For the above-mentioned problems of prior art, the embodiment of the present invention provides a kind of automated testing method based on low code, the writing of test case, preservation and execution only need to be able to operate through the common business tester of simple business training , without the need for professional automated testers, compared with existing technologies, it greatly improves the efficiency of writing test cases and significantly reduces enterprise R&D costs. The following will describe and introduce through multiple embodiments in conjunction with the accompanying drawings.
The low-code-based automated testing method provided by the embodiment of the present invention abstracts the running environment, users, browser behavior and ...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Abstract

The invention provides an automatic test method and system based on low codes, and the method comprises the steps: abstracting a test behavior, and building a new test case; newly establishing test behaviors of the test case, and configuring various parameters of each test behavior; verifying whether the test case is correctly configured, serializing the test case and storing the serialized test case; and executing the test case and providing a result report. According to the method, the running environment, the user, the browser behavior and the participated objects are abstracted according to respective attributes, the writing, the storage and the execution of the test case can be operated only by common business testers subjected to simple business training, professional automatic testers are not needed, and compared with the prior art, the method has the advantages that the test efficiency is improved, and the test cost is reduced. The writing efficiency of the test case is greatly improved, and the research and development cost of an enterprise is remarkably reduced.

Application Domain

Technology Topic

SerializationTest case +6

Image

  • Automatic testing method and system based on low codes
  • Automatic testing method and system based on low codes
  • Automatic testing method and system based on low codes

Examples

  • Experimental program(1)

Example Embodiment

[0046] In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present invention.
[0047] At present, in the traditional automated testing process, the writing of automated test cases, the storage and distribution of test cases themselves, and the final test execution require too much professional quality of testers and are inefficient.
[0048] In view of the above problems in the prior art, the embodiments of the present invention provide a low-code-based automated testing method. The writing, saving and execution of test cases only require ordinary business testers who have undergone simple business training to operate, and no professional Compared with the existing technology, automated testers greatly improve the efficiency of writing test cases and significantly reduce the cost of enterprise research and development. The following will be described and introduced through a plurality of embodiments in conjunction with the accompanying drawings.
[0049] figure 1 A schematic flowchart of a low-code-based automated testing method provided by an embodiment of the present invention, such as figure 1 As shown, the low-code-based automated testing method provided by the embodiment of the present invention includes but is not limited to the following steps:
[0050] Step 101, abstract the test behavior, and create a new test case;
[0051] The essence of low-code is the extremely abstract and templated process of application scenarios. Test actions are atomic operations specific to a business scenario. The abstract test behavior is to abstract each step of the test case into a separate test behavior, and around this test behavior, it is necessary to collect the context elements of behavior processing, and the elements are defined as parameters for the test case writers to choose or input. The test system abstracts the running environment, user and browser behavior, and participating objects (objects during testing) for their respective properties. All these abstracted objects are the objects of the test system.
[0052] figure 2 A schematic diagram of a new test case provided by the embodiment of the present invention. refer to figure 2 , after the test system is started, test case writers create new test cases according to the process.
[0053] Step 102 , create a new test behavior of the test case, and configure various parameters of each test behavior.
[0054] Among them, the test behavior is the atomic operation in the test scene, and the meta-model of the test behavior is the key element to define the behavior (atomic operation). Typically, the test behavior needs to define id, name, and alias. Depending on the specific test behavior, it may be necessary to configure 0, 1, or even multiple parameters. The parameters themselves also need to define the type and even candidate data. The entered information is part of the metamodel.
[0055] image 3 It is a schematic diagram of testing behavior editing provided by the embodiment of the present invention, refer to image 3, after creating a new test case, add the test behavior of the new test case. Among them, the test behavior is the atomic operation part of the aforementioned test case. Select a behavior and configure the various elements of the behavior. During configuration, according to the selected meta model of the specific behavior, determine how many parameters the test behavior has, what the parameter type is, and set the corresponding value of each parameter.
[0056] refer to image 3 , the test behaviors that can be added include but are not limited to: a. Use a browser; b. Open the webpage at the specified address; c. Double-click the page element; d. Set the value of the specified element; e. Wait for the specified time; f. Get the browsing Web page title; g, click on the page element; h, assign the value of the page element to a variable; i, determine the value of the variable.
[0057] Step 103, verify whether the test case is configured correctly, serialize the test case and save it;
[0058] After all test behaviors are written, verify that the test case is configured correctly, then serialize the test case and save it.
[0059] As a saved test case, it can meet various mainstream file formats and encoding methods to achieve cross-system, cross-platform, cross-language and other characteristics. For example, the file format can be a binary file, a common file based on segmentation symbols, a json file, or an xml file. The encoding method can cover mainstream GBK, UTF8, etc., including but not limited to storage in the form of a BOM header, and more capabilities can be extended through plug-ins. After the test case is saved, it can be distributed without loss, import and export of the test case. Other test servers deployed with the test system can call and execute normally and return test results.
[0060] Step 104, execute the test case and provide a result report.
[0061] The present invention abstracts and templated the tested environment, behavior or action, and participants, and provides the ability to save and parse abstracted objects, save and edit templates, and abstract the process of writing test cases.
[0062] With the low-code-based automated testing method provided by the present invention, as a test case writer, there is no need to really master the advanced framework and complex API writing ability, but only need to create a new test case in the test system, and then select the abstract steps provided by the test system, And select or edit the input and output parameters, you can complete the editing steps of each test behavior in the test case, and then complete the writing of the test case in the entire scenario, and save the test case. The test system can also identify test cases, execute test cases and output test reports according to active triggering or scheduling tasks.
[0063] Based on the content of the foregoing embodiment, in a possible implementation manner, Figure 4 This is the test case execution flow chart provided by the embodiment of the present invention. refer to Figure 4 , in step 104, execute the test case and provide a result report, which specifically includes:
[0064] Step 201, load the saved test case, and deserialize it into a test case model.
[0065] Specifically, the preservation of test cases belongs to the category of object serialization. In contrast, in order to ensure the normal execution of automated test cases by the test system, the test system also needs to have the ability to deserialize test cases, and deserialize the saved test cases. into various objects that the system can recognize. Taking the test web system as an example, the user opens the browser, enters the url to visit the website, text input on the website, button clicks, various single and double clicks, and scrolling, drag-and-drop behaviors, and so on.
[0066] Step 202, instantiate the test behavior in the test case model into an object, and execute the test case;
[0067] As an optional implementation manner, in this embodiment, according to the specific language and framework, the test behavior is instantiated into a corresponding object, and the parameters of the object are assigned values ​​and stored in the context of the test case to be executed.
[0068] Further, the step of executing the test case includes: the test system, according to the current test behavior of the currently executing test case, finds the value corresponding to the parameter of the test behavior in the context, and executes the test behavior. If the test behavior is executed successfully, it will execute the next test behavior; if the execution fails, the failure handling process of the test case will be executed; that is, the test system will decide whether to execute the next behavior normally or have a jump requirement according to the execution of the test behavior. , if the execution fails, the failure processing flow of the test case is executed.
[0069] Step 203, collecting test results and log information.
[0070] Collect and process logs output by test case execution, and provide test result query and log information query functions on the web interface.
[0071] Step 204: Generate a test report according to the test result and log information.
[0072] The low-code-based automated testing method provided by the embodiments of the present invention abstracts the running environment, user, browser behavior, and participating objects according to their respective attributes. The writing, saving and execution of test cases can only be operated by ordinary business testers who have undergone simple business training, without the need for professional automation testers. Compared with the existing technology, the writing efficiency of test cases is greatly improved, and the R&D rate of enterprises is significantly reduced. cost.
[0073] In one embodiment, an embodiment of the present invention further provides a low-code-based automated testing system, and the low-code-based automated testing system provided by an embodiment of the present invention is used to execute the low-code-based automated testing methods in the foregoing embodiments . The system includes:
[0074] Test case new unit, which is used to abstract test behavior and create new test case;
[0075] The new unit of test behavior is used to create the test behavior of the test case and configure the parameters of each test behavior;
[0076] The test case saving unit is used to verify whether the test case is configured correctly, serialize the test case and save it;
[0077] The test case execution unit is used to execute the test case and provide the result report.
[0078] The low-code-based automated testing system provided by the present invention provides serialization and deserialization capabilities for test cases, including identification, verification and judgment. Among them, the combination of a series of sequential behaviors written to meet specific test scenarios is called a test case. The traditional test case is a concrete-based combination of a series of steps generated in a specific programming language and a specific programming framework in sequence. In this test system, test case writers select and enter a new test step based on the abstract candidate behavior and the parameters defined by the behavior meta-model on the web platform of the system (this step is the concrete behavior), press Sequentially enter behavior, and finally complete an entire test case.
[0079] Save the test cases of this system, only save the abstract behavior, not the specific language and framework, such as:
[0080] ##test webconsole console 2
[0081] #browser 11
[0082] use chrome
[0083] #browse
[0084] Browse to http://localhost:8090/
[0085] wait for 1000
[0086] #action
[0087] set name=username admin
[0088] set name=password lsh.0904
[0089] screenshot
[0090] wait for 1000
[0091] Click id=login
[0092] wait for 1000
[0093] click id=test
[0094] Prompt Cancel
[0095] click id=test
[0096] prompt confirm
[0097] click id=test
[0098] Prompt info lsh_v00
[0099] prompt confirm
[0100] Settings [lsh_v01]
[0101] Equal to lsh_v00 lsh_v01
[0102] Get browser title lsh_v1
[0103] Setting up [lshv2] Docker-based smoking environment...
[0104] Equal to lsh_v1 lshv2
[0105] #ending
[0106] Click xpath=//*[@id="nav"]/nav/form/button
[0107] Therefore, the above text method can be used for serialization, and the behavior and corresponding parameters can be separated by spaces or special characters. For the scalability and compatibility of the system, it provides the ability to serialize test cases using json or xml.
[0108] Based on the above cognition, most high-level languages ​​have no barriers to read and write or serialize and deserialize.
[0109] Test cases can be effectively saved and distributed. Considering the system version upgrade, the version information of test cases can be set in the header of the saved file, which is convenient for compatibility verification and processing after deserialization.
[0110] Specifically how to use the low-code-based automated testing system to perform automated testing, reference may be made to the foregoing method embodiments, and details are not described herein again in the embodiments of the present invention.
[0111] Based on the content of the foregoing embodiments, in a possible implementation manner, the low-code-based automated testing system provided by the embodiment of the present invention also includes:
[0112] The test case display unit is used to display the information list of test cases.
[0113] The test system provides a list view of test cases and detailed display of specific use cases. Among them, list view test cases: store test cases together according to certain rules, and display them according to the corresponding rules list when viewing. Test case details display: When viewing a specific test case, you need to display the test case to the web interface of the test system.
[0114] The test case modification unit is used to edit and modify test cases.
[0115] Figure 5 For a schematic diagram of a test case modification interface provided by an embodiment of the present invention, refer to Figure 5, the test system provides the ability to repeatedly edit and modify test cases. Test cases can be parsed into sequential behaviors through the aforementioned deserialization methods. Then, according to the cloud model of the behavior, it is displayed to facilitate the test case writers to view and modify the effect.
[0116] The execution engine unit is used to provide the execution engine and supporting resources of the test case.
[0117] Among them, the execution engine can call selenium or other drivers of various platforms through java or python and other high-level languages ​​to execute corresponding behaviors. When all actions are executed in sequence, a single test case is executed.
[0118] Test plan unit, used to show the execution of test cases.
[0119] Image 6 This is a schematic diagram of the execution situation of viewing the test case provided by the embodiment of the present invention. refer to Image 6 , the test system provides a web-side query display of the execution of test cases, which can display not only the test results of the entire test case, but also the execution results of each test behavior in the test case. A screenshot of the execution at that time.
[0120] The test report generation unit is used to generate test reports according to the test results and log information.
[0121] Figure 7 This is a schematic diagram of viewing a test report provided by an embodiment of the present invention. refer to Figure 7 , the test system provides a graphical report of test results. The test report generation unit can generate, based on the test results and log information, combined with chart tools, Figure 7 Test report with full log shown.
[0122] In one embodiment, an embodiment of the present invention provides an electronic device, such as Figure 8 As shown, the electronic device may include: a processor (processor) 801, a communication interface (CommunicationsInterface) 802, a memory (memory) 803 and a communication bus 804, wherein, the processor 801, the communication interface 802, and the memory 803 are completed through the communication bus 804. communication with each other. The processor 801 may call the logic instructions in the memory 803 to execute the steps of the low-code-based automated testing methods provided by the above embodiments, for example, including: 101, abstract test behavior, create a new test case; 102, create a test for the new test case Behavior, configure various parameters of each test behavior; 103, verify whether the test case is configured correctly, serialize the test case and save it; 104, execute the test case and provide a result report.
[0123] In one embodiment, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, and the computer program is implemented when executed by a processor to execute the low-code-based low-code provided by the foregoing embodiments The steps of the automated testing method, for example, include: 101, abstract test behavior, create a new test case; 102, create a test behavior of the new test case, configure various parameters of each test behavior; 103, verify whether the test case is configured correctly, serialize Test the case and save it; 104, execute the test case and provide a result report.
[0124] To sum up, the embodiments of the present invention provide a low-code-based automated testing method and system, which abstracts the running environment, user, browser behavior, and participating objects according to their respective attributes. The writing, saving and execution of test cases can only be operated by ordinary business testers who have undergone simple business training, without the need for professional automation testers. Compared with the existing technology, the writing efficiency of test cases is greatly improved, and the R&D rate of enterprises is significantly reduced. cost.
[0125] It should be noted that, in the foregoing embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0126] As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
[0127] The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded computer or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Implement a process or processes and/or blocks in a flowchart Figure 1 A means for the functions specified in a block or blocks.
[0128] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The device is implemented in the process Figure 1 process or processes and/or blocks Figure 1 the function specified in a box or boxes.
[0129] These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that Instructions are provided for implementing a process or processes and/or blocks in the flowchart Figure 1 The steps of the function specified in the box or boxes.
[0130] Although preferred embodiments of the present invention have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once armed with the basic inventive concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of the present invention.
[0131] It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit and scope of the invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Similar technology patents

Classification and recommendation of technical efficacy words

  • Reduce R&D costs
  • Improve writing efficiency

Program upgrading device based on vehicle Ethernet framework and control method thereof

InactiveCN107450518AImprove writing efficiencyReliable and stable working conditionsElectric testing/monitoringTransmissionEmbedded systemDomain controller
Owner:BEIJING CHJ AUTOMOTIVE TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products