Order testing method and system and device for executing order testing method
Through a new order testing method, it supports automatic testing of multiple ordering strategies, solving the problem that existing technology can only test one ordering strategy separately, achieving more flexible and extensive testing coverage.
Patent Information
- Application Number
- CN202011127997.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-20
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2040-10-20
AI Technical Summary
The existing technology only supports automatic order testing for one ordering strategy, and cannot support testing of multiple ordering strategies.
A method of placing an order test is proposed. By receiving the placing test task, obtaining the corresponding placing script project based on the placing scenario parameters and placing a policy parameter, selecting the appropriate placing test tool, and scheduling the test machine to execute the test task, and obtaining the test results.
Automatic order testing of multiple ordering strategies is realized, and appropriate testing tools and script projects can be selected according to different ordering strategies parameters, improving testing flexibility and coverage.
Smart Images

Figure CN114092169B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer applications, and in particular to an order testing method and system, and a device for executing the order testing method. Background Art
[0002] E-commerce platforms provide users with a variety of ordering services, allowing users to place orders for products on the e-commerce platform through different channels and in different ways. The ordering strategies provided by e-commerce platforms for users include, for example, mobile terminal applications, mobile terminal web pages, personal computer web pages, etc.
[0003] In order to ensure the quality of ordering services, it is necessary to test the ordering services of the e-commerce platform. The inventors found that the relevant technology only supports automatic ordering testing for one ordering strategy alone. Summary of the invention
[0004] The disclosed embodiment provides an automatic order placement testing solution that supports multiple order placement strategies.
[0005] Some embodiments of the present disclosure provide an order testing method, including:
[0006] Receive order test tasks;
[0007] According to the order scenario parameters and order strategy parameters of the order test task, obtain the order script project corresponding to the order test task;
[0008] According to the order strategy parameters of the order test task, select the order test tool corresponding to the order test task;
[0009] According to the order script project and order test tool corresponding to the order test task, dispatch the corresponding test machine to execute the order test task; and
[0010] Get the execution result of the order test task.
[0011] In some embodiments, obtaining the order script project corresponding to the order test task includes: selecting order scenario data corresponding to the order scenario parameters and order strategy scripts corresponding to the order strategy parameters from the test basic data according to the order scenario parameters and order strategy parameters of the order test task; and assembling the order scenario data and the order strategy script into the order script project corresponding to the order test task.
[0012] In some embodiments, obtaining the order script project corresponding to the order test task includes: obtaining the latest version of the order script project of the order test task from a distributed version control system according to the order scenario parameters and order strategy parameters of the order test task.
[0013] In some embodiments, selecting the order testing tool corresponding to the order testing task includes: if the order strategy parameters of the order testing task belong to the order strategy of a mobile-related application, mini-program or web page, selecting a mobile-side testing tool; or, if the order strategy parameters of the order testing task belong to the order strategy related to a Web application, selecting a browser-based Web application testing tool.
[0014] In some embodiments, the order script project includes: an operation class and a recording file, wherein the recording file is configured to record the operation information of the script in the order script project when the operation class is executed, and is uploaded to the public service after execution; wherein, obtaining the execution result of the order test task includes: obtaining the recording file of the order test task from the public service, and obtaining the execution result of the order test task from the recording file of the order test task.
[0015] In some embodiments, it also includes: if the device executing the order test method and the test machine executing the order test task are located in different networks, a websocket channel for transmitting information is established between the device executing the order test method and the browser of the test machine executing the order test task; wherein, scheduling the corresponding test machine to execute the order test task includes: the device executing the order test method sends the information of the order test task to the browser of the corresponding test machine through the websocket channel, and the browser of the test machine forwards the information of the order test task to the local service of the test machine, so that the test machine executes the order test task.
[0016] In some embodiments, it also includes: the device executing the order testing method establishes an independent websocket channel with each test machine of the mobile terminal type, which is used to transmit the information of the order testing task, the video screenshot of the execution process and the execution results, and creates an independent display position on the screen for each test machine of the mobile terminal type, which is used to display the monitoring information of the test machine of the corresponding mobile terminal type, wherein the monitoring information includes the video screenshot of the execution process of the single test task.
[0017] In some embodiments, the ordering strategy corresponding to the ordering strategy parameters includes: an application program of a mobile terminal, a small program of a mobile terminal, a web page of a mobile terminal, a web page of a personal computer, and an interface.
[0018] Some embodiments of the present disclosure provide a device for executing an order testing method, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the order testing method of any one of the embodiments based on instructions stored in the memory.
[0019] Some embodiments of the present disclosure propose an order testing system, comprising: a device for executing an order testing method, and a testing machine, configured to execute the order testing task according to information of the order testing task indicated by the device for executing the order testing method, and return the execution result of the order testing task.
[0020] Some embodiments of the present disclosure provide a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the order testing method of any embodiment. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. The present disclosure can be more clearly understood according to the following detailed description with reference to the drawings.
[0022] Obviously, the drawings described below are only some embodiments of the present disclosure, and a person skilled in the art can obtain other drawings based on these drawings without creative work.
[0023] Figure 1 A schematic flow chart showing an order testing method according to some embodiments of the present disclosure.
[0024] Figure 2 A schematic diagram of a test order placement system according to some embodiments of the present disclosure is shown.
[0025] Figure 3 A schematic diagram showing the software architecture of an order testing system according to some embodiments of the present disclosure is shown.
[0026] Figure 4 A schematic diagram of a device for executing an order testing method according to some embodiments of the present disclosure. DETAILED DESCRIPTION
[0027] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure.
[0028] Figure 1 A flowchart of an order testing method according to some embodiments of the present disclosure is shown. The order testing method may be executed by a device (such as a server) for executing the order testing method, but is not limited to the examples given.
[0029] like Figure 1 As shown, the order testing method of this embodiment includes: steps 110-150.
[0030] In step 110, an order for a test task is received.
[0031] The order test task may be, for example, a timed-triggered order test task or a temporarily formulated order test task.
[0032] The order test task can be determined, for example, according to various service functions of the order system that need to be tested. The order test task can be formulated, for example, by a tester.
[0033] The order test task can, for example, specify task information such as corresponding order scenario parameters and order strategy parameters.
[0034] Among them, the order scenarios corresponding to the order scenario parameters include, for example: selected product method (such as business method and link method), business scenario (such as scenario collection page, recommendation collection page, product acquisition, celebrity store, etc.), promotion link method (such as automatically obtaining online promotion links or passing links from parameterized data), whether in the same store or across stores, order terminal type (such as Android, iOS or PC, etc.), order terminal operating system bit number (such as 32-bit and 64-bit), order terminal manufacturer type, product type, etc., but not limited to the examples given.
[0035] Among them, the order strategies corresponding to the order strategy parameters include, for example: applications on mobile terminals (referred to as APP side), mini-programs on mobile terminals, web pages on mobile terminals (referred to as M side), web pages on personal computers (referred to as Web side), interfaces, etc., but are not limited to the examples given.
[0036] In step 120, an order script project corresponding to the order test task is obtained according to the order scenario parameters and the order strategy parameters of the order test task.
[0037] In some embodiments, obtaining the order script engineering corresponding to the order test task includes: selecting order scenario data corresponding to the order scenario parameters and order strategy scripts corresponding to the order strategy parameters from the test basic data according to the order scenario parameters and order strategy parameters of the order test task, and assembling the order scenario data and order strategy scripts into the order script engineering corresponding to the order test task. The test basic data, for example, includes all order scenario data and order strategy scripts for various possible order test tasks.
[0038] Through parameterized assembly, order scenario data and order strategy scripts related to a certain order test task are selected from the test basic data, and assembled to form an order script project corresponding to the order test task. The order script project corresponding to each single test task can be obtained quickly and conveniently.
[0039] In some embodiments, various versions of the order script project of the order test task can be uploaded to a distributed version control system (such as Git, an open source distributed version control system). During subsequent testing, the latest version of the order script project of the order test task is obtained from the distributed version control system based on the order scenario parameters and order strategy parameters of the order test task.
[0040] Therefore, in the distributed order testing scenario, the version management of the order script project is implemented to obtain the latest version of the order script project.
[0041] Among them, the order script project includes: scripts, running classes and recording files, etc., among which the recording files are configured to record the running information of the scripts in the order script project when the running class is executed, and can be uploaded to the public service after execution, so that the device that executes the order test method can obtain the recording file of the order test task from the public service.
[0042] In step 130, an order testing tool corresponding to the order testing task is selected according to the order strategy parameters of the order testing task.
[0043] In some embodiments, selecting an order testing tool corresponding to the order testing task includes: if the order policy parameters of the order testing task belong to the order policy of a mobile-related application, mini-program or web page, selecting a mobile-side testing tool (such as Airtest, an open source mobile-side automated testing tool); or, if the order policy parameters of the order testing task belong to the order policy related to a Web application, selecting a browser-based Web application testing tool (such as Selenium, an open source browser-based automated testing tool); if the order policy parameters of the order testing task belong to the order policy related to the interface type, the order testing tool may not be used.
[0044] In step 140, according to the order script project and order test tool corresponding to the order test task, the corresponding test machine is scheduled to execute the order test task.
[0045] The test machine uses the order test tool to execute the order test task according to the order script project and the order test tool corresponding to the order test task. After the test machine obtains the relevant information of the order test task, the specific process of executing the order test task can refer to the relevant technology, which will not be repeated here.
[0046] In some embodiments, if the device that executes the order test method and the test machine that executes the order test task are located in different networks, for example, in an intranet and an extranet respectively, in order to facilitate the communication between the device that executes the order test method and the test machine that executes the order test task, a websocket channel for transmitting information can be established between the device that executes the order test method and the browser of the test machine that executes the order test task. Then, scheduling the corresponding test machine to execute the order test task includes: the device that executes the order test method sends the information of the order test task to the browser of the corresponding test machine through the websocket channel, and the browser of the test machine forwards the information of the order test task to the local service of the test machine, so that the test machine executes the order test task. Thereby, the test is not restricted by the location, and the test can be performed in both the internal and external networks.
[0047] In step 150, the execution result of the order test task is obtained.
[0048] In some embodiments, obtaining the execution result of the order test task includes: obtaining a record file of the order test task from the public service, and obtaining the execution result of the order test task from the record file of the order test task.
[0049] In addition, if the test machine is a mobile terminal (such as a mobile phone, etc.), in order to manage multiple test machines of the mobile terminal type, the device that executes the order test method establishes an independent websocket channel with each test machine of the mobile terminal type, which is used to transmit the information of the order test task, the video screenshot of the execution process and the execution result, and creates an independent display position on the screen for each test machine of the mobile terminal type, which is used to display the monitoring information of the test machine of the corresponding mobile terminal type, wherein the monitoring information includes the video screenshot of the execution process of a single test task or the test machine status and other information. Thus, the test execution of multiple mobile terminals can be monitored through one screen.
[0050] In the above embodiment, according to the order scenario parameters and order strategy parameters of the order test task, an order script project corresponding to the order test task is obtained, according to the order strategy parameters of the order test task, an order test tool corresponding to the order test task is selected, according to the order script project and order test tool corresponding to the order test task, a corresponding test machine is scheduled to execute the order test task, and the execution result of the order test task is obtained, thereby realizing an automatic order test solution that supports multiple order strategies.
[0051] Figure 2 A schematic diagram of a test order placement system according to some embodiments of the present disclosure is shown.
[0052] like Figure 2As shown, the order testing system 200 of this embodiment includes: a device 210 for executing the order testing method, and at least one testing machine 220.
[0053] The device 210 for executing the order testing method is configured to receive an order testing task; obtain an order script project corresponding to the order testing task according to the order scenario parameters and order strategy parameters of the order testing task; select an order testing tool corresponding to the order testing task according to the order strategy parameters of the order testing task; schedule a corresponding test machine to execute the order testing task according to the order script project and order testing tool corresponding to the order testing task; and obtain the execution result of the order testing task.
[0054] The testing machine 220 is configured to execute the order testing task according to the information of the order testing task indicated by the device 210 for executing the order testing method, and return the execution result of the order testing task.
[0055] Figure 3 A schematic diagram showing the software architecture of an order testing system according to some embodiments of the present disclosure is shown.
[0056] like Figure 3 As shown, the software architecture 300 of the order testing system 200 includes: a data layer 310 , a service layer 320 , a scheduling layer 330 , a business layer 340 and an output layer 350 .
[0057] The data layer 310 , the service layer 320 , the scheduling layer 330 and the output layer 350 may be deployed on the device 210 that executes the order testing method, and the business layer 340 may be deployed on the test machine 220 .
[0058] The data layer 310 includes, for example, test data TestData and test scripts TestScript and other test basic data. The test data provides data required for various ordering scenarios (i.e., ordering scenario data), and the test script provides scripts for various ordering strategies (i.e., ordering strategy scripts). The examples of ordering scenarios and ordering strategies are described above and will not be repeated here.
[0059] The service layer 320 includes, for example, mobile terminal testing tools (such as Airtest), Web application testing tools (such as Selenium), data storage service DataStore, intranet and intranet communication services, mobile terminal (such as mobile phone) management services, etc. Each part is described below.
[0060] Mobile testing tools (such as Airtest or AirtestLib) support the automated order scripts for the APP, mini-program, and M ends of mobile devices based on the Airtest framework. After the Airtest script is developed, an order script project file ending with .air is formed. During runtime, the folder ending with .air is read by default to obtain the order script project. A running class and a record file (such as a ymal file) are created in the order script project. The record file is configured to record the running information of the script in the order script project when the running class is executed, such as the running order of the script and the script that needs to be run, etc., and can be uploaded to the public service after execution, so that the record file can be obtained from the public service later and the execution status of the script can be known.
[0061] Web application testing tools (such as Selenium) can provide automated ordering services for Web applications running on personal computers (PCs).
[0062] The data storage service DataStore organizes and stores order scenario data and order policy scripts related to certain order test tasks based on the test basic data provided by the data layer. Testers can organize their own order test tasks according to business characteristics. For example, they can group the test scenarios of the same module or the same business line into a category of order test tasks by classification, and provide management functions such as adding, deleting, modifying and querying order test tasks.
[0063] Intranet and extranet communication services are used to solve communication problems between intranets (such as production environments) and extranets (such as office environments). A websocket channel for transmitting information is established between the browsers of intranet devices (such as devices that execute the order test method) and extranet devices (such as test machines that execute the order test task). The intranet device (such as devices that execute the order test method) sends the information of the order test task to the browser of the corresponding extranet device (such as the test machine that executes the order test task) through the websocket channel, and the browser of the extranet device (such as the test machine that executes the order test task) forwards the information of the order test task to the local service of the extranet device (such as the test machine that executes the order test task) so that the extranet device (such as the test machine that executes the order test task) executes the order test task.
[0064] The mobile terminal management service manages mobile terminals such as mobile phones (Android and iOS) deployed in the system in real time. Develop a device list interface and implementation to return information such as the model, system, device identifier UDID, status, resolution, IP, and power of the mobile terminal. The device that executes the order test method and each test machine of the mobile terminal type establish an independent websocket channel for transmitting the information of the order test task, the video screenshot of the execution process, and the execution result, and create an independent display position on the screen for each test machine of the mobile terminal type to display the monitoring information of the corresponding mobile terminal type test machine, wherein the monitoring information includes a video screenshot of the execution process of the single test task. Thus, the number of mobile terminals such as mobile phones connected to the device 210 that executes the order test method is monitored in real time, and multiple mobile terminals are remotely controlled, and multiple mobile terminal screens are displayed on one computer screen, and the status of each mobile terminal and the use case execution site are remotely monitored in real time. Among them, the remote control of the Android mobile terminal can be implemented based on minicap+minitouch+atx-agent, and the remote control of the iOS mobile terminal can be implemented based on the WebDriverAgent of appium fork. Because appium has added the function of MJPEG Server in WDA. The service is built using the Python-based lightweight web framework Tornado, which can support asynchronous non-blocking IO processing requests and has excellent load resistance. The display front end can use the Vue language to create the video stream position displayed on the screen of each mobile phone, and bind and trigger the creation of the WebSocket communication service of each mobile phone according to the ID element of the display position of each mobile phone, ensuring that the video stream service displayed on each mobile phone is independent and does not affect each other. In addition, the imagepool thread pool can be used to trigger the picture stream to ensure the smoothness of the mobile phone screen display.
[0065] The scheduling layer 330 schedules, distributes and manages the order test tasks through continuous integration tools (such as Jenkins). Among them, the order test task can be, for example, a timed triggered order test task or a temporarily formulated order test task. For the order test task, the order scenario data and the scripts to be run and the running order of the specified scripts are selected based on the test basic data of the data layer, and the order script projects such as the order scenario data and order strategy scripts related to the order test task can be stored in the data storage service DataStore, thereby realizing task management. When the test starts, Jenkins pulls the order script project corresponding to the order test task from the data storage service DataStore and sends it to the test machine, so that the test machine uses the order test tool to execute the order test task according to the order script project, and uploads the record file recording the execution result of the order test task to the public service. After the test is completed, Jenkins can obtain the record file from the public service to obtain the execution result of the order test task.
[0066] The business layer 340 executes the order test task according to the task information such as the order script project of the order test task indicated by the scheduling layer 330. The order test task is divided into two modes: automated timing scenario and customized scenario. According to the order strategy, the order test tasks of APP, mini-programs and M-end are executed on the mobile terminal type test machine, the order test tasks of the web end are executed on the PC browser type test machine, and the order test tasks at the interface level are executed based on the interface of the business system. While the business layer 340 executes the order test task, the service layer 320 can collect logs to facilitate the investigation of the causes of abnormal problems during the task execution and to review the execution process of each task.
[0067] The output layer 350 outputs the execution result of the order test task. After the task is executed, the execution result is copied to this public service. By accessing the public service, the execution result of the order test task can be accessed. The execution result of the order test task can also be sent to relevant personnel in the form of an email. The execution result of the order test task includes the script execution log of the entire running process, screenshots of each step, test reports, order details, etc.
[0068] The following describes the order testing process.
[0069] First, open an order interface, which can include information such as order scenario parameters and order strategy parameters, for example, {"id":1,"PromotionLinksType":1,"PromotionLinks":"http: / / www.jd.com","BusinessType":"1","policy":"app"}, where id represents the ID of the order test task, PromotionLinksType represents the promotion link type, PromotionLinks represents the promotion link, BusinessType represents the order scenario type, and policy represents the order strategy.
[0070] Then, the data storage logic is generated, that is, the scheduling layer 330 generates a piece of data for the order test task according to the parameters of the order test task transmitted by the order interface, which is used to record these parameters, assemble the order scenario data and the order strategy script corresponding to the parameters into the order script project corresponding to the order test task, and send it to the corresponding test machine for execution. Among them, the various parameters of the order test task and the order script project can be stored in the data storage service of the service layer 320.
[0071] Then, the test machine executes the order test task according to the order script project, and the execution result of the order test task, for example, success or failure, can be updated to the data record corresponding to the order test task in the data storage service of the service layer 320.
[0072] The following describes the web-based order testing process.
[0073] The scheduling layer 330 Jenkins receives the order test task (customized order test task or scheduled order test task), and obtains the order script project corresponding to the order test task according to the order scenario parameter and the order strategy parameter "web end" of the order test task (if it is a customized order test task, the order script project corresponding to the order test task is generated based on the test basic data provided by the data layer 310, and stored in the data storage service of the service layer 320; if it is a scheduled order test task, the order script project corresponding to the order test task is obtained from the data storage service of the service layer 320), and selects the order test tool "Selenium" corresponding to the order test task according to the order strategy parameter "web end" of the order test task, and schedules the personal computer type test machine of the business layer 340 to execute the order test task according to the order script project and order test tool corresponding to the order test task. The personal computer type test machine is connected to the Selenium Server through the corresponding browser driver, and a session is created after the connection. The browser of the personal computer type test machine sends the Http request related to the order test task to the Selenium Server through HTTP (Hyper Text Transfer Protocol). The Selenium Server parses the Http request and then sends the JS command through the Http Proxy to notify the Selenium Core to execute the action of operating the browser. The browser of the personal computer type test machine receives the new page request information, so it sends an Http request to request a new web page. The Selenium Server will receive all requests sent by the browser started by it. After receiving the Http request sent by the browser, the Selenium Server reorganizes the Http request and obtains the corresponding web page. The Http Proxy of the Selenium Server returns the received web page to the browser, including the result of success or failure. Finally, the front-end display function of the output layer 350 is used to display the execution results, including order details, order reports, screenshots, and logs, etc., which can be used to view the detailed order process and analyze the reasons for the failed order scenario.
[0074] The following describes the order testing process for the mobile APP, mini program and M side.
[0075] The scheduling layer 330Jenkins receives the order test task (customized order test task or scheduled order test task), determines that the test machine is a mobile terminal type test machine (such as a mobile phone) according to the order strategy parameters of the order test task (such as mobile APP), and monitors whether there is a mobile phone connected in the current network. If not, it returns an exception prompt. If so, it continues to the next step. Because the mobile phone and the device that executes the order test method are usually located in different networks such as the external network and the internal network, the internal and external network communication services of the service layer 320 are used to establish communication between the device that executes the order test method and the mobile phone. The scheduling layer 330Jenkins obtains the order script project corresponding to the order test task according to the order scenario parameters and order strategy parameters (such as mobile APP) of the order test task (specifically refer to the web-side order test process), selects the order test tool "Airtest" corresponding to the order test task according to the order strategy parameter "mobile APP" of the order test task, and then operates and views the mobile terminals (such as mobile phones) in the current network in real time through the mobile terminal management service of the service layer 320, selects the mobile terminal to execute the order test task according to the mobile terminal type (such as Android, iOS, etc.) specified by the order scenario parameters, and then, according to the order script project and order test tool corresponding to the order test task, schedules the selected test machine (such as mobile phone) of the mobile terminal type of the business layer 340 to execute the order test task. Finally, the front-end display function of the output layer 350 is used to display the execution results, including order details, order reports, screenshots, and logs, etc., which can be used to view the detailed order process and analyze the reasons for the failed order scenario.
[0076] In addition, the execution status of multiple mobile phones can be monitored through one screen. The browser of the monitoring device (such as the device that executes the order test method) starts the Android canvas or iOS canvas according to the type of the test machine (mobile phone), which is Android or iOS; after the Android canvas is started, the Android mirror display method is called, and then the separate websocket service of this mobile phone is triggered; after the iOS canvas is started, the iOS mirrordisplay method is called, and then the separate websocket service of this mobile phone is triggered; each mobile phone has its own imagepool and image stream, which are synchronized to the browser of the monitoring device in real time through their own websocket services, and the real-time status of each mobile phone is presented independently, and different mobile phones do not interfere with each other, thereby realizing the real-time viewing of the execution status of multiple mobile phones in one browser.
[0077] The following describes the order testing process based on the interface.
[0078] The scheduling layer 330 Jenkins receives the order test task (customized order test task or scheduled order test task), obtains the order script project corresponding to the order test task according to the order scenario parameters and order strategy parameter "interface" of the order test task (specifically refer to the web-side order test process), and schedules the interface of the business layer 340 to execute the order test task according to the order strategy parameter "interface" of the order test task, without the help of the order test tool, according to the order script project corresponding to the order test task. Finally, the front-end display function of the output layer 350 is used to display the execution results, including order details, order reports, screenshots, and logs, etc., which can be used to view the detailed order process and analyze the reasons for the failed order scenario. In some embodiments, the test can be executed based on the Maven solution, and the test results are finally output. The detailed process is: when Maven test is executed, it is scheduled to execute based on TestNG's multi-threading, and the order scenario script is composed of a suite of multiple order scripts written based on XML, and the test script corresponding to the scenario is executed through the corresponding scenario. When executing the script, there are two ways to provide incoming parameters: Parameter incoming parameters and DataProvider incoming parameters. Rest-Asserd organizes the HTTP interface request, parses the request result after the request, and then asserts the request result to determine whether the order is successful. At the same time, in the interface order module, a series of tool classes can be encapsulated, such as Cookie&oAuthToken public class (to implement login authentication), file reading and writing class (general file reading and writing method class), retry mechanism (i.e. re-execution after failure) and environment management (environmental parameter management class for test environment and online environment).
[0079] Figure 4 A schematic diagram of a device for executing an order testing method according to some embodiments of the present disclosure.
[0080] like Figure 4 As shown, the device 210 for executing the order testing method of this embodiment includes: a memory 410 and a processor 420 coupled to the memory 410, and the processor 420 is configured to execute the order testing method in any of the aforementioned embodiments based on instructions stored in the memory 410.
[0081] For example, receiving an order test task; obtaining an order script project corresponding to the order test task according to the order scenario parameters and order strategy parameters of the order test task; selecting an order test tool corresponding to the order test task according to the order strategy parameters of the order test task; scheduling a corresponding test machine to execute the order test task according to the order script project and order test tool corresponding to the order test task; and obtaining the execution result of the order test task.
[0082] The memory 410 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs.
[0083] The device 210 for executing the order test method may also include an input / output interface 430, a network interface 440, a storage interface 450, etc. These interfaces 430, 440, 450 and the memory 410 and the processor 420 may be connected, for example, via a bus 460. The input / output interface 430 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 440 provides a connection interface for various networked devices. The storage interface 450 provides a connection interface for external storage devices such as SD cards and USB flash drives.
[0084] The disclosed embodiments further provide a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the order testing method of any embodiment.
[0085] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more non-transient computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer program code.
[0086] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0087] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0089] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.
Claims
1. A method for placing an order, characterized in that: include: Receive order test tasks; According to the order scenario parameters and order strategy parameters of the order test task, an order script project corresponding to the order test task is obtained, wherein the obtaining of the order script project corresponding to the order test task comprises: according to the order scenario parameters and order strategy parameters of the order test task, order scenario data corresponding to the order scenario parameters and order strategy scripts corresponding to the order strategy parameters are selected from the test basic data, and the order scenario data and the order strategy script are assembled into the order script project corresponding to the order test task, wherein the order script project comprises a running class and a record file, and the record file is configured to record the running information of the script in the order script project when the running class is executed, and is uploaded to the public service after the execution is completed; According to the order strategy parameters of the order test task, select the order test tool corresponding to the order test task; According to the order script project and order test tool corresponding to the order test task, dispatch the corresponding test machine to execute the order test task; and Obtaining the execution result of the order test task includes: obtaining a record file of the order test task from the public service, and obtaining the execution result of the order test task from the record file of the order test task.
2. The method according to claim 1, characterized in that The order script project corresponding to the order test task includes: According to the order scenario parameters and order strategy parameters of the order test task, the latest version of the order script project of the order test task is obtained from the distributed version control system.
3. The method according to claim 1, characterized in that The order testing tools corresponding to the order testing task include: If the order strategy parameters of the order test task belong to the order strategy of a mobile-related application, mini-program or webpage, select a mobile-side testing tool; or, If the order policy parameter of the order test task belongs to an order policy related to a Web application, a browser-based Web application testing tool is selected.
4. The method according to claim 1, characterized in that Also includes: If the device executing the order test method and the test machine executing the order test task are located in different networks, a websocket channel for transmitting information is established between the browser of the device executing the order test method and the test machine executing the order test task; Among them, scheduling the corresponding test machine to execute the order test task includes: the device executing the order test method sends the information of the order test task to the browser of the corresponding test machine through the websocket channel, and the browser of the test machine forwards the information of the order test task to the local service of the test machine, so that the test machine executes the order test task.
5. The method according to claim 1, characterized in that: Also includes: The device that executes the order testing method establishes an independent websocket channel with each test machine of the mobile terminal type, which is used to transmit the information of the order testing task, the video screenshot of the execution process and the execution results, and creates an independent display position on the screen for each test machine of the mobile terminal type to display the monitoring information of the corresponding mobile terminal type test machine, wherein the monitoring information includes the video screenshot of the execution process of the single test task.
6. The method according to any one of claims 1 to 5, characterized in that: The order placement strategies corresponding to the order placement strategy parameters include: an application program of a mobile terminal, a small program of a mobile terminal, a web page of a mobile terminal, a web page of a personal computer, or an interface.
7. A device for executing an order testing method, comprising: Memory; as well as A processor coupled to the memory, the processor being configured to execute the order testing method according to any one of claims 1 to 6 based on instructions stored in the memory.
8. An order testing system, comprising: The device for executing the order testing method according to claim 7, and The testing machine is configured to execute the order testing task according to the information of the order testing task indicated by the device for executing the order testing method, and return the execution result of the order testing task.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the order testing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Performance testing method and platform
CN108845949A
Transaction scene test method and device, electronic equipment and readable storage medium
CN110377520A