WO2018184361A1 - Application test method, server, terminal, and storage media - Google Patents
Application test method, server, terminal, and storage media Download PDFInfo
- Publication number
- WO2018184361A1 WO2018184361A1 PCT/CN2017/102987 CN2017102987W WO2018184361A1 WO 2018184361 A1 WO2018184361 A1 WO 2018184361A1 CN 2017102987 W CN2017102987 W CN 2017102987W WO 2018184361 A1 WO2018184361 A1 WO 2018184361A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- test
- script
- pos application
- simulated
- interface
- Prior art date
Links
- 238000010998 test method Methods 0.000 title description 3
- 238000012360 testing method Methods 0.000 claims abstract description 697
- 238000013515 script Methods 0.000 claims abstract description 433
- 238000004088 simulation Methods 0.000 claims description 46
- 238000000034 method Methods 0.000 claims description 24
- 239000012634 fragment Substances 0.000 claims description 23
- 238000012545 processing Methods 0.000 claims description 10
- 238000010586 diagram Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 10
- 230000009471 action Effects 0.000 description 6
- 230000000977 initiatory effect Effects 0.000 description 4
- 238000009434 installation Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 239000003795 chemical substances by application Substances 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000013100 final test Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3696—Methods or tools to render software testable
Definitions
- the present application relates to the field of computer technologies, and in particular, to an application testing method, a server, a terminal, and a storage medium.
- an application testing method a server, a terminal, and a storage medium are provided.
- An application testing method that includes:
- a server comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
- One or more non-transitory readable storage mediums storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:
- An application testing method that includes:
- Sending the test script to a server causing the server to send the test script to a test executor when the test script needs to be executed, so that the test executor executes the test script.
- a terminal comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
- Sending the test script to a server causing the server to send the test script to a test executor when the test script needs to be executed, so that the test executor executes the test script.
- One or more non-transitory readable storage mediums storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:
- the test script is sent to the test executor to cause the test executor to execute the test script.
- FIG 1 is an application environment diagram of an application testing method in an embodiment
- FIG. 2 is a schematic diagram showing the internal structure of a server in an embodiment
- FIG. 3 is a schematic diagram showing the internal structure of a terminal in an embodiment
- FIG. 5 is a structural diagram of a simulation environment system when an application testing method is implemented in an embodiment
- FIG. 6 is a schematic flowchart of a test script generation step in an embodiment
- FIG. 7 is a schematic flowchart of a second script segment generating step in an embodiment
- FIG. 8 is a schematic flow chart of an application testing method in another embodiment
- FIG. 9 is a structural block diagram of a server in an embodiment
- Figure 10 is a block diagram showing the structure of a server in another embodiment
- Figure 11 is a block diagram showing the structure of a terminal in an embodiment.
- FIG. 1 is an application environment diagram of an application testing method in an embodiment.
- the environment includes a server 110, a terminal 120, and a test executor 130, and the server 110, the terminal 120, and the test executor 130 are network-connected.
- the test executor 130 is a device having a function of running a test script, and the test executor 130 may be implemented by hardware or by software.
- the terminal 120 is a terminal capable of parsing webpage data. For example, a browser may be installed in the terminal, or a client having a browser function may be installed.
- the terminal 120 can be different from the POS terminal.
- a POS terminal is a terminal that can run a POS application to implement a payment function. It should be noted that terminals that are not specifically limited in the following embodiments refer to the terminal 120.
- the server 110 may send the webpage data of the simulated POS application obtained by simulating the native POS application to the terminal 120, so that the terminal 120 parses the webpage data of the simulated POS application, and generates a corresponding emulated POS terminal interface and an emulated POS application interface. .
- the server 110 can acquire a corresponding test script generated by recording an operation acting on the emulated POS terminal interface and emulating the POS application interface, and send the test script to the test executor 130 to cause the test executor 130 to execute the test script.
- the server includes a processor, a non-volatile storage medium, an internal memory, and a network interface connected by a system bus.
- the non-volatile storage medium of the server stores an operating system and computer readable instructions that, when executed, cause the processor to perform an application testing method.
- This processor is used to provide computing and control capabilities to support the operation of the entire server.
- the internal memory can store computer readable instructions that, when executed by the processor, cause the processor to perform an application testing method.
- the network interface is used to connect to the network for communication, such as sending test scripts over the network.
- the server can be a stand-alone physical server or a server cluster composed of multiple physical servers.
- FIG. 3 is a schematic diagram showing the internal structure of a terminal in an embodiment.
- the terminal includes a processor connected through a system bus, a non-volatile storage medium, an internal memory, a network interface, a display screen, and an input device.
- the non-volatile storage medium of the terminal stores an operating system and computer readable instructions that, when executed, cause the processor to execute an application testing method.
- the processor is used to provide computing and control capabilities to support the operation of the entire terminal.
- Computer readable instructions may be stored in the internal memory, the computer readable instructions being executable by the processor to cause the processor to perform an application testing method.
- the network interface is used to connect to the network for communication.
- the display screen of the terminal may be a liquid crystal display or an electronic ink display.
- the input device of the terminal may be a touch layer covered on the display screen, or may be a button, a trackball or a touchpad provided on the terminal housing, or may be An external keyboard, trackpad, or mouse.
- the terminal may be a personal computer, a mobile terminal, or an in-vehicle device, and the mobile terminal includes at least one of a mobile phone, a tablet, a personal digital assistant, or a wearable device.
- FIG. 2 or 3 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation of a server or a terminal to which the solution of the present application is applied, and specific
- the server or terminal may include more or fewer components than shown in the figures, or some components may be combined, or have different component arrangements.
- an application testing method is provided. This embodiment is mainly illustrated by applying the method to the server in FIG. 2 described above. Referring to FIG. 4, the application testing method specifically includes the following steps:
- S402 Send webpage data of the simulated POS application obtained by simulating the native POS application to the terminal, so that the terminal parses the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS application interface.
- the native POS application is a real application for running a payment function in a physical POS terminal.
- Native POS applications can be POS applications in web format.
- the native POS application can be a POS application in the Html5 (Hyper Text Markup Language Version 5) format.
- the emulated POS application is a POS application that is obtained by emulating a native POS application and capable of running in a browser for implementing the functionality of a native POS application. It can be understood that multiple native POS applications can be separately simulated to obtain a corresponding simulated POS application.
- the method before step S402, the method further includes: acquiring webpage data of the native POS application; adding corresponding POS application emulation interface data and emulating POS terminal interface data in the webpage data of the native POS application, Get the number of web pages for the simulated POS application according to.
- the POS application emulation interface is an emulation interface obtained by simulating the interface of the native POS application for implementing the functions.
- the POS application emulation interface includes at least one of a simulation interface for communicating with the POS terminal, an emulation interface for communicating with the transaction background, and an emulation interface for implementing logical computing.
- the simulation POS terminal interface data is simulation data of the POS terminal interface obtained by performing simulation processing on the physical POS terminal.
- the simulation POS terminal interface may include a screen simulation area, a keyboard simulation area, a card simulation area, and a printer receipt simulation area, and the screen simulation area may be used to display an interface of the simulated POS application.
- the emulation POS terminal interface may also be a structure that can display a keyboard emulation area or a swipe emulation area in the screen emulation area, and can be replaced by a screen touch function or a display recognition function.
- a keyboard area for touch input can be displayed in the screen emulation area in the emulation POS terminal interface. It can be understood that different native POS applications can correspond to different emulated POS terminal interfaces.
- the server may also simulate the transaction background of the transaction data interaction with the simulated POS application, and obtain the simulated transaction background.
- the server can form a simulation environment based on the simulation transaction background, the interface of the simulated POS terminal, the simulated POS application, and the POS application simulation interface.
- Figure 5 is a system architecture diagram of a simulation environment in one embodiment.
- the interface layer is used to provide an interface entry for the simulation application, and the POS application interface simulation layer communicates with the simulation transaction background for transaction data communication.
- the server can also perform simulation processing on the transaction background. After the webpage data of the simulation POS application is loaded into the terminal, the transaction data can be directly interacted with the real transaction background through the simulation interface.
- the recording operation refers to real-time monitoring and recording operations.
- Recording operations on the simulated POS terminal interface and emulating the POS application interface refer to real-time monitoring and recording of operations on the simulated POS terminal interface and the simulated POS application interface.
- the user can request a test case corresponding to the native POS application or the simulated POS application from the terminal through the terminal, and return the corresponding preset test case according to the server, simulate the POS terminal interface and simulate The corresponding operation is performed on the POS application interface, and the server or terminal records the operation acting on the emulated POS terminal interface and emulating the POS application and matching the returned preset test case.
- the server can record actions that act on the emulated POS terminal interface and emulate the POS application interface to generate test scripts.
- the server may also receive operation data recorded by the terminal and act on the simulated POS terminal interface and the simulated POS application interface, parse the received recording operation data, and generate a test script.
- the server can also directly receive the corresponding test script generated by the terminal by recording the operation on the simulated POS terminal interface and emulating the POS application interface.
- the test executor is a device with a test script running function.
- the test executor can be a terminal on which a test agent is installed. Test the agent to execute the test script and generate test results.
- the server can deliver the test script to one or more test executors and cause one or more test executors to execute the issued test script.
- the server can also automatically add one or more test scripts to the task queue according to the test task issuing request or according to the preset task delivery rule, and send it to the test executor.
- Test executors can run in real-world environments or in simulation environments. When the test executor is running in the simulation environment, the test executor can execute the test script, send instructions to the emulated POS application in the server, and test the emulated POS application.
- the above application test method generates a corresponding test script by recording an operation on the simulated POS terminal interface and simulating the POS application interface, and sends the test script to the test executor for execution.
- Test scripts can be executed automatically based on the test executor, without manual manual steps, step by step, improving test efficiency.
- a test script is generated, which realizes the free installation of the physical POS terminal and the POS application, thereby saving the test cost.
- step S404 (refer to the test script generation step for short) specifically includes the following steps:
- the recording operation on the simulated POS terminal interface and the simulated POS application interface may be all operations performed by the recording user on the simulated POS terminal interface and the simulated POS application interface, including screen operations, keyboard operations, or card swipe operations.
- the server can monitor and record the operations on the simulated POS terminal interface and the simulated POS application interface in real time. For example, the user operates on the simulated POS terminal interface and the simulated POS application interface displayed on the terminal, and the terminal can notify the server of the operation on the simulated POS terminal interface and the simulated POS application interface in real time, and the server records the operation. .
- the server may also not record a preset reservation operation while recording operations on the emulated POS terminal interface and the emulated POS application interface.
- the preset hold operation is a preset action that is not recorded on the emulated POS terminal interface or the emulated POS application interface.
- the server may parse the recorded operation according to the syntax of the test script and convert it into a first script fragment.
- the server may combine the script fragments used to generate the test script with the corresponding script header information and the tail information to form a corresponding complete test script.
- the server may separately generate a corresponding test script according to the first script segment, or may generate a corresponding second script segment generated according to the selected preset comparison test item and the corresponding comparison test object according to the first script segment.
- Test script The comparison test item is used for comparing the comparison test object with the reference standard object to generate a comparison test result, for example, checking whether the element exists, whether the comparison element text is correct or the comparison application Check whether the program interface information is correct and compare the test items.
- the test object is a test object that is compared with a reference standard object, such as an application interface, The text or element corresponding to the element in the interface.
- the server may further receive an editing operation sent by the terminal to the test script generated in step S606, perform corresponding editing adjustment on the test script according to the editing operation, and obtain a final test according to the edited adjusted test script. script.
- the corresponding test script is automatically generated according to the user operation, so that the test executor can automatically perform the test processing according to the automatically generated test script. There is no need to manually perform manual test operations step by step, which improves the test efficiency.
- a test script is generated, which realizes the free installation of the physical POS terminal and the POS application, thereby saving the test cost.
- the method before generating a corresponding test script according to the first script segment, the method further includes a second script segment generating step, specifically including the following steps:
- the comparison test item is used for comparing the comparison test object with the reference standard object to generate a comparison test result, for example, checking whether the element exists, whether the comparison element text is correct or the comparison application Check whether the program interface information is correct and compare the test items.
- the reference standard object is the test record passed by the preset test.
- the reference standard object is used for comparison with the comparison test object to determine whether the test passes. It can be understood that the comparison test item is an additional test operation item added on the basis of the test related operation performed by the user. You can add or delete settings for test items based on actual needs.
- the user can trigger the selection of the preset comparison test item by a preset operation.
- the user may perform a trigger operation on the simulated POS terminal interface or the simulated POS application interface to generate a selection menu bar of the preset comparison test item, and the user selects a preset comparison test item from the menu bar.
- the terminal in turn notifies the server of the selected preset comparison test item.
- the triggering operation includes a right button operation or a pressing or clicking operation on the simulation screen area or the keyboard area.
- the comparison test object is a test object that is compared with the reference standard object, including Use the program interface, the elements in the interface or the text corresponding to the element.
- the server may obtain the selected corresponding comparison test object, or may be corresponding to the preset test item corresponding to the comparison test item. Compare the test object acquisition rules and automatically obtain the corresponding comparison test objects. For example, if the comparison test item is "whether the text of the comparison element is correct", the server can obtain the text of the element selected by the user to be checked. For another example, when the comparison test item is “comparison application interface information”, the corresponding comparison test object is the current interface information of the application, and the terminal can perform screen capture processing on the current display interface of the application to obtain the corresponding application current. The interface information can also be image scanned on the current display interface of the application to obtain the current interface information of the corresponding application.
- the above-mentioned trigger operation or selection operation on the preset comparison test item, and the comparison operation on the test object can be preset as a reserve operation, and the server can not record the preset reservation operations.
- the correspondence between the comparison test item and the script fragment template may be preset in the server, and the preset script fragment template corresponding to the selected preset comparison test item is obtained according to the correspondence.
- the preset script fragment template includes a script fragment for initiating a comparison test object acquisition action and initiating a comparison action.
- the server may substitute the acquired comparison test object into the obtained preset preset script segment template to generate a second script segment.
- the second script segment is used to compare the comparison test object with the corresponding standard reference object during execution to obtain a corresponding comparison test result.
- generating the corresponding test script according to the first script segment includes: generating a corresponding test script according to the first script segment and the second script segment.
- the server may execute the first script segment and the second script segment in accordance with the execution The logical order is combined to generate the corresponding test script. Specifically, the server may combine the first script segment and the second script segment in combination with the corresponding script header information and the tail information to form a corresponding complete test script.
- the corresponding second script segment is generated according to the comparison test object and the preset script segment template corresponding to the selected comparison test item, which is equivalent to the user being monitored. Based on the test related operations, some additional test operations are added, and the corresponding test script is generated by the first script segment corresponding to the user operation and the second script segment corresponding to the added preset comparison test item, so that the test operation is performed. More comprehensive and complete, thus improving the effectiveness of test results.
- step S406 includes: when the target object corresponding to the test script includes a physical POS terminal, sending a test script to the test executor connected to the physical POS terminal, so that the test executor executes the test script to the physical POS terminal. carry out testing.
- the physical POS terminal can connect to the test executor via a USB (Universal Serial Bus) or can be connected to the test executor through other connection methods.
- the connection can be sent to the physical POS terminal as long as it can satisfy the test executor when executing the test script.
- the target object corresponding to the test script is the object that is controlled according to the instructions initiated by the test script.
- the server sends the test script to the test executor, the target object corresponding to the test script can be detected.
- the test script is sent to the test executor connected to the physical POS terminal.
- the test executor executes the test script and generates corresponding instructions to test the physical POS terminal. There may be multiple physical POS terminals connected to the test executor.
- the test script is automatically executed by the test executor by sending the test script to the test executor connected to the physical POS terminal, so as to automatically test the physical POS terminal, compared to manually manually downloading the POS application.
- Test efficiency is improved in terms of physical POS terminals and manual testing.
- step S406 further includes: when the target object corresponding to the test script is a POS application, sending a test script to the test executor running in the simulation environment, so that the test executor running in the simulation environment performs the test Script to test the simulated POS application.
- the server may send the test script to the test executor running in the simulation environment.
- the test executor running in the simulation environment can execute the test script and generate corresponding instructions to test the simulated POS application in the simulation environment.
- the server when the test script is used for the application level test, the server sends the test script to the test executor running in the simulation environment to test the simulated POS application in the simulation environment.
- the physical POS terminal is implemented when testing the POS application, thereby avoiding the dependence of the POS application test on the physical POS terminal and saving the test cost.
- the test executor directly tests the simulated POS application without manual manual installation of the POS application and manual testing, thus improving test efficiency.
- the method further includes: receiving a regression test request, acquiring a test case corresponding to the regression test request; adding a test script corresponding to the corresponding test case to the test task queue, and sending the test task queue to the test task queue
- the test executor causes the test executor to execute the test script in the test task queue in turn for the regression test step.
- the test case corresponding to the regression test request refers to the test case requested for the regression test.
- the regression test request may include a test case identifier for the regression test, and the server obtains the corresponding test case according to the test case identifier.
- one test case may correspond to one or more test scripts
- the server may obtain a test script corresponding to the corresponding test case, and add the test script to the test task queue, and the test script in the test task queue is one or Multiple.
- the server sends the test task queue to the test executor.
- the test executor executes the test scripts in the test task queue in order according to the order of the test scripts in the test task queue for regression testing.
- the test script corresponding to the regression test request is added to the test task queue, and is sent to the test executor, so that the test executor executes the test script in turn to implement automation.
- the regression test does not require manual regression testing of all or part of the test scripts, improving the efficiency of regression testing.
- the server may set the corresponding test script to a shared state according to a preset sharing rule or a user-initiated test script sharing request.
- the shared state test script can be selected by any user with the test operation authority and added to the corresponding test task.
- the preset sharing rule may be a preset rule that sets a test script corresponding to any one or more native POS applications to a shared state.
- the user shares the request through a test script initiated by the terminal, or may be a request for sharing the test script corresponding to any one or more native POS applications.
- the server may set the test script corresponding to any one or more native POS applications to a shared state according to a preset sharing rule or a test script sharing request initiated by the user through the terminal.
- test scripts a, b, and c of the application 1 are shared, and the test scripts d and e of the application 2 are shared.
- Testers A, B, and C all have test operation rights, and testers A, B, and C can select test scripts a and b of application 1 through the terminal and add them to the corresponding test tasks, and the server executes the test tasks.
- the test scripts a and b are sent to the test executor, so that the test executor tests the application 1 according to the test scripts a and b.
- testers A, B, and C can also add test scripts d and e of application 2 to the corresponding test task through the terminal, and the server sends the test scripts d and e to the test executor accordingly.
- the test executor is tested against application 2 based on test scripts d and e.
- test script by setting the test script to the shared state, multiple users can execute the test script to improve the utilization of the test script. At the same time, recording a test script can achieve sharing, and avoids the waste of time and cost caused by repeated recording of test scripts by different users, thereby improving test efficiency.
- the method further includes: obtaining a test result reported by the test executor and generated according to the execution of the test script; and generating a corresponding test report according to the test result.
- the corresponding test can be generated. Test the results and report the test results to the server.
- the server can analyze the test results and generate corresponding test reports.
- the corresponding test report is automatically generated through the test result, so that when the test has a problem, the test problem can be known more timely, and the time cost waste caused by the manual analysis of the test result to obtain the test problem is avoided.
- an application testing method is provided. This embodiment is mainly applied to the terminal in FIG. 3 by using the method. Referring to FIG. 8, the application testing method specifically includes the following steps:
- the terminal receives webpage data of the simulated POS application obtained by performing simulation processing on the native POS application sent by the server.
- the user may request a preset test case corresponding to the native POS application or the simulated POS application from the terminal through the terminal, and return the corresponding test case according to the server, simulate the POS terminal interface and simulate The corresponding operation is performed on the POS application interface, and the terminal records the operation acting on the emulated POS terminal interface and emulating the POS application and matching the returned preset test case.
- the terminal can parse the recorded operation according to the syntax of the test script to generate a corresponding test script.
- the terminal may further receive an edit operation instruction for parsing the generated test script, and perform corresponding edit adjustment on the parsed test script in response to the edit operation instruction, according to the edited test script. Get the final test script.
- test script sending a test script to the server, so that when the server needs to execute the test script,
- the test script is sent to the test executor to cause the test executor to execute the test script.
- the above application test method generates a corresponding test script by recording an operation on the simulated POS terminal interface and emulating the POS application interface, and sends the test script to the server, so that the server can execute the test script when the test script needs to be executed. Send to the test executor and execute.
- the test script can be automatically executed according to the test executor, instead of manually repeating the operation step by step, which improves the test efficiency.
- the terminal loads and displays the corresponding simulated POS terminal interface and the simulated POS application interface according to the webpage data of the simulated POS application, records the operation on the interface, generates a test script, and implements the physical POS terminal and the POS application. Free installation, saving test costs.
- step S808 includes parsing the recorded operation into a first script segment, and generating a corresponding test script according to the first script segment.
- the terminal can parse the recorded operation according to the syntax of the test script and convert it into a first script segment.
- the terminal can combine the script fragment used to generate the test script with the corresponding script header information and the tail information to form a corresponding complete test script.
- the terminal may separately generate a corresponding test script according to the first script segment, or may generate a corresponding second script segment generated according to the selected preset comparison test item and the corresponding comparison test object according to the first script segment.
- Test script The comparison test item is used for comparing the comparison test object with the reference standard object to generate a comparison test result, for example, checking whether the element exists, whether the comparison element text is correct or the comparison application Check whether the program interface information is correct and compare the test items.
- the comparison test object is a test object that is compared with a reference standard object, such as an application interface, an element in an interface, or a text corresponding to an element.
- the corresponding test script is generated according to the script segment by parsing the operation of recording the simulated POS terminal interface and the simulated POS application interface into a script segment.
- Automated generation of test scripts is enabled, allowing test executors to automate test processing based on automatically generated test scripts. There is no need to manually perform manual test operations step by step, which improves the test efficiency.
- the method before generating the corresponding test script according to the first script segment, the method further includes the steps of: detecting a selection operation on the preset comparison test item; acquiring and selecting the pre-selection Aligning the test object corresponding to the test item; obtaining a preset script fragment template corresponding to the selected preset comparison test item; generating a second script fragment according to the comparison test object and the preset script fragment template, and second When the script fragment is used for execution, the comparison test object is compared with the corresponding standard reference object to obtain a corresponding comparison test result.
- generating a corresponding test script according to the first script segment includes: generating a corresponding test script according to the first script segment and the second script segment.
- the user can trigger the selection of the preset comparison test item by a preset operation.
- the user may perform a trigger operation on the simulated POS terminal interface or the simulated POS application interface to generate a selection menu bar of the preset comparison test item, and the user selects a preset comparison test item from the menu bar.
- the terminal then obtains the selected preset comparison test item.
- the triggering operation includes a right button operation or a pressing or clicking operation on the simulation screen area or the keyboard area.
- the terminal may obtain the selected corresponding comparison test object, or may be corresponding to the preset test item corresponding to the comparison test item. Compare the test object acquisition rules and automatically obtain the corresponding comparison test objects. For example, if the comparison test item is “whether the text of the comparison element is correct”, the terminal can acquire the text of the element selected by the user to be checked. For another example, when the comparison test item is “comparison application interface information”, the corresponding comparison test object is the current interface information of the application, and the terminal can perform screen capture processing on the current display interface of the application to obtain the corresponding application current. The interface information can also be image scanned on the current display interface of the application to obtain the current interface information of the corresponding application.
- the above-mentioned trigger operation or selection operation on the preset comparison test item, and the comparison operation on the test object can be preset as a reserve operation, and the terminal can not record the preset reservation operations.
- the corresponding relationship between the comparison test item and the script fragment template may be preset in the terminal, and the preset script fragment template corresponding to the selected preset comparison test item is obtained according to the corresponding relationship.
- the preset script fragment template includes a script fragment for initiating a comparison test object acquisition action and initiating a comparison action.
- the terminal may substitute the acquired comparison test object into the obtained preset preset script segment template to generate a second script segment.
- the second script fragment which is used to compare the test object when executed Compare with the corresponding standard reference objects to obtain the corresponding comparison test results.
- the terminal may combine the first script segment and the second script segment in an execution logic sequence to generate a corresponding test script. Specifically, the terminal may combine the first script segment and the second script segment in combination with the corresponding script header information and the tail information to form a corresponding complete test script.
- the corresponding second script segment is generated according to the comparison test object and the preset script segment template corresponding to the selected comparison test item, which is equivalent to the user being monitored. Based on the test related operations, some additional test operations are added, and the corresponding test script is generated by the first script segment corresponding to the user operation and the second script segment corresponding to the added preset comparison test item, so that the test operation is performed. More comprehensive and complete, thus improving the effectiveness of test results.
- a server 900 is provided, the internal structure of which may correspond to the structure shown in FIG. 2.
- Each of the modules described below may be implemented in whole or in part by software, hardware, or a combination thereof.
- the server 900 includes a simulation module 902, a test script acquisition module 904, and a test script execution module 906, wherein:
- the simulation module 902 is configured to send webpage data of the simulated POS application obtained by simulating the native POS application to the terminal, so that the terminal parses the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS. Application interface.
- the test script acquisition module 904 is configured to acquire a corresponding test script generated by recording an operation on the simulated POS terminal interface and emulating the POS application interface.
- the test script execution module 906 is configured to send the test script to the test executor and execute.
- the simulation module 902 is further configured to acquire webpage data of the native POS application; add corresponding POS application emulation interface data and emulate the POS terminal interface data in the webpage data of the native POS application to obtain the simulation. Web page data for POS applications.
- test script acquisition module 904 is further configured to record operations on the simulated POS terminal interface and the simulated POS application interface; parsing the recorded operations into the first script piece Segment; according to the first script fragment, generate the corresponding test script.
- the test script obtaining module 904 is further configured to detect a selection operation on the preset comparison test item; acquire a comparison test object corresponding to the selected preset comparison test item; and obtain a preset ratio compared with the selected a preset script segment template corresponding to the test item; generating a second script segment according to the comparison test object and the preset script segment template; and the second script segment is used to compare the comparison test object with the corresponding standard reference object Corresponding comparison test results are obtained; corresponding test scripts are generated according to the first script segment and the second script segment.
- the test script execution module 906 is further configured to: when the target object corresponding to the test script includes a physical POS terminal, send the test script to the test executor connected to the physical POS terminal, so that the test executor executes the test script, Test the physical POS terminal.
- the test script execution module 906 is further configured to: when the target object corresponding to the test script is a POS application, send the test script to the test executor running in the simulation environment, so that the test execution running in the simulation environment is performed.
- the test script is executed to test the simulated POS application.
- the server further includes:
- the regression test module 908 is configured to receive the regression test request, obtain the test case corresponding to the regression test request, add the test script corresponding to the corresponding test case to the test task queue, and notify the test script execution module 906.
- the test script execution module 906 is further configured to send the test task queue to the test executor, so that the test executor sequentially executes the test script in the test task queue for regression testing.
- a terminal 1100 is provided, and the internal structure of the terminal 1100 may correspond to the structure as shown in FIG.
- Each of the modules described below may be implemented in whole or in part by software, hardware, or a combination thereof.
- the terminal 1100 includes: an obtaining module 1102, a parsing module 1104, an operation recording module 1106, a test script generating module 1108, and a sending module 1110, where:
- the obtaining module 1102 is configured to obtain webpage data of the simulated POS application obtained by performing simulation processing on the native POS application.
- the parsing module 1104 is configured to parse the webpage data of the emulating POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface.
- the operation recording module 1106 is configured to record operations on the simulated POS terminal interface and the simulated POS application interface.
- the test script generating module 1108 is configured to generate a corresponding test script according to the recorded operation.
- the sending module 1110 is configured to send the test script to the server, so that the server sends the test script to the test executor when the test script needs to be executed, so that the test executor executes the test script.
- test script generation module 1108 is further configured to parse the recorded operation into a first script segment, and generate a corresponding test script according to the first script segment.
- the test script generation module 1108 is further configured to detect a selection operation on the preset comparison test item; acquire a comparison test object corresponding to the selected preset comparison test item; and obtain a preset ratio compared with the selected a preset script segment template corresponding to the test item; generating a second script segment according to the comparison test object and the preset script segment template; and the second script segment is used to compare the comparison test object with the corresponding standard reference object Corresponding comparison test results are obtained; corresponding test scripts are generated according to the first script segment and the second script segment.
- One or more non-transitory readable storage mediums storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the steps of: transmitting Simulating the webpage data of the simulated POS application obtained by the native POS application to the terminal, causing the terminal to parse the webpage data of the emulated POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface. Obtaining a corresponding test script generated by recording an operation on the simulated POS terminal interface and the simulated POS application interface; transmitting the test script to the test executor and executing.
- the computer readable instructions further cause the processor to perform the following steps: acquiring a native POS application before transmitting the webpage data of the simulated POS application obtained by emulating the native POS application to the terminal The webpage data; in the webpage data of the native POS application, adding corresponding POS application emulation interface data and emulating POS terminal interface data to obtain webpage data of the emulated POS application.
- the obtaining a corresponding test script generated by recording an operation on the simulated POS terminal interface and the simulated POS application interface includes: recording acting on the simulated POS terminal interface and An operation on the simulated POS application interface; parsing the recorded operation into a first script segment; and generating a corresponding test script according to the first script segment.
- the computer readable instructions before the generating the corresponding test script according to the first script segment, the computer readable instructions further cause the processor to perform the step of: detecting a selection operation on the preset comparison test item; Acquiring a comparison test object corresponding to the selected preset comparison test item; acquiring a preset script fragment template corresponding to the selected preset comparison test item; and according to the comparison test object and the The script fragment template is preset to generate a second script segment.
- the second script segment is used to compare the comparison test object with the corresponding standard reference object to obtain a corresponding comparison test result.
- the generating the corresponding test script according to the first script segment includes:
- Corresponding test scripts are generated according to the first script segment and the second script segment.
- the sending the test script to the test executor and executing comprises:
- the target object corresponding to the test script includes a physical POS terminal
- the sending the test script to the test executor and executing further comprises:
- the target object corresponding to the test script is a POS application
- the simulated POS application is tested.
- the computer readable instructions further cause the processor to perform the steps of: receiving a regression test request; acquiring a test case corresponding to the regression test request; adding a test script corresponding to the corresponding test case And to the test task queue; and the test task queue is sent to the test executor, so that the test executor sequentially executes the test script in the test task queue for regression testing.
- a terminal in one embodiment, includes a memory and a processor having stored therein computer readable instructions that, when executed by a processor, cause the processor to perform the steps of: acquiring a native POS
- the application simulates the webpage data of the simulated POS application; parses the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS application interface; the recording acts on the simulated POS terminal interface and the simulated POS The operation on the application interface; according to the recorded operation, generate the corresponding test script; send the test script to the server, so that the server sends the test script to the test executor when the test script needs to be executed, so that the test executor performs the test script.
- the corresponding test script generated by the processor according to the recorded operation includes: parsing the recorded operation into a first script segment, and generating a corresponding test script according to the first script segment.
- the computer readable instructions prior to generating the corresponding test script according to the first script segment, the computer readable instructions further cause the processor to perform the steps of: detecting a selection operation for the preset comparison test item; acquiring and selecting the preset Comparing the test object corresponding to the test item; obtaining a preset script segment template corresponding to the selected preset comparison test item; generating a second script segment according to the comparison test object and the preset script segment template; the second script
- the comparison test object is compared with the corresponding standard reference object to obtain a corresponding comparison test result.
- the corresponding test script generated by the processor according to the first script segment includes: generating a corresponding test script according to the first script segment and the second script segment.
- one or more non-volatile readable storage media having computer readable instructions stored by one or more processors are provided, such that one or more processors are Perform the following steps: obtaining webpage data of the simulated POS application obtained by simulating the native POS application; parsing the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and emulating POS application interface; recording function The operation of simulating the POS terminal interface and emulating the POS application interface; generating a corresponding test script according to the recorded operation; sending the test script to the server, so that the server sends the test script to the test executor when the test script needs to be executed So that the test executor executes the test script.
- the corresponding test script generated by the processor according to the recorded operation includes: parsing the recorded operation into a first script segment, and generating a corresponding test script according to the first script segment.
- the computer readable instructions prior to generating the corresponding test script according to the first script segment, the computer readable instructions further cause the processor to perform the steps of: detecting a selection operation for the preset comparison test item; acquiring and selecting the preset Comparing the test object corresponding to the test item; obtaining a preset script segment template corresponding to the selected preset comparison test item; generating a second script segment according to the comparison test object and the preset script segment template; the second script
- the comparison test object is compared with the corresponding standard reference object to obtain a corresponding comparison test result.
- the corresponding test script generated by the processor according to the first script segment includes: generating a corresponding test script according to the first script segment and the second script segment.
- first and second used in the embodiments of the present application are only used for distinguishing, and are not used as a limitation on the subordinate, size or sequence.
- the storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
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)
- Debugging And Monitoring (AREA)
Abstract
Provided is an application testing method, comprising: sending to a terminal webpage data of a simulated POS application obtained by simulating a native POS application, so as to allow the terminal to parse the webpage data of the simulated POS application to load and display a corresponding simulated POS terminal interface and a simulated POS application interface; obtaining corresponding test scripts generated by recording operations on the simulated POS terminal interface and the simulated POS application interface; and sending the test scripts to a test executor for execution.
Description
本申请要求于2017年04月06日提交中国专利局,申请号为201710221969.5,发明名称为“应用程序测试方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application, which is filed on Apr. 6, 2017, the Chinese Patent Application No. PCT Application No. In the application.
本申请涉及计算机技术领域,特别是涉及一种应用程序测试方法、服务器、终端和存储介质。The present application relates to the field of computer technologies, and in particular, to an application testing method, a server, a terminal, and a storage medium.
为了保证POS(Point Of Sale,销售点)应用程序的使用质量,在POS应用程序正式上线前,往往会对POS应用程序的功能进行测试。In order to ensure the quality of the POS (Point Of Sale) application, the function of the POS application is often tested before the POS application is officially launched.
目前,对POS应用程序进行测试时,需要测试人员下载POS应用程序到物理POS终端上,并手动的在POS终端上进行测试。然而,为了保证测试的准确性,通常需要人工手动的进行多次重复操作。因此,目前这种需要人工进行多次手动的重复操作,导致测试效率低下。Currently, when testing a POS application, the tester is required to download the POS application to the physical POS terminal and manually test it on the POS terminal. However, in order to ensure the accuracy of the test, it is usually necessary to manually perform multiple iterations. Therefore, at present, this manual manual manual operation is required, resulting in inefficient testing.
发明内容Summary of the invention
根据本申请公开的各种实施例,提供一种应用程序测试方法、服务器、终端和存储介质。According to various embodiments disclosed herein, an application testing method, a server, a terminal, and a storage medium are provided.
一种应用程序测试方法,包括:An application testing method that includes:
发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端,使所述终端解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Sending webpage data of the simulated POS application obtained by simulating the native POS application to the terminal, causing the terminal to parse the webpage data of the emulated POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface;
获取通过录制作用于所述仿真POS终端界面以及所述仿真POS应用程序
界面上的操作所生成的相应的测试脚本;及Acquiring a recording effect on the simulated POS terminal interface and the simulated POS application
The corresponding test script generated by the operation on the interface; and
发送所述测试脚本至测试执行器并执行。Send the test script to the test executor and execute.
一种服务器,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:A server comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端,使所述终端解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Sending webpage data of the simulated POS application obtained by simulating the native POS application to the terminal, causing the terminal to parse the webpage data of the emulated POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface;
获取通过录制作用于所述仿真POS终端界面以及所述仿真POS应用程序界面上的操作所生成的相应的测试脚本;及Acquiring a corresponding test script generated by recording an operation on the simulated POS terminal interface and the simulated POS application interface; and
发送所述测试脚本至测试执行器并执行。Send the test script to the test executor and execute.
一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more non-transitory readable storage mediums storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:
发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端,使所述终端解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Sending webpage data of the simulated POS application obtained by simulating the native POS application to the terminal, causing the terminal to parse the webpage data of the emulated POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface;
获取通过录制作用于所述仿真POS终端界面以及所述仿真POS应用程序界面上的操作所生成的相应的测试脚本;及Acquiring a corresponding test script generated by recording an operation on the simulated POS terminal interface and the simulated POS application interface; and
发送所述测试脚本至测试执行器并执行。Send the test script to the test executor and execute.
一种应用程序测试方法,包括:An application testing method that includes:
获取对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据;Obtaining webpage data of the simulated POS application obtained by simulating the native POS application;
解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Parsing the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS application interface;
录制作用于所述仿真POS终端界面和所述仿真POS应用程序界面上的操作;
Recording operations on the simulated POS terminal interface and the simulated POS application interface;
根据录制的所述操作,生成相应的测试脚本;及Generate a corresponding test script according to the operation described in the recording; and
将所述测试脚本发送至服务器,使所述服务器在需要执行所述测试脚本时,将所述测试脚本发送至测试执行器,以使所述测试执行器执行所述测试脚本。Sending the test script to a server, causing the server to send the test script to a test executor when the test script needs to be executed, so that the test executor executes the test script.
一种终端,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:A terminal comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
获取对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据;Obtaining webpage data of the simulated POS application obtained by simulating the native POS application;
解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Parsing the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS application interface;
录制作用于所述仿真POS终端界面和所述仿真POS应用程序界面上的操作;Recording operations on the simulated POS terminal interface and the simulated POS application interface;
根据录制的所述操作,生成相应的测试脚本;及Generate a corresponding test script according to the operation described in the recording; and
将所述测试脚本发送至服务器,使所述服务器在需要执行所述测试脚本时,将所述测试脚本发送至测试执行器,以使所述测试执行器执行所述测试脚本。Sending the test script to a server, causing the server to send the test script to a test executor when the test script needs to be executed, so that the test executor executes the test script.
一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more non-transitory readable storage mediums storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:
获取对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据;Obtaining webpage data of the simulated POS application obtained by simulating the native POS application;
解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Parsing the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS application interface;
录制作用于所述仿真POS终端界面和所述仿真POS应用程序界面上的操作;Recording operations on the simulated POS terminal interface and the simulated POS application interface;
根据录制的所述操作,生成相应的测试脚本;及Generate a corresponding test script according to the operation described in the recording; and
将所述测试脚本发送至服务器,使所述服务器在需要执行所述测试脚本
时,将所述测试脚本发送至测试执行器,以使所述测试执行器执行所述测试脚本。Sending the test script to a server, causing the server to execute the test script
The test script is sent to the test executor to cause the test executor to execute the test script.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。Details of one or more embodiments of the present application are set forth in the accompanying drawings and description below. Other features, objects, and advantages of the invention will be apparent from the description and appended claims.
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present application. Other drawings may also be obtained from those of ordinary skill in the art in light of the inventive work.
图1为一个实施例中应用程序测试方法的应用环境图;1 is an application environment diagram of an application testing method in an embodiment;
图2为一个实施例中服务器的内部结构示意图;2 is a schematic diagram showing the internal structure of a server in an embodiment;
图3为一个实施例中终端的内部结构示意图;3 is a schematic diagram showing the internal structure of a terminal in an embodiment;
图4为一个实施例中应用程序测试方法的流程示意图;4 is a schematic flow chart of an application testing method in an embodiment;
图5为一个实施例中实现应用程序测试方法时的仿真环境系统架构图;FIG. 5 is a structural diagram of a simulation environment system when an application testing method is implemented in an embodiment; FIG.
图6为一个实施例中测试脚本生成步骤的流程示意图;6 is a schematic flowchart of a test script generation step in an embodiment;
图7为一个实施例中第二脚本片段生成步骤的流程示意图;7 is a schematic flowchart of a second script segment generating step in an embodiment;
图8为另一个实施例中应用程序测试方法的流程示意图;8 is a schematic flow chart of an application testing method in another embodiment;
图9为一个实施例中服务器的结构框图;9 is a structural block diagram of a server in an embodiment;
图10为另一个实施例中服务器的结构框图;Figure 10 is a block diagram showing the structure of a server in another embodiment;
图11为一个实施例中终端的结构框图。Figure 11 is a block diagram showing the structure of a terminal in an embodiment.
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
图1为一个实施例中应用程序测试方法的应用环境图。参照图1,该应
用环境包括服务器110、终端120以及测试执行器130,服务器110、终端120以及测试执行器130两两之间网络连接。测试执行器130是具备运行测试脚本的功能的装置,测试执行器130可以采用硬件来实现,也可以采用软件来实现。终端120是能够解析网页数据的终端,比如终端中可以安装浏览器,也可以安装具有浏览器功能的客户端。其中,终端120可以不同于POS终端。POS终端是可以运行POS应用程序以实现支付功能的终端。需要说明的是,下述各实施例中未作特别限定的终端,皆指终端120。FIG. 1 is an application environment diagram of an application testing method in an embodiment. Referring to Figure 1, the response should
The environment includes a server 110, a terminal 120, and a test executor 130, and the server 110, the terminal 120, and the test executor 130 are network-connected. The test executor 130 is a device having a function of running a test script, and the test executor 130 may be implemented by hardware or by software. The terminal 120 is a terminal capable of parsing webpage data. For example, a browser may be installed in the terminal, or a client having a browser function may be installed. The terminal 120 can be different from the POS terminal. A POS terminal is a terminal that can run a POS application to implement a payment function. It should be noted that terminals that are not specifically limited in the following embodiments refer to the terminal 120.
服务器110可以发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端120,使终端120解析仿真POS应用程序的网页数据,生成相应的仿真POS终端界面和仿真POS应用程序界面。服务器110可以获取通过录制作用于仿真POS终端界面以及仿真POS应用程序界面上的操作所生成的相应的测试脚本,并发送测试脚本至测试执行器130,使测试执行器130执行该测试脚本。The server 110 may send the webpage data of the simulated POS application obtained by simulating the native POS application to the terminal 120, so that the terminal 120 parses the webpage data of the simulated POS application, and generates a corresponding emulated POS terminal interface and an emulated POS application interface. . The server 110 can acquire a corresponding test script generated by recording an operation acting on the emulated POS terminal interface and emulating the POS application interface, and send the test script to the test executor 130 to cause the test executor 130 to execute the test script.
图2为一个实施例中服务器的内部结构示意图。参照图2,该服务器包括通过系统总线连接的处理器、非易失性存储介质、内存储器和网络接口。其中,服务器的非易失性存储介质存储有操作系统和计算机可读指令,该计算机可读指令被执行时,可使得处理器执行一种应用程序测试方法。该处理器用于提供计算和控制能力,支撑整个服务器的运行。该内存储器中可储存有计算机可读指令,该计算机可读指令被所述处理器执行时,可使得所述处理器执行一种应用程序测试方法。网络接口用于连接网络进行通信,比如通过网络发送测试脚本等。服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群。2 is a schematic diagram showing the internal structure of a server in an embodiment. Referring to FIG. 2, the server includes a processor, a non-volatile storage medium, an internal memory, and a network interface connected by a system bus. Wherein the non-volatile storage medium of the server stores an operating system and computer readable instructions that, when executed, cause the processor to perform an application testing method. This processor is used to provide computing and control capabilities to support the operation of the entire server. The internal memory can store computer readable instructions that, when executed by the processor, cause the processor to perform an application testing method. The network interface is used to connect to the network for communication, such as sending test scripts over the network. The server can be a stand-alone physical server or a server cluster composed of multiple physical servers.
图3为一个实施例中终端的内部结构示意图。参照图3,该终端包括通过系统总线连接的处理器、非易失性存储介质、内存储器、网络接口、显示屏和输入装置。其中,终端的非易失性存储介质存储有操作系统和计算机可读指令,该计算机可读指令被执行时,可使得处理器执行一种应用程序测试方法。该处理器用于提供计算和控制能力,支撑整个终端的运行。终端中的
内存储器中可储存有计算机可读指令,该计算机可读指令被所述处理器执行时,可使得所述处理器执行一种应用程序测试方法。网络接口用于连接网络进行通信。终端的显示屏可以是液晶显示屏或者电子墨水显示屏等,终端的输入装置可以是显示屏上覆盖的触摸层,也可以是终端外壳上设置的按键、轨迹球或触控板,也可以是外接的键盘、触控板或鼠标等。该终端可以是个人计算机、移动终端或车载设备,移动终端包括手机、平板电脑、个人数字助理或可穿戴设备等中的至少一种。FIG. 3 is a schematic diagram showing the internal structure of a terminal in an embodiment. Referring to FIG. 3, the terminal includes a processor connected through a system bus, a non-volatile storage medium, an internal memory, a network interface, a display screen, and an input device. Wherein, the non-volatile storage medium of the terminal stores an operating system and computer readable instructions that, when executed, cause the processor to execute an application testing method. The processor is used to provide computing and control capabilities to support the operation of the entire terminal. In the terminal
Computer readable instructions may be stored in the internal memory, the computer readable instructions being executable by the processor to cause the processor to perform an application testing method. The network interface is used to connect to the network for communication. The display screen of the terminal may be a liquid crystal display or an electronic ink display. The input device of the terminal may be a touch layer covered on the display screen, or may be a button, a trackball or a touchpad provided on the terminal housing, or may be An external keyboard, trackpad, or mouse. The terminal may be a personal computer, a mobile terminal, or an in-vehicle device, and the mobile terminal includes at least one of a mobile phone, a tablet, a personal digital assistant, or a wearable device.
本领域技术人员可以理解,图2或3中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的服务器或终端的限定,具体的服务器或终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。It will be understood by those skilled in the art that the structure shown in FIG. 2 or 3 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation of a server or a terminal to which the solution of the present application is applied, and specific The server or terminal may include more or fewer components than shown in the figures, or some components may be combined, or have different component arrangements.
如图4所示,在一个实施例中,提供了一种应用程序测试方法。本实施例主要以该方法应用于上述图2中的服务器来举例说明。参照图4,该应用程序测试方法具体包括如下步骤:As shown in FIG. 4, in one embodiment, an application testing method is provided. This embodiment is mainly illustrated by applying the method to the server in FIG. 2 described above. Referring to FIG. 4, the application testing method specifically includes the following steps:
S402,发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端,使终端解析仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面。S402: Send webpage data of the simulated POS application obtained by simulating the native POS application to the terminal, so that the terminal parses the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS application interface.
其中,原生POS应用程序,是用于运行于物理POS终端中实现支付功能的真实应用程序。原生POS应用程序可以为网页格式的POS应用程序。在一个实施例中,原生POS应用程序可以为Html5(超文本标记语言第5版)格式的POS应用程序。仿真POS应用程序,是对原生POS应用程序进行仿真处理后得到的、且能够运行于浏览器中用于实现原生POS应用程序的功能的POS应用程序。可以理解,可以对多个原生POS应用程序分别进行仿真处理,得到相应的仿真POS应用程序。Among them, the native POS application is a real application for running a payment function in a physical POS terminal. Native POS applications can be POS applications in web format. In one embodiment, the native POS application can be a POS application in the Html5 (Hyper Text Markup Language Version 5) format. The emulated POS application is a POS application that is obtained by emulating a native POS application and capable of running in a browser for implementing the functionality of a native POS application. It can be understood that multiple native POS applications can be separately simulated to obtain a corresponding simulated POS application.
在一个实施例中,在步骤S402之前,还包括:获取原生POS应用程序的网页数据;在原生POS应用程序的网页数据中,添加相应的POS应用程序仿真接口数据和仿真POS终端界面数据,以得到仿真POS应用程序的网页数
据。In an embodiment, before step S402, the method further includes: acquiring webpage data of the native POS application; adding corresponding POS application emulation interface data and emulating POS terminal interface data in the webpage data of the native POS application, Get the number of web pages for the simulated POS application
according to.
其中,POS应用程序仿真接口,是对原生POS应用程序的用于实现所具备的功能的接口进行仿真处理,所得到的仿真接口。POS应用程序仿真接口,包括与POS终端进行通信的仿真接口、与交易后台进行通信的仿真接口和用于实现逻辑计算的仿真接口等中的至少一种。The POS application emulation interface is an emulation interface obtained by simulating the interface of the native POS application for implementing the functions. The POS application emulation interface includes at least one of a simulation interface for communicating with the POS terminal, an emulation interface for communicating with the transaction background, and an emulation interface for implementing logical computing.
仿真POS终端界面数据,是对物理POS终端进行仿真处理,得到的POS终端界面的仿真数据。其中,仿真POS终端界面,可以包括屏幕仿真区、键盘仿真区、刷卡仿真区和打印机凭条仿真区等,屏幕仿真区可用于显示仿真POS应用程序的界面。仿真POS终端界面也可以是一个在屏幕仿真区中显示键盘仿真区或刷卡仿真区等能够用屏幕触摸功能或显示识别功能替换的结构。比如,仿真POS终端界面中的屏幕仿真区中可以显示用于触摸输入的键盘区。可以理解,不同的原生POS应用程序可以对应不同的仿真POS终端界面。The simulation POS terminal interface data is simulation data of the POS terminal interface obtained by performing simulation processing on the physical POS terminal. The simulation POS terminal interface may include a screen simulation area, a keyboard simulation area, a card simulation area, and a printer receipt simulation area, and the screen simulation area may be used to display an interface of the simulated POS application. The emulation POS terminal interface may also be a structure that can display a keyboard emulation area or a swipe emulation area in the screen emulation area, and can be replaced by a screen touch function or a display recognition function. For example, a keyboard area for touch input can be displayed in the screen emulation area in the emulation POS terminal interface. It can be understood that different native POS applications can correspond to different emulated POS terminal interfaces.
在一个实施例中,服务器还可以对与仿真POS应用程序进行交易数据交互的交易后台进行仿真处理,得到的仿真交易后台。服务器可以根据仿真交易后台、仿真POS终端的界面、仿真POS应用程序和POS应用仿真接口等构成仿真环境。图5为一个实施例中仿真环境的系统架构图。界面层用于提供仿真应用的界面入口,POS应用程序接口仿真层与仿真交易后台进行交易数据的通信交互。In one embodiment, the server may also simulate the transaction background of the transaction data interaction with the simulated POS application, and obtain the simulated transaction background. The server can form a simulation environment based on the simulation transaction background, the interface of the simulated POS terminal, the simulated POS application, and the POS application simulation interface. Figure 5 is a system architecture diagram of a simulation environment in one embodiment. The interface layer is used to provide an interface entry for the simulation application, and the POS application interface simulation layer communicates with the simulation transaction background for transaction data communication.
可以理解,服务器也可以不对交易后台进行仿真处理,仿真POS应用程序的网页数据加载于终端后,可以直接通过仿真接口与真实的交易后台进行交易数据的交互。It can be understood that the server can also perform simulation processing on the transaction background. After the webpage data of the simulation POS application is loaded into the terminal, the transaction data can be directly interacted with the real transaction background through the simulation interface.
S404,获取通过录制作用于仿真POS终端界面以及仿真POS应用程序界面上的操作所生成的相应的测试脚本。S404. Acquire a corresponding test script generated by recording an operation on the simulated POS terminal interface and emulating the POS application interface.
其中,录制操作,是指实时监听并记录操作。录制作用于仿真POS终端界面以及仿真POS应用程序界面上的操作,是指实时监听并记录作用于仿真POS终端界面以及仿真POS应用程序界面上的操作。
Among them, the recording operation refers to real-time monitoring and recording operations. Recording operations on the simulated POS terminal interface and emulating the POS application interface refer to real-time monitoring and recording of operations on the simulated POS terminal interface and the simulated POS application interface.
在一个实施例中,用户可以通过终端向服务器请求与该原生POS应用程序或仿真POS应用程序相对应的测试用例,并按照服务器返回该相对应的预设测试用例,在仿真POS终端界面以及仿真POS应用程序界面上进行相应的操作,服务器或终端录制该作用于仿真POS终端界面以及仿真POS应用程序上的、且与返回的预设测试用例相匹配的操作。In one embodiment, the user can request a test case corresponding to the native POS application or the simulated POS application from the terminal through the terminal, and return the corresponding preset test case according to the server, simulate the POS terminal interface and simulate The corresponding operation is performed on the POS application interface, and the server or terminal records the operation acting on the emulated POS terminal interface and emulating the POS application and matching the returned preset test case.
服务器可以录制作用于仿真POS终端界面以及仿真POS应用程序界面上的操作,以生成测试脚本。服务器也可以接收终端所录制的作用于仿真POS终端界面以及仿真POS应用程序界面上的操作数据,解析接收的该录制操作数据,生成测试脚本。The server can record actions that act on the emulated POS terminal interface and emulate the POS application interface to generate test scripts. The server may also receive operation data recorded by the terminal and act on the simulated POS terminal interface and the simulated POS application interface, parse the received recording operation data, and generate a test script.
服务器还可以直接接收终端通过录制作用于仿真POS终端界面以及仿真POS应用程序界面上的操作所生成的相应的测试脚本。The server can also directly receive the corresponding test script generated by the terminal by recording the operation on the simulated POS terminal interface and emulating the POS application interface.
S406,发送测试脚本至测试执行器并执行。S406, sending a test script to the test executor and executing.
其中,测试执行器是具备测试脚本运行功能的装置。在一个实施例中,测试执行器可以是安装了测试代理程序的终端。测试代理程序,用于执行测试脚本,并生成测试结果。可以理解,服务器可以将测试脚本下发至一个或多个测试执行器,并使一个或多个测试执行器执行该被下发的测试脚本。服务器也可以根据测试任务下发请求或根据预设任务下发规则自动地将一个或多个测试脚本添加至任务队列,发送至测试执行器。测试执行器可以运行于真实环境中,也可以运行于仿真环境中。当测试执行器运行于仿真环境中时,测试执行器可以执行测试脚本,向服务器中的仿真POS应用程序发送指令,对仿真POS应用程序进行测试。Among them, the test executor is a device with a test script running function. In one embodiment, the test executor can be a terminal on which a test agent is installed. Test the agent to execute the test script and generate test results. It can be understood that the server can deliver the test script to one or more test executors and cause one or more test executors to execute the issued test script. The server can also automatically add one or more test scripts to the task queue according to the test task issuing request or according to the preset task delivery rule, and send it to the test executor. Test executors can run in real-world environments or in simulation environments. When the test executor is running in the simulation environment, the test executor can execute the test script, send instructions to the emulated POS application in the server, and test the emulated POS application.
上述应用程序测试方法,通过录制作用于仿真POS终端界面以及仿真POS应用程序界面上的操作,生成相应的测试脚本,将测试脚本下发至测试执行器执行,当需要多次执行测试脚本时,就可以根据测试执行器自动的执行测试脚本,而不用人工逐个步骤的进行手动的重复操作,提高了测试效率。此外,通过录制仿真POS终端界面和仿真POS应用程序上的操作,生成测试脚本,实现了免物理POS终端和POS应用程序的免安装,节省了测试成本。
The above application test method generates a corresponding test script by recording an operation on the simulated POS terminal interface and simulating the POS application interface, and sends the test script to the test executor for execution. When the test script needs to be executed multiple times, Test scripts can be executed automatically based on the test executor, without manual manual steps, step by step, improving test efficiency. In addition, by recording the simulated POS terminal interface and emulating the operation on the POS application, a test script is generated, which realizes the free installation of the physical POS terminal and the POS application, thereby saving the test cost.
如图6所示,在一个实施例中,步骤S404(简称测试脚本生成步骤)具体包括以下步骤:As shown in FIG. 6, in an embodiment, step S404 (refer to the test script generation step for short) specifically includes the following steps:
S602,录制作用于仿真POS终端界面和仿真POS应用程序界面上的操作。S602. Recording operations on the simulated POS terminal interface and the simulated POS application interface.
其中,录制作用于仿真POS终端界面和仿真POS应用程序界面上的操作,可以是录制用户在仿真POS终端界面和仿真POS应用程序界面上进行的所有操作,包括屏幕操作、键盘操作或刷卡操作等。具体地,服务器可以实时监听并记录作用于仿真POS终端界面以及仿真POS应用程序界面上的操作。比如,用户在终端上加载显示的仿真POS终端界面和仿真POS应用程序界面上进行操作,终端可以实时地将作用于仿真POS终端界面和仿真POS应用程序界面上的操作通知服务器,服务器记录该操作。The recording operation on the simulated POS terminal interface and the simulated POS application interface may be all operations performed by the recording user on the simulated POS terminal interface and the simulated POS application interface, including screen operations, keyboard operations, or card swipe operations. . Specifically, the server can monitor and record the operations on the simulated POS terminal interface and the simulated POS application interface in real time. For example, the user operates on the simulated POS terminal interface and the simulated POS application interface displayed on the terminal, and the terminal can notify the server of the operation on the simulated POS terminal interface and the simulated POS application interface in real time, and the server records the operation. .
在一个实施例中,服务器在录制作用于仿真POS终端界面和仿真POS应用程序界面上的操作时,还可以对预设的保留操作不作录制。预设的保留操作,是预设的作用于仿真POS终端界面或仿真POS应用程序界面上的不被录制的操作。In one embodiment, the server may also not record a preset reservation operation while recording operations on the emulated POS terminal interface and the emulated POS application interface. The preset hold operation is a preset action that is not recorded on the emulated POS terminal interface or the emulated POS application interface.
S604,将录制的操作解析成第一脚本片段。S604. Parse the recorded operation into a first script segment.
具体地,服务器可以将录制的操作按照测试脚本的语法进行解析,转换成第一脚本片段。Specifically, the server may parse the recorded operation according to the syntax of the test script and convert it into a first script fragment.
S606,根据第一脚本片段,生成相应的测试脚本。S606. Generate a corresponding test script according to the first script segment.
具体地,服务器可以将用于生成测试脚本的脚本片段,结合对应的脚本头部信息和尾部信息组合,构成相应的完整的测试脚本。其中,服务器可以单独根据第一脚本片段生成相应的测试脚本,也可以根据第一脚本片段,结合根据选择的预设比对测试项和相应的比对测试对象生成的第二脚本片段,生成相应的测试脚本。其中,比对测试项,是用于将比对测试对象与参照标准对象进行比对,以生成比对结果的测试项,比如,检查元素是否存在、比对元素的文字是否正确或比对应用程序界面信息是否正确等比对测试项。比对测试对象,是与参照标准对象进行比对的测试对象,比如应用程序界面、
界面中的元素或元素所对应的文字等。Specifically, the server may combine the script fragments used to generate the test script with the corresponding script header information and the tail information to form a corresponding complete test script. The server may separately generate a corresponding test script according to the first script segment, or may generate a corresponding second script segment generated according to the selected preset comparison test item and the corresponding comparison test object according to the first script segment. Test script. The comparison test item is used for comparing the comparison test object with the reference standard object to generate a comparison test result, for example, checking whether the element exists, whether the comparison element text is correct or the comparison application Check whether the program interface information is correct and compare the test items. The test object is a test object that is compared with a reference standard object, such as an application interface,
The text or element corresponding to the element in the interface.
在一个实施例中,服务器还可以接收终端发送的对步骤S606中所生成的测试脚本的编辑操作,根据该编辑操作对测试脚本进行对应的编辑调整,根据编辑调整后的测试脚本得到最终的测试脚本。In an embodiment, the server may further receive an editing operation sent by the terminal to the test script generated in step S606, perform corresponding editing adjustment on the test script according to the editing operation, and obtain a final test according to the edited adjusted test script. script.
上述实施例中,通过录制仿真POS终端界面以及仿真POS应用程序界面上的操作,根据用户操作自动生成相应的测试脚本,使得测试执行器可以根据所自动生成的测试脚本来自动执行测试处理。而不需要人工逐个步骤的进行手动测试操作,提高了测试效率。此外,通过录制仿真POS终端界面和仿真POS应用程序上的操作,生成测试脚本,实现了免物理POS终端和POS应用程序的免安装,节省了测试成本。In the above embodiment, by recording the simulated POS terminal interface and simulating the operation on the POS application interface, the corresponding test script is automatically generated according to the user operation, so that the test executor can automatically perform the test processing according to the automatically generated test script. There is no need to manually perform manual test operations step by step, which improves the test efficiency. In addition, by recording the simulated POS terminal interface and emulating the operation on the POS application, a test script is generated, which realizes the free installation of the physical POS terminal and the POS application, thereby saving the test cost.
如图7所示,在一个实施例中,在根据第一脚本片段,生成相应的测试脚本之前,该方法还包括第二脚本片段生成步骤,具体包括以下步骤:As shown in FIG. 7, in an embodiment, before generating a corresponding test script according to the first script segment, the method further includes a second script segment generating step, specifically including the following steps:
S702,检测对预设比对测试项的选择操作。S702. Detect a selection operation of the preset comparison test item.
其中,比对测试项,是用于将比对测试对象与参照标准对象进行比对,以生成比对结果的测试项,比如,检查元素是否存在、比对元素的文字是否正确或比对应用程序界面信息是否正确等比对测试项。参照标准对象,是预设的测试通过的测试纪录。参照标准对象用于与对比测试对象进行比对,以判断测试是否通过。可以理解,比对测试项为在用户所做的测试相关操作的基础上,额外添加的一些测试操作项。可以根据实际需要对比对测试项进行添加设置或删除设置。The comparison test item is used for comparing the comparison test object with the reference standard object to generate a comparison test result, for example, checking whether the element exists, whether the comparison element text is correct or the comparison application Check whether the program interface information is correct and compare the test items. The reference standard object is the test record passed by the preset test. The reference standard object is used for comparison with the comparison test object to determine whether the test passes. It can be understood that the comparison test item is an additional test operation item added on the basis of the test related operation performed by the user. You can add or delete settings for test items based on actual needs.
用户可以通过预设操作,触发对预设比对测试项的选择。在一个实施例中,用户可以在仿真POS终端界面或仿真POS应用程序界面进行触发操作,以生成预设比对测试项的选择菜单栏,用户从该菜单栏中选择预设比对测试项,终端进而将选择的预设比对测试项通知服务器。其中,触发操作包括右键操作或对仿真屏幕区或键盘区的按压或点击操作等。The user can trigger the selection of the preset comparison test item by a preset operation. In an embodiment, the user may perform a trigger operation on the simulated POS terminal interface or the simulated POS application interface to generate a selection menu bar of the preset comparison test item, and the user selects a preset comparison test item from the menu bar. The terminal in turn notifies the server of the selected preset comparison test item. The triggering operation includes a right button operation or a pressing or clicking operation on the simulation screen area or the keyboard area.
S704,获取与选择的预设比对测试项对应的比对测试对象。S704. Acquire a comparison test object corresponding to the selected preset comparison test item.
其中,比对测试对象,是与参照标准对象进行比对的测试对象,包括应
用程序界面、界面中的元素或元素所对应的文字等。Wherein, the comparison test object is a test object that is compared with the reference standard object, including
Use the program interface, the elements in the interface or the text corresponding to the element.
可以理解,获取与选择的预设比对测试项对应的比对测试对象的方式有多种,服务器可以获取选择的对应的比对测试对象,也可以按照预设的与比对测试项对应的比对测试对象获取规则,自动获取对应的比对测试对象。比如,比对测试项为“比对元素的文字是否正确”,则服务器可以获取用户所选择的需要检查的元素的文字。又比如,比对测试项为“比对应用程序界面信息”时,对应的比对测试对象即为应用程序当前界面信息,终端可以对应用程序的当前显示界面进行截屏处理得到对应的应用程序当前界面信息,也可以对应用程序的当前显示界面进行图像扫描得到对应的应用程序当前界面信息。It can be understood that there are multiple ways of obtaining the comparison test object corresponding to the test item corresponding to the selected test item, and the server may obtain the selected corresponding comparison test object, or may be corresponding to the preset test item corresponding to the comparison test item. Compare the test object acquisition rules and automatically obtain the corresponding comparison test objects. For example, if the comparison test item is "whether the text of the comparison element is correct", the server can obtain the text of the element selected by the user to be checked. For another example, when the comparison test item is “comparison application interface information”, the corresponding comparison test object is the current interface information of the application, and the terminal can perform screen capture processing on the current display interface of the application to obtain the corresponding application current. The interface information can also be image scanned on the current display interface of the application to obtain the current interface information of the corresponding application.
可以理解,上述对预设比对测试项的触发操作或选择操作,以及对比对测试对象的选择操作,则可以被预先设置为保留操作,服务器则可以对这些预设的保留操作不作录制。It can be understood that the above-mentioned trigger operation or selection operation on the preset comparison test item, and the comparison operation on the test object can be preset as a reserve operation, and the server can not record the preset reservation operations.
S706,获取与选择的预设比对测试项对应的预设脚本片段模板。S706. Acquire a preset script segment template corresponding to the selected preset comparison test item.
具体地,服务器中可以预先设置比对测试项与脚本片段模板之间的对应关系,根据该对应关系,获取与选择的预设比对测试项对应的预设脚本片段模板。其中,预设脚本片段模板中,包括用于发起比对测试对象获取动作和发起比对动作的脚本片段。Specifically, the correspondence between the comparison test item and the script fragment template may be preset in the server, and the preset script fragment template corresponding to the selected preset comparison test item is obtained according to the correspondence. The preset script fragment template includes a script fragment for initiating a comparison test object acquisition action and initiating a comparison action.
S708,根据比对测试对象和预设脚本片段模板,生成第二脚本片段,第二脚本片段用于执行时将比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果。S708. Generate a second script segment according to the comparison test object and the preset script segment template. When the second script segment is used for execution, the comparison test object is compared with the corresponding standard reference object to obtain a corresponding comparison test result.
具体地,服务器可以将所获取的比对测试对象代入所获取的相应的预设脚本片段模板中,以生成第二脚本片段。该第二脚本片段,用于执行时将比对测试对象和相应的标准参照对象进行比对,以得到相应的比对测试结果。Specifically, the server may substitute the acquired comparison test object into the obtained preset preset script segment template to generate a second script segment. The second script segment is used to compare the comparison test object with the corresponding standard reference object during execution to obtain a corresponding comparison test result.
本实施例中,根据第一脚本片段,生成相应的测试脚本包括:根据第一脚本片段和第二脚本片段,生成相应的测试脚本。In this embodiment, generating the corresponding test script according to the first script segment includes: generating a corresponding test script according to the first script segment and the second script segment.
在一个实施例中,服务器可以将第一脚本片段和第二脚本片段按照执行
逻辑顺序进行组合,生成相应的测试脚本。具体地,服务器可以将第一脚本片段和第二脚本片段,结合对应的脚本头部信息和尾部信息组合,构成相应的完整的测试脚本。In one embodiment, the server may execute the first script segment and the second script segment in accordance with the execution
The logical order is combined to generate the corresponding test script. Specifically, the server may combine the first script segment and the second script segment in combination with the corresponding script header information and the tail information to form a corresponding complete test script.
上述实施例中,通过预设比对测试项,根据选择的比对测试项所对应的比对测试对象和预设脚本片段模板生成相应的第二脚本片段,相当于在监听的用户所做的测试相关操作的基础上,额外添加了一些测试操作,通过与用户操作对应的第一脚本片段和由添加的预设比对测试项所对应的第二脚本片段生成相应的测试脚本,使得测试操作更加的全面、完整,从而提高了测试结果的有效性。In the above embodiment, by comparing the comparison test items, the corresponding second script segment is generated according to the comparison test object and the preset script segment template corresponding to the selected comparison test item, which is equivalent to the user being monitored. Based on the test related operations, some additional test operations are added, and the corresponding test script is generated by the first script segment corresponding to the user operation and the second script segment corresponding to the added preset comparison test item, so that the test operation is performed. More comprehensive and complete, thus improving the effectiveness of test results.
在一个实施例中,步骤S406包括:当测试脚本所对应的目标对象包括物理POS终端时,发送测试脚本至连接有物理POS终端的测试执行器,使测试执行器执行测试脚本,对物理POS终端进行测试。In an embodiment, step S406 includes: when the target object corresponding to the test script includes a physical POS terminal, sending a test script to the test executor connected to the physical POS terminal, so that the test executor executes the test script to the physical POS terminal. carry out testing.
其中,物理POS终端可以通过USB(Universal Serial Bus,通用串行总线)连接测试执行器,也可以通过其他连接方式与测试执行器连接。该连接只要能够满足测试执行器在执行测试脚本时,能够向物理POS终端发送相应指令即可。The physical POS terminal can connect to the test executor via a USB (Universal Serial Bus) or can be connected to the test executor through other connection methods. The connection can be sent to the physical POS terminal as long as it can satisfy the test executor when executing the test script.
测试脚本所对应的目标对象,是被根据测试脚本发起的指令控制的对象。服务器在发送测试脚本至测试执行器时,可以检测测试脚本所对应的目标对象,当测试脚本所对应的目标对象包括物理POS终端时,将测试脚本发送至连接有物理POS终端的测试执行器。测试执行器执行该测试脚本,生成相应的指令,对物理POS终端进行测试。其中,与测试执行器连接的物理POS终端可以为多个。The target object corresponding to the test script is the object that is controlled according to the instructions initiated by the test script. When the server sends the test script to the test executor, the target object corresponding to the test script can be detected. When the target object corresponding to the test script includes the physical POS terminal, the test script is sent to the test executor connected to the physical POS terminal. The test executor executes the test script and generates corresponding instructions to test the physical POS terminal. There may be multiple physical POS terminals connected to the test executor.
上述实施例中,通过将测试脚本发送至与物理POS终端连接的测试执行器,使测试执行器自动执行测试脚本,以对物理POS终端进行自动化测试,相较于人工手动的将POS应用程序下载至物理POS终端,并手动进行测试而言,提高了测试效率。此外,与测试执行器连接的物理POS终端可以为多个,从而可以实现同时对多个物理POS终端的测试,进一步提高了测试效率。
In the above embodiment, the test script is automatically executed by the test executor by sending the test script to the test executor connected to the physical POS terminal, so as to automatically test the physical POS terminal, compared to manually manually downloading the POS application. Test efficiency is improved in terms of physical POS terminals and manual testing. In addition, there may be multiple physical POS terminals connected to the test executor, so that simultaneous testing of multiple physical POS terminals can be implemented, which further improves test efficiency.
在一个实施例中,步骤S406还包括:当测试脚本所对应的目标对象为POS应用程序时,则发送测试脚本至运行于仿真环境的测试执行器,使运行于仿真环境的测试执行器执行测试脚本,对仿真POS应用程序进行测试。In an embodiment, step S406 further includes: when the target object corresponding to the test script is a POS application, sending a test script to the test executor running in the simulation environment, so that the test executor running in the simulation environment performs the test Script to test the simulated POS application.
具体地,当测试脚本所对应的目标对象为POS应用程序时,即该测试脚本用于进行应用层面的测试时,服务器可以发送测试脚本至运行于仿真环境的测试执行器。运行于仿真环境的测试执行器则可以执行测试脚本,生成相应的指令,对仿真环境中的仿真POS应用程序进行测试。Specifically, when the target object corresponding to the test script is a POS application, that is, when the test script is used for testing at the application level, the server may send the test script to the test executor running in the simulation environment. The test executor running in the simulation environment can execute the test script and generate corresponding instructions to test the simulated POS application in the simulation environment.
上述实施例中,当测试脚本用于进行应用层面的测试时,服务器将测试脚本下发至运行于仿真环境的测试执行器,以对仿真环境中的仿真POS应用程序进行测试。在对POS应用程序测试时实现了免物理POS终端,从而避免了POS应用程序测试对物理POS终端的依赖,节省了测试成本。此外,由测试执行器直接对仿真POS应用程序进行测试,不用人工手动安装POS应用程序以及手动测试,因而提高了测试效率。In the above embodiment, when the test script is used for the application level test, the server sends the test script to the test executor running in the simulation environment to test the simulated POS application in the simulation environment. The physical POS terminal is implemented when testing the POS application, thereby avoiding the dependence of the POS application test on the physical POS terminal and saving the test cost. In addition, the test executor directly tests the simulated POS application without manual manual installation of the POS application and manual testing, thus improving test efficiency.
在一个实施例中,该方法还包括:接收回归测试请求,获取与回归测试请求对应的测试用例;将对应的测试用例所对应的测试脚本添加至测试任务队列中,将测试任务队列下发至测试执行器,使测试执行器依次执行测试任务队列中的测试脚本,以进行回归测试的步骤。In an embodiment, the method further includes: receiving a regression test request, acquiring a test case corresponding to the regression test request; adding a test script corresponding to the corresponding test case to the test task queue, and sending the test task queue to the test task queue The test executor causes the test executor to execute the test script in the test task queue in turn for the regression test step.
其中,与回归测试请求对应的测试用例,是指所请求的用于进行回归测试的测试用例。具体地,回归测试请求中可以包括用于回归测试的测试用例标识,服务器根据该测试用例标识获取相应的测试用例。其中,一个测试用例可以对应于一个或多个测试脚本,服务器可以获取与相应的测试用例所对应的测试脚本,并将测试脚本添加至测试任务队列中,测试任务队列中的测试脚本为一个或多个。服务器将测试任务队列下发至测试执行器。测试执行器按照测试任务队列中测试脚本的排序,依次执行测试任务队列中的测试脚本,以进行回归测试。The test case corresponding to the regression test request refers to the test case requested for the regression test. Specifically, the regression test request may include a test case identifier for the regression test, and the server obtains the corresponding test case according to the test case identifier. Wherein, one test case may correspond to one or more test scripts, the server may obtain a test script corresponding to the corresponding test case, and add the test script to the test task queue, and the test script in the test task queue is one or Multiple. The server sends the test task queue to the test executor. The test executor executes the test scripts in the test task queue in order according to the order of the test scripts in the test task queue for regression testing.
上述实施例中,通过将与回归测试请求对应的测试脚本添加至测试任务队列中,下发至测试执行器,使测试执行器依次执行测试脚本,实现自动化
的回归测试,而不需要人工按照全部或部分测试脚本手动的进行回归测试,提高了回归测试效率。In the above embodiment, the test script corresponding to the regression test request is added to the test task queue, and is sent to the test executor, so that the test executor executes the test script in turn to implement automation.
The regression test does not require manual regression testing of all or part of the test scripts, improving the efficiency of regression testing.
在一个实施例中,服务器可以根据预设共享规则或用户通过终端发起的测试脚本共享请求将相应的测试脚本设置为共享状态。其中,共享状态的测试脚本,可以被任意具有测试操作权限的用户选择并添加至相应的测试任务中。In one embodiment, the server may set the corresponding test script to a shared state according to a preset sharing rule or a user-initiated test script sharing request. The shared state test script can be selected by any user with the test operation authority and added to the corresponding test task.
其中,预设共享规则,可以是将任意一个或多个原生POS应用程序所对应的测试脚本设置为共享状态的预设规则。用户通过终端发起的测试脚本共享请求,也可以是发起的对任意一个或多个原生POS应用程序所对应的测试脚本进行共享的请求。则服务器可以根据预设共享规则或用户通过终端发起的测试脚本共享请求,将任意一个或多个原生POS应用程序所对应的测试脚本设置为共享状态。The preset sharing rule may be a preset rule that sets a test script corresponding to any one or more native POS applications to a shared state. The user shares the request through a test script initiated by the terminal, or may be a request for sharing the test script corresponding to any one or more native POS applications. The server may set the test script corresponding to any one or more native POS applications to a shared state according to a preset sharing rule or a test script sharing request initiated by the user through the terminal.
比如,应用1的测试脚本a、b和c为共享状态,应用2的测试脚本d和e为共享状态。测试人员A、B和C都具有测试操作权限,则测试人员A、B和C都可以通过终端对应用1的测试脚本a和b进行选择并添加至相应的测试任务中,服务器执行该测试任务,将测试脚本a和b下发至测试执行器,使测试执行器根据测试脚本a和b对应用1进行测试。再比如,测试人员A、B和C也都可以通过终端对应用2的测试脚本d和e进行选择添加至相应的测试任务,服务器则相应的将测试脚本d和e下发至测试执行器,使测试执行器根据测试脚本d和e对应用2进行测试。For example, the test scripts a, b, and c of the application 1 are shared, and the test scripts d and e of the application 2 are shared. Testers A, B, and C all have test operation rights, and testers A, B, and C can select test scripts a and b of application 1 through the terminal and add them to the corresponding test tasks, and the server executes the test tasks. The test scripts a and b are sent to the test executor, so that the test executor tests the application 1 according to the test scripts a and b. For example, testers A, B, and C can also add test scripts d and e of application 2 to the corresponding test task through the terminal, and the server sends the test scripts d and e to the test executor accordingly. The test executor is tested against application 2 based on test scripts d and e.
上述实施例中,通过将测试脚本设置为共享状态,使得多个用户都可以执行测试脚本,以提高测试脚本的利用率。同时,录制一次测试脚本,即可实现共用,也避免了不同用户对测试脚本的重复录制造成的时间成本的浪费,从而提高了测试效率。In the above embodiment, by setting the test script to the shared state, multiple users can execute the test script to improve the utilization of the test script. At the same time, recording a test script can achieve sharing, and avoids the waste of time and cost caused by repeated recording of test scripts by different users, thereby improving test efficiency.
在一个实施例中,该方法还包括:获取测试执行器上报的、且根据执行测试脚本所生成的测试结果;根据该测试结果生成相应的测试报告。In an embodiment, the method further includes: obtaining a test result reported by the test executor and generated according to the execution of the test script; and generating a corresponding test report according to the test result.
具体地,测试执行器执行服务器发送的测试脚本后,可以生成相应的测
试结果,并将测试结果上报至服务器。服务器可以对该测试结果进行分析,生成相应的测试报告。上述实施例中,通过测试结果自动生成相应的测试报告,使得当测试存在问题时,可以更加及时的获知测试问题,避免了人工对测试结果进行大量分析得到测试问题所造成的时间成本的浪费。Specifically, after the test executor executes the test script sent by the server, the corresponding test can be generated.
Test the results and report the test results to the server. The server can analyze the test results and generate corresponding test reports. In the above embodiment, the corresponding test report is automatically generated through the test result, so that when the test has a problem, the test problem can be known more timely, and the time cost waste caused by the manual analysis of the test result to obtain the test problem is avoided.
如图8所示,在一个实施例中,提供了一种应用程序测试方法,本实施例主要以该方法应用于上述图3中的终端来举例说明。参照图8,该应用程序测试方法具体包括如下步骤:As shown in FIG. 8, in an embodiment, an application testing method is provided. This embodiment is mainly applied to the terminal in FIG. 3 by using the method. Referring to FIG. 8, the application testing method specifically includes the following steps:
S802,获取对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据。S802. Obtain webpage data of the simulated POS application obtained by performing simulation processing on the native POS application.
具体地,终端接收服务器发送的对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据。Specifically, the terminal receives webpage data of the simulated POS application obtained by performing simulation processing on the native POS application sent by the server.
S804,解析仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面。S804. Parse the webpage data of the simulated POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface.
S806,录制作用于仿真POS终端界面和仿真POS应用程序界面上的操作。S806, recording operations on the simulated POS terminal interface and the simulated POS application interface.
在一个实施例中,用户可以通过终端向服务器请求与该原生POS应用程序或仿真POS应用程序相对应的预设测试用例,并按照服务器返回该相对应的测试用例,在仿真POS终端界面以及仿真POS应用程序界面上进行相应的操作,终端录制该作用于仿真POS终端界面以及仿真POS应用程序上的、且与返回的预设测试用例相匹配的操作。In one embodiment, the user may request a preset test case corresponding to the native POS application or the simulated POS application from the terminal through the terminal, and return the corresponding test case according to the server, simulate the POS terminal interface and simulate The corresponding operation is performed on the POS application interface, and the terminal records the operation acting on the emulated POS terminal interface and emulating the POS application and matching the returned preset test case.
S808,根据录制的操作,生成相应的测试脚本。S808, according to the recorded operation, generate a corresponding test script.
其中,终端可以将录制的操作按照测试脚本的语法进行解析,以生成相应的测试脚本。The terminal can parse the recorded operation according to the syntax of the test script to generate a corresponding test script.
在一个实施例中,终端还可以接收对解析生成的测试脚本进行的编辑操作指令,并响应于该编辑操作指令,对解析生成的测试脚本进行对应的编辑调整,根据编辑调整后的测试脚本,得到最终的测试脚本。In an embodiment, the terminal may further receive an edit operation instruction for parsing the generated test script, and perform corresponding edit adjustment on the parsed test script in response to the edit operation instruction, according to the edited test script. Get the final test script.
S810,将测试脚本发送至服务器,使服务器在需要执行测试脚本时,将
测试脚本发送至测试执行器,以使测试执行器执行测试脚本。S810, sending a test script to the server, so that when the server needs to execute the test script,
The test script is sent to the test executor to cause the test executor to execute the test script.
上述应用程序测试方法,通过录制作用于仿真POS终端界面以及仿真POS应用程序界面上的操作,生成相应的测试脚本,将测试脚本发送至服务器,使服务器在需要执行测试脚本时,将测试脚本下发至测试执行器并执行,当需要多次执行测试脚本时,就可以根据测试执行器自动的执行测试脚本,而不用人工逐个步骤的进行手动的重复操作,提高了测试效率。The above application test method generates a corresponding test script by recording an operation on the simulated POS terminal interface and emulating the POS application interface, and sends the test script to the server, so that the server can execute the test script when the test script needs to be executed. Send to the test executor and execute. When the test script needs to be executed multiple times, the test script can be automatically executed according to the test executor, instead of manually repeating the operation step by step, which improves the test efficiency.
此外,终端根据解析仿真POS应用程序的网页数据,加载显示相应的仿真POS终端界面和仿真POS应用程序界面,并录制作用于界面上的操作,生成测试脚本,实现物理POS终端和POS应用程序的免安装,节省测试成本。In addition, the terminal loads and displays the corresponding simulated POS terminal interface and the simulated POS application interface according to the webpage data of the simulated POS application, records the operation on the interface, generates a test script, and implements the physical POS terminal and the POS application. Free installation, saving test costs.
在一个实施例中,步骤S808包括:将录制的操作解析成第一脚本片段,根据第一脚本片段,生成相应的测试脚本。In one embodiment, step S808 includes parsing the recorded operation into a first script segment, and generating a corresponding test script according to the first script segment.
具体地,终端可以将录制的操作按照测试脚本的语法进行解析,转换成第一脚本片段。终端可以将用于生成测试脚本的脚本片段,结合对应的脚本头部信息和尾部信息组合,构成相应的完整的测试脚本。Specifically, the terminal can parse the recorded operation according to the syntax of the test script and convert it into a first script segment. The terminal can combine the script fragment used to generate the test script with the corresponding script header information and the tail information to form a corresponding complete test script.
其中,终端可以单独根据第一脚本片段生成相应的测试脚本,也可以根据第一脚本片段,结合根据选择的预设比对测试项和相应的比对测试对象生成的第二脚本片段,生成相应的测试脚本。其中,比对测试项,是用于将比对测试对象与参照标准对象进行比对,以生成比对结果的测试项,比如,检查元素是否存在、比对元素的文字是否正确或比对应用程序界面信息是否正确等比对测试项。比对测试对象,是与参照标准对象进行比对的测试对象,比如应用程序界面、界面中的元素或元素所对应的文字等。The terminal may separately generate a corresponding test script according to the first script segment, or may generate a corresponding second script segment generated according to the selected preset comparison test item and the corresponding comparison test object according to the first script segment. Test script. The comparison test item is used for comparing the comparison test object with the reference standard object to generate a comparison test result, for example, checking whether the element exists, whether the comparison element text is correct or the comparison application Check whether the program interface information is correct and compare the test items. The comparison test object is a test object that is compared with a reference standard object, such as an application interface, an element in an interface, or a text corresponding to an element.
上述实施例中,通过将录制仿真POS终端界面以及仿真POS应用程序界面上的操作解析成脚本片段,根据脚本片段生成相应测试脚本。实现了测试脚本的自动化生成,使测试执行器可根据所自动生成的测试脚本来自动执行测试处理。而不需要人工逐个步骤的进行手动测试操作,提高了测试效率。In the above embodiment, the corresponding test script is generated according to the script segment by parsing the operation of recording the simulated POS terminal interface and the simulated POS application interface into a script segment. Automated generation of test scripts is enabled, allowing test executors to automate test processing based on automatically generated test scripts. There is no need to manually perform manual test operations step by step, which improves the test efficiency.
在一个实施例中,在根据第一脚本片段,生成相应的测试脚本之前,该方法还包括以下步骤:检测对预设比对测试项的选择操作;获取与选择的预
设比对测试项对应的比对测试对象;获取与选择的预设比对测试项对应的预设脚本片段模板;根据比对测试对象和预设脚本片段模板,生成第二脚本片段,第二脚本片段用于执行时将比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果。本实施例中,根据第一脚本片段,生成相应的测试脚本,包括:根据第一脚本片段和第二脚本片段,生成相应的测试脚本。In an embodiment, before generating the corresponding test script according to the first script segment, the method further includes the steps of: detecting a selection operation on the preset comparison test item; acquiring and selecting the pre-selection
Aligning the test object corresponding to the test item; obtaining a preset script fragment template corresponding to the selected preset comparison test item; generating a second script fragment according to the comparison test object and the preset script fragment template, and second When the script fragment is used for execution, the comparison test object is compared with the corresponding standard reference object to obtain a corresponding comparison test result. In this embodiment, generating a corresponding test script according to the first script segment includes: generating a corresponding test script according to the first script segment and the second script segment.
用户可以通过预设操作,触发对预设比对测试项的选择。在一个实施例中,用户可以在仿真POS终端界面或仿真POS应用程序界面进行触发操作,以生成预设比对测试项的选择菜单栏,用户从该菜单栏中选择预设比对测试项,终端进而获取选择的预设比对测试项。其中,触发操作包括右键操作或对仿真屏幕区或键盘区的按压或点击操作等。The user can trigger the selection of the preset comparison test item by a preset operation. In an embodiment, the user may perform a trigger operation on the simulated POS terminal interface or the simulated POS application interface to generate a selection menu bar of the preset comparison test item, and the user selects a preset comparison test item from the menu bar. The terminal then obtains the selected preset comparison test item. The triggering operation includes a right button operation or a pressing or clicking operation on the simulation screen area or the keyboard area.
可以理解,获取与选择的预设比对测试项对应的比对测试对象的方式有多种,终端可以获取选择的对应的比对测试对象,也可以按照预设的与比对测试项对应的比对测试对象获取规则,自动获取对应的比对测试对象。比如,比对测试项为“比对元素的文字是否正确”,则终端可以获取用户所选择的需要检查的元素的文字。又比如,比对测试项为“比对应用程序界面信息”时,对应的比对测试对象即为应用程序当前界面信息,终端可以对应用程序的当前显示界面进行截屏处理得到对应的应用程序当前界面信息,也可以对应用程序的当前显示界面进行图像扫描得到对应的应用程序当前界面信息。It can be understood that there are multiple ways to compare and select the corresponding test object corresponding to the test item, and the terminal may obtain the selected corresponding comparison test object, or may be corresponding to the preset test item corresponding to the comparison test item. Compare the test object acquisition rules and automatically obtain the corresponding comparison test objects. For example, if the comparison test item is “whether the text of the comparison element is correct”, the terminal can acquire the text of the element selected by the user to be checked. For another example, when the comparison test item is “comparison application interface information”, the corresponding comparison test object is the current interface information of the application, and the terminal can perform screen capture processing on the current display interface of the application to obtain the corresponding application current. The interface information can also be image scanned on the current display interface of the application to obtain the current interface information of the corresponding application.
可以理解,上述对预设比对测试项的触发操作或选择操作,以及对比对测试对象的选择操作,则可以被预先设置为保留操作,终端则可以对这些预设的保留操作不作录制。It can be understood that the above-mentioned trigger operation or selection operation on the preset comparison test item, and the comparison operation on the test object can be preset as a reserve operation, and the terminal can not record the preset reservation operations.
终端中可以预先设置比对测试项与脚本片段模板之间的对应关系,根据该对应关系,获取与选择的预设比对测试项对应的预设脚本片段模板。其中,预设脚本片段模板中,包括用于发起比对测试对象获取动作和发起比对动作的脚本片段。The corresponding relationship between the comparison test item and the script fragment template may be preset in the terminal, and the preset script fragment template corresponding to the selected preset comparison test item is obtained according to the corresponding relationship. The preset script fragment template includes a script fragment for initiating a comparison test object acquisition action and initiating a comparison action.
终端可以将所获取的比对测试对象代入所获取的相应的预设脚本片段模板中,以生成第二脚本片段。该第二脚本片段,用于执行时将比对测试对象
和相应的标准参照对象进行比对,以得到相应的比对测试结果。The terminal may substitute the acquired comparison test object into the obtained preset preset script segment template to generate a second script segment. The second script fragment, which is used to compare the test object when executed
Compare with the corresponding standard reference objects to obtain the corresponding comparison test results.
在一个实施例中,终端可以将第一脚本片段和第二脚本片段按照执行逻辑顺序进行组合,生成相应的测试脚本。具体地,终端可以将第一脚本片段和第二脚本片段,结合对应的脚本头部信息和尾部信息组合,构成相应的完整的测试脚本。In one embodiment, the terminal may combine the first script segment and the second script segment in an execution logic sequence to generate a corresponding test script. Specifically, the terminal may combine the first script segment and the second script segment in combination with the corresponding script header information and the tail information to form a corresponding complete test script.
上述实施例中,通过预设比对测试项,根据选择的比对测试项所对应的比对测试对象和预设脚本片段模板生成相应的第二脚本片段,相当于在监听的用户所做的测试相关操作的基础上,额外添加了一些测试操作,通过与用户操作对应的第一脚本片段和由添加的预设比对测试项所对应的第二脚本片段生成相应的测试脚本,使得测试操作更加的全面、完整,从而提高了测试结果的有效性。In the above embodiment, by comparing the comparison test items, the corresponding second script segment is generated according to the comparison test object and the preset script segment template corresponding to the selected comparison test item, which is equivalent to the user being monitored. Based on the test related operations, some additional test operations are added, and the corresponding test script is generated by the first script segment corresponding to the user operation and the second script segment corresponding to the added preset comparison test item, so that the test operation is performed. More comprehensive and complete, thus improving the effectiveness of test results.
如图9所示,在一个实施例中,提供了一种服务器900,该服务器900的内部结构可对应于如图2所示的结构。下述每个模块可全部或部分通过软件、硬件或其组合来实现。As shown in FIG. 9, in one embodiment, a server 900 is provided, the internal structure of which may correspond to the structure shown in FIG. 2. Each of the modules described below may be implemented in whole or in part by software, hardware, or a combination thereof.
在一个实施例中,服务器900包括:仿真模块902、测试脚本获取模块904以及测试脚本执行模块906,其中:In one embodiment, the server 900 includes a simulation module 902, a test script acquisition module 904, and a test script execution module 906, wherein:
仿真模块902,用于发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端,使终端解析仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面。The simulation module 902 is configured to send webpage data of the simulated POS application obtained by simulating the native POS application to the terminal, so that the terminal parses the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS. Application interface.
测试脚本获取模块904,用于获取通过录制作用于仿真POS终端界面以及仿真POS应用程序界面上的操作所生成的相应的测试脚本。The test script acquisition module 904 is configured to acquire a corresponding test script generated by recording an operation on the simulated POS terminal interface and emulating the POS application interface.
测试脚本执行模块906,用于发送测试脚本至测试执行器并执行。The test script execution module 906 is configured to send the test script to the test executor and execute.
在一个实施例中,仿真模块902还用于获取原生POS应用程序的网页数据;在原生POS应用程序的网页数据中,添加相应的POS应用程序仿真接口数据和仿真POS终端界面数据,以得到仿真POS应用程序的网页数据。In an embodiment, the simulation module 902 is further configured to acquire webpage data of the native POS application; add corresponding POS application emulation interface data and emulate the POS terminal interface data in the webpage data of the native POS application to obtain the simulation. Web page data for POS applications.
在一个实施例中,测试脚本获取模块904还用于录制作用于仿真POS终端界面和仿真POS应用程序界面上的操作;将录制的操作解析成第一脚本片
段;根据第一脚本片段,生成相应的测试脚本。In one embodiment, the test script acquisition module 904 is further configured to record operations on the simulated POS terminal interface and the simulated POS application interface; parsing the recorded operations into the first script piece
Segment; according to the first script fragment, generate the corresponding test script.
在一个实施例中,测试脚本获取模块904还用于检测对预设比对测试项的选择操作;获取与选择的预设比对测试项对应的比对测试对象;获取与选择的预设比对测试项对应的预设脚本片段模板;根据比对测试对象和预设脚本片段模板,生成第二脚本片段;第二脚本片段用于执行时将比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果;根据第一脚本片段和第二脚本片段,生成相应的测试脚本。In one embodiment, the test script obtaining module 904 is further configured to detect a selection operation on the preset comparison test item; acquire a comparison test object corresponding to the selected preset comparison test item; and obtain a preset ratio compared with the selected a preset script segment template corresponding to the test item; generating a second script segment according to the comparison test object and the preset script segment template; and the second script segment is used to compare the comparison test object with the corresponding standard reference object Corresponding comparison test results are obtained; corresponding test scripts are generated according to the first script segment and the second script segment.
在一个实施例中,测试脚本执行模块906还用于当测试脚本所对应的目标对象包括物理POS终端时,发送测试脚本至连接有物理POS终端的测试执行器,使测试执行器执行测试脚本,对物理POS终端进行测试。In one embodiment, the test script execution module 906 is further configured to: when the target object corresponding to the test script includes a physical POS terminal, send the test script to the test executor connected to the physical POS terminal, so that the test executor executes the test script, Test the physical POS terminal.
在一个实施例中,测试脚本执行模块906还用于当测试脚本所对应的目标对象为POS应用程序时,则发送测试脚本至运行于仿真环境的测试执行器,使运行于仿真环境的测试执行器执行测试脚本,对仿真POS应用程序进行测试。In one embodiment, the test script execution module 906 is further configured to: when the target object corresponding to the test script is a POS application, send the test script to the test executor running in the simulation environment, so that the test execution running in the simulation environment is performed. The test script is executed to test the simulated POS application.
如图10所示,在一个实施例中,该服务器还包括:As shown in FIG. 10, in an embodiment, the server further includes:
回归测试模块908,用于接收回归测试请求;获取与回归测试请求对应的测试用例;将对应的测试用例所对应的测试脚本添加至测试任务队列中并通知测试脚本执行模块906。The regression test module 908 is configured to receive the regression test request, obtain the test case corresponding to the regression test request, add the test script corresponding to the corresponding test case to the test task queue, and notify the test script execution module 906.
测试脚本执行模块906还用于将测试任务队列下发至测试执行器,使测试执行器依次执行测试任务队列中的测试脚本,以进行回归测试。The test script execution module 906 is further configured to send the test task queue to the test executor, so that the test executor sequentially executes the test script in the test task queue for regression testing.
如图11所示,在一个实施例中,提供了一种终端1100,终端1100的内部结构可对应于如图3所示的结构。下述每个模块可全部或部分通过软件、硬件或其组合来实现。As shown in FIG. 11, in one embodiment, a terminal 1100 is provided, and the internal structure of the terminal 1100 may correspond to the structure as shown in FIG. Each of the modules described below may be implemented in whole or in part by software, hardware, or a combination thereof.
在一个实施例中,该终端1100包括:获取模块1102、解析模块1104、操作录制模块1106、测试脚本生成模块1108以及发送模块1110,其中:In an embodiment, the terminal 1100 includes: an obtaining module 1102, a parsing module 1104, an operation recording module 1106, a test script generating module 1108, and a sending module 1110, where:
获取模块1102,用于获取对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据。
The obtaining module 1102 is configured to obtain webpage data of the simulated POS application obtained by performing simulation processing on the native POS application.
解析模块1104,用于解析仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面。The parsing module 1104 is configured to parse the webpage data of the emulating POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface.
操作录制模块1106,用于录制作用于仿真POS终端界面和仿真POS应用程序界面上的操作。The operation recording module 1106 is configured to record operations on the simulated POS terminal interface and the simulated POS application interface.
测试脚本生成模块1108,用于根据录制的操作,生成相应的测试脚本。The test script generating module 1108 is configured to generate a corresponding test script according to the recorded operation.
发送模块1110,用于将测试脚本发送至服务器,使服务器在需要执行测试脚本时,将测试脚本发送至测试执行器,以使测试执行器执行测试脚本。The sending module 1110 is configured to send the test script to the server, so that the server sends the test script to the test executor when the test script needs to be executed, so that the test executor executes the test script.
在一个实施例中,测试脚本生成模块1108还用于将录制的操作解析成第一脚本片段,根据第一脚本片段,生成相应的测试脚本。In one embodiment, the test script generation module 1108 is further configured to parse the recorded operation into a first script segment, and generate a corresponding test script according to the first script segment.
在一个实施例中,测试脚本生成模块1108还用于检测对预设比对测试项的选择操作;获取与选择的预设比对测试项对应的比对测试对象;获取与选择的预设比对测试项对应的预设脚本片段模板;根据比对测试对象和预设脚本片段模板,生成第二脚本片段;第二脚本片段用于执行时将比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果;根据第一脚本片段和第二脚本片段,生成相应的测试脚本。In one embodiment, the test script generation module 1108 is further configured to detect a selection operation on the preset comparison test item; acquire a comparison test object corresponding to the selected preset comparison test item; and obtain a preset ratio compared with the selected a preset script segment template corresponding to the test item; generating a second script segment according to the comparison test object and the preset script segment template; and the second script segment is used to compare the comparison test object with the corresponding standard reference object Corresponding comparison test results are obtained; corresponding test scripts are generated according to the first script segment and the second script segment.
一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端,使所述终端解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;获取通过录制作用于所述仿真POS终端界面以及所述仿真POS应用程序界面上的操作所生成的相应的测试脚本;发送所述测试脚本至测试执行器并执行。One or more non-transitory readable storage mediums storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the steps of: transmitting Simulating the webpage data of the simulated POS application obtained by the native POS application to the terminal, causing the terminal to parse the webpage data of the emulated POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface. Obtaining a corresponding test script generated by recording an operation on the simulated POS terminal interface and the simulated POS application interface; transmitting the test script to the test executor and executing.
在一个实施例中,在所述发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端之前,所述计算机可读指令还使得处理器执行以下步骤:获取原生POS应用程序的网页数据;在所述原生POS应用程序的网页数据中,添加相应的POS应用程序仿真接口数据和仿真POS终端界面数据,以得到仿真POS应用程序的网页数据。
In one embodiment, the computer readable instructions further cause the processor to perform the following steps: acquiring a native POS application before transmitting the webpage data of the simulated POS application obtained by emulating the native POS application to the terminal The webpage data; in the webpage data of the native POS application, adding corresponding POS application emulation interface data and emulating POS terminal interface data to obtain webpage data of the emulated POS application.
在一个实施例中,所述获取通过录制作用于所述仿真POS终端界面以及所述仿真POS应用程序界面上的操作所生成的相应的测试脚本包括:录制作用于所述仿真POS终端界面和所述仿真POS应用程序界面上的操作;将录制的所述操作解析成第一脚本片段;及根据所述第一脚本片段,生成相应的测试脚本。In one embodiment, the obtaining a corresponding test script generated by recording an operation on the simulated POS terminal interface and the simulated POS application interface includes: recording acting on the simulated POS terminal interface and An operation on the simulated POS application interface; parsing the recorded operation into a first script segment; and generating a corresponding test script according to the first script segment.
在一个实施例中,在所述根据所述第一脚本片段,生成相应的测试脚本之前,所述计算机可读指令还使得处理器执行以下步骤:检测对预设比对测试项的选择操作;获取与选择的所述预设比对测试项对应的比对测试对象;获取与选择的所述预设比对测试项对应的预设脚本片段模板;及根据所述比对测试对象和所述预设脚本片段模板,生成第二脚本片段;所述第二脚本片段用于执行时将所述比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果。In one embodiment, before the generating the corresponding test script according to the first script segment, the computer readable instructions further cause the processor to perform the step of: detecting a selection operation on the preset comparison test item; Acquiring a comparison test object corresponding to the selected preset comparison test item; acquiring a preset script fragment template corresponding to the selected preset comparison test item; and according to the comparison test object and the The script fragment template is preset to generate a second script segment. The second script segment is used to compare the comparison test object with the corresponding standard reference object to obtain a corresponding comparison test result.
本实施例中,所述根据所述第一脚本片段,生成相应的测试脚本包括:In this embodiment, the generating the corresponding test script according to the first script segment includes:
根据所述第一脚本片段和所述第二脚本片段,生成相应的测试脚本。Corresponding test scripts are generated according to the first script segment and the second script segment.
在一个实施例中,所述发送所述测试脚本至测试执行器并执行包括:In one embodiment, the sending the test script to the test executor and executing comprises:
当所述测试脚本所对应的目标对象包括物理POS终端时,发送所述测试脚本至连接有物理POS终端的测试执行器,使所述测试执行器执行所述测试脚本,对所述物理POS终端进行测试。When the target object corresponding to the test script includes a physical POS terminal, send the test script to a test executor connected to the physical POS terminal, so that the test executor executes the test script to the physical POS terminal. carry out testing.
在一个实施例中,所述发送所述测试脚本至测试执行器并执行还包括:In one embodiment, the sending the test script to the test executor and executing further comprises:
当所述测试脚本所对应的目标对象为POS应用程序时,则发送所述测试脚本至运行于仿真环境的测试执行器,使所述运行于仿真环境的测试执行器执行所述测试脚本,对所述仿真POS应用程序进行测试。When the target object corresponding to the test script is a POS application, send the test script to a test executor running in the simulation environment, so that the test executor running in the simulation environment executes the test script, The simulated POS application is tested.
在一个实施例中,所述计算机可读指令还使得处理器执行以下步骤:接收回归测试请求;获取与所述回归测试请求对应的测试用例;将所述对应的测试用例所对应的测试脚本添加至测试任务队列中;及将所述测试任务队列下发至测试执行器,使所述测试执行器依次执行所述测试任务队列中的测试脚本,以进行回归测试。
In one embodiment, the computer readable instructions further cause the processor to perform the steps of: receiving a regression test request; acquiring a test case corresponding to the regression test request; adding a test script corresponding to the corresponding test case And to the test task queue; and the test task queue is sent to the test executor, so that the test executor sequentially executes the test script in the test task queue for regression testing.
在一个实施例中,提供了一种终端,该终端包括存储器和处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时,使得处理器执行以下步骤:获取对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据;解析仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;录制作用于仿真POS终端界面和仿真POS应用程序界面上的操作;根据录制的操作,生成相应的测试脚本;将测试脚本发送至服务器,使服务器在需要执行测试脚本时,将测试脚本发送至测试执行器,以使测试执行器执行测试脚本。In one embodiment, a terminal is provided that includes a memory and a processor having stored therein computer readable instructions that, when executed by a processor, cause the processor to perform the steps of: acquiring a native POS The application simulates the webpage data of the simulated POS application; parses the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS application interface; the recording acts on the simulated POS terminal interface and the simulated POS The operation on the application interface; according to the recorded operation, generate the corresponding test script; send the test script to the server, so that the server sends the test script to the test executor when the test script needs to be executed, so that the test executor performs the test script.
在一个实施例中,处理器所执行的根据录制的操作,生成相应的测试脚本,包括:将录制的操作解析成第一脚本片段,根据第一脚本片段,生成相应的测试脚本。In one embodiment, the corresponding test script generated by the processor according to the recorded operation includes: parsing the recorded operation into a first script segment, and generating a corresponding test script according to the first script segment.
在一个实施例中,在根据第一脚本片段,生成相应的测试脚本之前,计算机可读指令还使得处理器执行以下步骤:检测对预设比对测试项的选择操作;获取与选择的预设比对测试项对应的比对测试对象;获取与选择的预设比对测试项对应的预设脚本片段模板;根据比对测试对象和预设脚本片段模板,生成第二脚本片段;第二脚本片段用于执行时将比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果。处理器所执行的根据第一脚本片段,生成相应的测试脚本,包括:根据第一脚本片段和第二脚本片段,生成相应的测试脚本。In one embodiment, prior to generating the corresponding test script according to the first script segment, the computer readable instructions further cause the processor to perform the steps of: detecting a selection operation for the preset comparison test item; acquiring and selecting the preset Comparing the test object corresponding to the test item; obtaining a preset script segment template corresponding to the selected preset comparison test item; generating a second script segment according to the comparison test object and the preset script segment template; the second script When the segment is used for execution, the comparison test object is compared with the corresponding standard reference object to obtain a corresponding comparison test result. The corresponding test script generated by the processor according to the first script segment includes: generating a corresponding test script according to the first script segment and the second script segment.
在一个实施例中,提供了一个或多个存储有计算机可读指令的非易失性可读存储介质,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:获取对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据;解析仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;录制作用于仿真POS终端界面和仿真POS应用程序界面上的操作;根据录制的操作,生成相应的测试脚本;将测试脚本发送至服务器,使服务器在需要执行测试脚本时,将测试脚本发送至测试执行器,以使测试执行器执行测试脚本。
In one embodiment, one or more non-volatile readable storage media having computer readable instructions stored by one or more processors are provided, such that one or more processors are Perform the following steps: obtaining webpage data of the simulated POS application obtained by simulating the native POS application; parsing the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and emulating POS application interface; recording function The operation of simulating the POS terminal interface and emulating the POS application interface; generating a corresponding test script according to the recorded operation; sending the test script to the server, so that the server sends the test script to the test executor when the test script needs to be executed So that the test executor executes the test script.
在一个实施例中,处理器所执行的根据录制的操作,生成相应的测试脚本,包括:将录制的操作解析成第一脚本片段,根据第一脚本片段,生成相应的测试脚本。In one embodiment, the corresponding test script generated by the processor according to the recorded operation includes: parsing the recorded operation into a first script segment, and generating a corresponding test script according to the first script segment.
在一个实施例中,在根据第一脚本片段,生成相应的测试脚本之前,计算机可读指令还使得处理器执行以下步骤:检测对预设比对测试项的选择操作;获取与选择的预设比对测试项对应的比对测试对象;获取与选择的预设比对测试项对应的预设脚本片段模板;根据比对测试对象和预设脚本片段模板,生成第二脚本片段;第二脚本片段用于执行时将比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果。处理器所执行的根据第一脚本片段,生成相应的测试脚本,包括:根据第一脚本片段和第二脚本片段,生成相应的测试脚本。In one embodiment, prior to generating the corresponding test script according to the first script segment, the computer readable instructions further cause the processor to perform the steps of: detecting a selection operation for the preset comparison test item; acquiring and selecting the preset Comparing the test object corresponding to the test item; obtaining a preset script segment template corresponding to the selected preset comparison test item; generating a second script segment according to the comparison test object and the preset script segment template; the second script When the segment is used for execution, the comparison test object is compared with the corresponding standard reference object to obtain a corresponding comparison test result. The corresponding test script generated by the processor according to the first script segment includes: generating a corresponding test script according to the first script segment and the second script segment.
需要说明的是,本申请各实施例中所用的“第一”和“第二”仅用于区分,并不用作从属、大小或先后等方面的限定。It should be noted that “first” and “second” used in the embodiments of the present application are only used for distinguishing, and are not used as a limitation on the subordinate, size or sequence.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。A person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware, and the computer program can be stored in a computer readable storage medium. When executed, the flow of an embodiment of the methods as described above may be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-described embodiments may be arbitrarily combined. For the sake of brevity of description, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, All should be considered as the scope of this manual.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对申请专利范围的限定。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。
The above-mentioned embodiments are only illustrative of several embodiments of the present application, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the claims. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the present application. Therefore, the scope of the invention should be determined by the appended claims.
Claims (20)
- 一种应用程序测试方法,包括:An application testing method that includes:发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端,使所述终端解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Sending webpage data of the simulated POS application obtained by simulating the native POS application to the terminal, causing the terminal to parse the webpage data of the emulated POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface;获取通过录制作用于所述仿真POS终端界面以及所述仿真POS应用程序界面上的操作所生成的相应的测试脚本;及Acquiring a corresponding test script generated by recording an operation on the simulated POS terminal interface and the simulated POS application interface; and发送所述测试脚本至测试执行器并执行。Send the test script to the test executor and execute.
- 根据权利要求1所述的方法,其特征在于,在所述发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端之前,所述方法还包括:The method according to claim 1, wherein before the sending the webpage data of the simulated POS application obtained by the simulation processing of the native POS application to the terminal, the method further comprises:获取原生POS应用程序的网页数据;及Get web page data for native POS applications; and在所述原生POS应用程序的网页数据中,添加相应的POS应用程序仿真接口数据和仿真POS终端界面数据,以得到仿真POS应用程序的网页数据。In the webpage data of the native POS application, corresponding POS application emulation interface data and emulation POS terminal interface data are added to obtain webpage data of the emulated POS application.
- 根据权利要求1所述的方法,其特征在于,所述获取通过录制作用于所述仿真POS终端界面以及所述仿真POS应用程序界面上的操作所生成的相应的测试脚本包括:The method of claim 1, wherein the obtaining a corresponding test script generated by recording an operation on the simulated POS terminal interface and the simulated POS application interface comprises:录制作用于所述仿真POS终端界面和所述仿真POS应用程序界面上的操作;Recording operations on the simulated POS terminal interface and the simulated POS application interface;将录制的所述操作解析成第一脚本片段;及Parsing the recorded operation into a first script segment; and根据所述第一脚本片段,生成相应的测试脚本。Corresponding test scripts are generated according to the first script segment.
- 根据权利要求3所述的方法,其特征在于,在所述根据所述第一脚本片段,生成相应的测试脚本之前,所述方法还包括:The method according to claim 3, wherein before the generating the corresponding test script according to the first script segment, the method further comprises:检测对预设比对测试项的选择操作;Detecting a selection operation for a preset comparison test item;获取与选择的所述预设比对测试项对应的比对测试对象;Obtaining a comparison test object corresponding to the selected preset comparison test item;获取与选择的所述预设比对测试项对应的预设脚本片段模板;及Obtaining a preset script segment template corresponding to the selected preset comparison test item; and根据所述比对测试对象和所述预设脚本片段模板,生成第二脚本片段; 所述第二脚本片段用于执行时将所述比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果;Generating a second script segment according to the comparison test object and the preset script segment template; The second script segment is used to compare the comparison test object with a corresponding standard reference object to obtain a corresponding comparison test result;所述根据所述第一脚本片段,生成相应的测试脚本包括:The generating the corresponding test script according to the first script segment includes:根据所述第一脚本片段和所述第二脚本片段,生成相应的测试脚本。Corresponding test scripts are generated according to the first script segment and the second script segment.
- 根据权利要求1所述的方法,其特征在于,所述发送所述测试脚本至测试执行器并执行包括:The method of claim 1, wherein the transmitting the test script to the test executor and executing comprises:当所述测试脚本所对应的目标对象包括物理POS终端时,发送所述测试脚本至连接有物理POS终端的测试执行器,使所述测试执行器执行所述测试脚本,对所述物理POS终端进行测试。When the target object corresponding to the test script includes a physical POS terminal, send the test script to a test executor connected to the physical POS terminal, so that the test executor executes the test script to the physical POS terminal. carry out testing.
- 根据权利要求5所述的方法,其特征在于,所述发送所述测试脚本至测试执行器并执行还包括:The method according to claim 5, wherein the sending the test script to the test executor and executing further comprises:当所述测试脚本所对应的目标对象为POS应用程序时,则发送所述测试脚本至运行于仿真环境的测试执行器,使所述运行于仿真环境的测试执行器执行所述测试脚本,对所述仿真POS应用程序进行测试。When the target object corresponding to the test script is a POS application, send the test script to a test executor running in the simulation environment, so that the test executor running in the simulation environment executes the test script, The simulated POS application is tested.
- 根据权利要求1至6中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 6, wherein the method further comprises:接收回归测试请求;Receiving a regression test request;获取与所述回归测试请求对应的测试用例;Obtaining a test case corresponding to the regression test request;将所述对应的测试用例所对应的测试脚本添加至测试任务队列中;及Adding a test script corresponding to the corresponding test case to the test task queue; and将所述测试任务队列下发至测试执行器,使所述测试执行器依次执行所述测试任务队列中的测试脚本,以进行回归测试。The test task queue is sent to the test executor, so that the test executor sequentially executes the test script in the test task queue for regression testing.
- 一种应用程序测试方法,包括:An application testing method that includes:获取对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据;Obtaining webpage data of the simulated POS application obtained by simulating the native POS application;解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Parsing the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS application interface;录制作用于所述仿真POS终端界面和所述仿真POS应用程序界面上的操 作;Recording operations on the simulated POS terminal interface and the simulated POS application interface Work根据录制的所述操作,生成相应的测试脚本;及Generate a corresponding test script according to the operation described in the recording; and将所述测试脚本发送至服务器,使所述服务器在需要执行所述测试脚本时,将所述测试脚本发送至测试执行器,以使所述测试执行器执行所述测试脚本。Sending the test script to a server, causing the server to send the test script to a test executor when the test script needs to be executed, so that the test executor executes the test script.
- 根据权利要求8所述的方法,其特征在于,所述根据录制的所述操作,生成相应的测试脚本包括:The method according to claim 8, wherein the generating the corresponding test script according to the recorded operation comprises:将录制的操作解析成第一脚本片段;及Parsing the recorded operation into the first script fragment; and根据第一脚本片段,生成相应的测试脚本。Generate the corresponding test script based on the first script fragment.
- 根据权利要求9所述的方法,其特征在于,在所述根据第一脚本片段,生成相应的测试脚本之前,所述方法还包括:The method according to claim 9, wherein before the generating the corresponding test script according to the first script segment, the method further comprises:检测对预设比对测试项的选择操作;Detecting a selection operation for a preset comparison test item;获取与选择的所述预设比对测试项对应的比对测试对象;Obtaining a comparison test object corresponding to the selected preset comparison test item;获取与选择的所述预设比对测试项对应的预设脚本片段模板;及Obtaining a preset script segment template corresponding to the selected preset comparison test item; and根据所述比对测试对象和所述预设脚本片段模板,生成第二脚本片段;所述第二脚本片段用于执行时将所述比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果;Generating a second script segment according to the comparison test object and the preset script segment template; the second script segment is configured to compare the comparison test object with a corresponding standard reference object when executed Alignment test results;所述根据所述第一脚本片段,生成相应的测试脚本包括:The generating the corresponding test script according to the first script segment includes:根据所述第一脚本片段和所述第二脚本片段,生成相应的测试脚本。Corresponding test scripts are generated according to the first script segment and the second script segment.
- 一种服务器,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:A server comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端,使所述终端解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Sending webpage data of the simulated POS application obtained by simulating the native POS application to the terminal, causing the terminal to parse the webpage data of the emulated POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface;获取通过录制作用于所述仿真POS终端界面以及所述仿真POS应用程序界面上的操作所生成的相应的测试脚本;及 Acquiring a corresponding test script generated by recording an operation on the simulated POS terminal interface and the simulated POS application interface; and发送所述测试脚本至测试执行器并执行。Send the test script to the test executor and execute.
- 根据权利要求11所述的服务器,其特征在于,在所述发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端之前,所述计算机可读指令还使得处理器执行以下步骤:The server according to claim 11, wherein said computer readable instructions further cause said processor to execute said webpage data of said simulated POS application obtained by emulating said native POS application to said terminal step:获取原生POS应用程序的网页数据;及Get web page data for native POS applications; and在所述原生POS应用程序的网页数据中,添加相应的POS应用程序仿真接口数据和仿真POS终端界面数据,以得到仿真POS应用程序的网页数据。In the webpage data of the native POS application, corresponding POS application emulation interface data and emulation POS terminal interface data are added to obtain webpage data of the emulated POS application.
- 根据权利要求11所述的服务器,其特征在于,所述处理器所执行的所述获取通过录制作用于所述仿真POS终端界面以及所述仿真POS应用程序界面上的操作所生成的相应的测试脚本包括:The server according to claim 11, wherein said acquisition performed by said processor generates a corresponding test generated by recording an operation on said simulated POS terminal interface and said simulated POS application interface The script includes:录制作用于所述仿真POS终端界面和所述仿真POS应用程序界面上的操作;Recording operations on the simulated POS terminal interface and the simulated POS application interface;将录制的所述操作解析成第一脚本片段;及Parsing the recorded operation into a first script segment; and根据所述第一脚本片段,生成相应的测试脚本。Corresponding test scripts are generated according to the first script segment.
- 根据权利要求13所述的服务器,其特征在于,在所述根据所述第一脚本片段,生成相应的测试脚本之前,所述计算机可读指令还使得处理器执行以下步骤:The server according to claim 13, wherein said computer readable instructions further cause said processor to perform the following steps before said generating said corresponding test script based on said first script segment:检测对预设比对测试项的选择操作;Detecting a selection operation for a preset comparison test item;获取与选择的所述预设比对测试项对应的比对测试对象;Obtaining a comparison test object corresponding to the selected preset comparison test item;获取与选择的所述预设比对测试项对应的预设脚本片段模板;及Obtaining a preset script segment template corresponding to the selected preset comparison test item; and根据所述比对测试对象和所述预设脚本片段模板,生成第二脚本片段;所述第二脚本片段用于执行时将所述比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果;Generating a second script segment according to the comparison test object and the preset script segment template; the second script segment is configured to compare the comparison test object with a corresponding standard reference object when executed Alignment test results;所述处理器所执行的所述根据所述第一脚本片段,生成相应的测试脚本包括:The generating, by the processor, the generating a corresponding test script according to the first script segment includes:根据所述第一脚本片段和所述第二脚本片段,生成相应的测试脚本。Corresponding test scripts are generated according to the first script segment and the second script segment.
- 根据权利要求11所述的服务器,其特征在于,所述处理器所执行的 所述发送所述测试脚本至测试执行器并执行包括:The server of claim 11 wherein said processor executes The sending the test script to the test executor and executing comprises:当所述测试脚本所对应的目标对象包括物理POS终端时,发送所述测试脚本至连接有物理POS终端的测试执行器,使所述测试执行器执行所述测试脚本,对所述物理POS终端进行测试。When the target object corresponding to the test script includes a physical POS terminal, send the test script to a test executor connected to the physical POS terminal, so that the test executor executes the test script to the physical POS terminal. carry out testing.
- 一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more non-transitory readable storage mediums storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:发送对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据至终端,使所述终端解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Sending webpage data of the simulated POS application obtained by simulating the native POS application to the terminal, causing the terminal to parse the webpage data of the emulated POS application to load and display the corresponding emulated POS terminal interface and the emulated POS application interface;获取通过录制作用于所述仿真POS终端界面以及所述仿真POS应用程序界面上的操作所生成的相应的测试脚本;及Acquiring a corresponding test script generated by recording an operation on the simulated POS terminal interface and the simulated POS application interface; and发送所述测试脚本至测试执行器并执行。Send the test script to the test executor and execute.
- 一种终端,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行以下步骤:A terminal comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:获取对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据;Obtaining webpage data of the simulated POS application obtained by simulating the native POS application;解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Parsing the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS application interface;录制作用于所述仿真POS终端界面和所述仿真POS应用程序界面上的操作;Recording operations on the simulated POS terminal interface and the simulated POS application interface;根据录制的所述操作,生成相应的测试脚本;及Generate a corresponding test script according to the operation described in the recording; and将所述测试脚本发送至服务器,使所述服务器在需要执行所述测试脚本时,将所述测试脚本发送至测试执行器,以使所述测试执行器执行所述测试脚本。Sending the test script to a server, causing the server to send the test script to a test executor when the test script needs to be executed, so that the test executor executes the test script.
- 根据权利要求17所述的终端,其特征在于,所述处理器所执行的所 述根据录制的所述操作,生成相应的测试脚本包括:The terminal according to claim 17, wherein said processor executes According to the operation described in the recording, generating a corresponding test script includes:将录制的操作解析成第一脚本片段;及Parsing the recorded operation into the first script fragment; and根据第一脚本片段,生成相应的测试脚本。Generate the corresponding test script based on the first script fragment.
- 根据权利要求18所述的终端,其特征在于,在所述根据第一脚本片段,生成相应的测试脚本之前,所述计算机可读指令还使得所述处理器执行以下步骤:The terminal according to claim 18, wherein said computer readable instructions further cause said processor to perform the following steps before said generating a corresponding test script according to said first script segment:检测对预设比对测试项的选择操作;Detecting a selection operation for a preset comparison test item;获取与选择的所述预设比对测试项对应的比对测试对象;Obtaining a comparison test object corresponding to the selected preset comparison test item;获取与选择的所述预设比对测试项对应的预设脚本片段模板;及Obtaining a preset script segment template corresponding to the selected preset comparison test item; and根据所述比对测试对象和所述预设脚本片段模板,生成第二脚本片段;所述第二脚本片段用于执行时将所述比对测试对象与相应的标准参照对象进行比对得到相应的比对测试结果;Generating a second script segment according to the comparison test object and the preset script segment template; the second script segment is configured to compare the comparison test object with a corresponding standard reference object when executed Alignment test results;所述处理器执行所述根据所述第一脚本片段,生成相应的测试脚本包括:And executing, by the processor, the generating the corresponding test script according to the first script segment, including:根据所述第一脚本片段和所述第二脚本片段,生成相应的测试脚本。Corresponding test scripts are generated according to the first script segment and the second script segment.
- 一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more non-transitory readable storage mediums storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:获取对原生POS应用程序进行仿真处理得到的仿真POS应用程序的网页数据;Obtaining webpage data of the simulated POS application obtained by simulating the native POS application;解析所述仿真POS应用程序的网页数据,以加载显示相应的仿真POS终端界面和仿真POS应用程序界面;Parsing the webpage data of the simulated POS application to load and display the corresponding simulated POS terminal interface and the simulated POS application interface;录制作用于所述仿真POS终端界面和所述仿真POS应用程序界面上的操作;Recording operations on the simulated POS terminal interface and the simulated POS application interface;根据录制的所述操作,生成相应的测试脚本;及Generate a corresponding test script according to the operation described in the recording; and将所述测试脚本发送至服务器,使所述服务器在需要执行所述测试脚本时,将所述测试脚本发送至测试执行器,以使所述测试执行器执行所述测试脚本。 Sending the test script to a server, causing the server to send the test script to a test executor when the test script needs to be executed, so that the test executor executes the test script.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710221969.5 | 2017-04-06 | ||
CN201710221969.5A CN107145440B (en) | 2017-04-06 | 2017-04-06 | Application program testing method and device and computer equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018184361A1 true WO2018184361A1 (en) | 2018-10-11 |
Family
ID=59775108
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/102987 WO2018184361A1 (en) | 2017-04-06 | 2017-09-22 | Application test method, server, terminal, and storage media |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107145440B (en) |
WO (1) | WO2018184361A1 (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107145440B (en) * | 2017-04-06 | 2020-07-24 | 百富计算机技术(深圳)有限公司 | Application program testing method and device and computer equipment |
CN107632869B (en) * | 2017-09-15 | 2021-01-26 | 百富计算机技术(深圳)有限公司 | Method and equipment for loading user interface of POS application |
CN107748718B (en) * | 2017-10-11 | 2020-12-18 | 百富计算机技术(深圳)有限公司 | Application program testing method and device and server |
CN107770165B (en) * | 2017-10-12 | 2021-02-02 | 携程金融科技(上海)有限公司 | Method and device for sending request by analog equipment |
CN108363663B (en) * | 2018-02-02 | 2021-05-11 | 浙江德景电子科技有限公司 | Application of intelligent POS terminal to inspection bank card detection center authentication |
CN108446215B (en) * | 2018-02-05 | 2021-04-23 | 百富计算机技术(深圳)有限公司 | POS machine test method, device, system and terminal |
CN108717393B (en) * | 2018-05-16 | 2022-05-27 | 平安科技(深圳)有限公司 | Application program testing method and mobile terminal |
CN110502414B (en) * | 2019-08-20 | 2023-08-29 | Oppo广东移动通信有限公司 | Terminal equipment performance testing method, device, terminal equipment and storage medium |
CN111556038A (en) * | 2020-04-21 | 2020-08-18 | 深圳市网安计算机安全检测技术有限公司 | Application-oriented running content monitoring method and device, computer equipment and medium |
CN113515453B (en) * | 2021-06-24 | 2021-12-07 | 航天中认软件测评科技(北京)有限责任公司 | Webpage testing system |
CN113918458A (en) * | 2021-10-13 | 2022-01-11 | 网易(杭州)网络有限公司 | Script processing method, server and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150100829A1 (en) * | 2013-10-04 | 2015-04-09 | Unisys Corporation | Method and system for selecting and executing test scripts |
CN105224456A (en) * | 2015-09-29 | 2016-01-06 | 北京奇虎科技有限公司 | A kind of test script generates methods, devices and systems |
CN105893235A (en) * | 2015-01-26 | 2016-08-24 | 中国移动通信集团浙江有限公司 | Simulation testing method and apparatus, and server |
CN107145440A (en) * | 2017-04-06 | 2017-09-08 | 百富计算机技术(深圳)有限公司 | Applied program testing method, device and computer equipment |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101135989B (en) * | 2006-08-31 | 2010-11-24 | 中国银联股份有限公司 | Automatization test method and device for Web applied system |
WO2011162832A1 (en) * | 2010-06-25 | 2011-12-29 | Pass Touch, Llc | System and method for signature pathway authentication and identification |
CN104679644B (en) * | 2013-11-28 | 2017-10-31 | 比亚迪股份有限公司 | The method of testing and system of application program in mobile terminal |
CN104268079B (en) * | 2014-09-24 | 2017-10-31 | 福建联迪商用设备有限公司 | A kind of method and system of POS Application testings |
CN104216832A (en) * | 2014-09-24 | 2014-12-17 | 福建联迪商用设备有限公司 | POS (Point of Sale) application testing method and system |
CN104199780A (en) * | 2014-09-24 | 2014-12-10 | 福建联迪商用设备有限公司 | Method and system testing POS application program |
CN105930259B (en) * | 2015-12-23 | 2018-10-16 | 中国银联股份有限公司 | A kind of method and apparatus of WEB regression tests |
CN108446215B (en) * | 2018-02-05 | 2021-04-23 | 百富计算机技术(深圳)有限公司 | POS machine test method, device, system and terminal |
-
2017
- 2017-04-06 CN CN201710221969.5A patent/CN107145440B/en active Active
- 2017-09-22 WO PCT/CN2017/102987 patent/WO2018184361A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150100829A1 (en) * | 2013-10-04 | 2015-04-09 | Unisys Corporation | Method and system for selecting and executing test scripts |
CN105893235A (en) * | 2015-01-26 | 2016-08-24 | 中国移动通信集团浙江有限公司 | Simulation testing method and apparatus, and server |
CN105224456A (en) * | 2015-09-29 | 2016-01-06 | 北京奇虎科技有限公司 | A kind of test script generates methods, devices and systems |
CN107145440A (en) * | 2017-04-06 | 2017-09-08 | 百富计算机技术(深圳)有限公司 | Applied program testing method, device and computer equipment |
Also Published As
Publication number | Publication date |
---|---|
CN107145440B (en) | 2020-07-24 |
CN107145440A (en) | 2017-09-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018184361A1 (en) | Application test method, server, terminal, and storage media | |
CN108959068B (en) | Software interface testing method, device and storage medium | |
CN107402880B (en) | Test method and electronic equipment | |
US8490059B2 (en) | Cross-browser testing of a web application | |
US20140237451A1 (en) | Exposing method related data calls during testing in an event driven, multichannel architecture | |
US11237948B2 (en) | Rendering engine component abstraction system | |
CN106815141A (en) | A kind of method for testing software and device | |
CN107977308A (en) | interface test method and device | |
CN108111364B (en) | Service system testing method and device | |
US9898390B2 (en) | Virtual service localization | |
CN106815142A (en) | A kind of method for testing software and system | |
CN111290941A (en) | Test method, apparatus, computing device and medium for multiple interfaces | |
US20200293592A1 (en) | Methods and systems for browser extension used to generate relative xpath, absolute xpath and/or css selectors | |
CN111666201A (en) | Regression testing method, device, medium and electronic equipment | |
WO2021129335A1 (en) | Operation monitoring method and apparatus, operation analysis method and apparatus | |
CN107844486B (en) | Method and system for analyzing webpage problems for client | |
CN105486998A (en) | Processor board card parameter lossless automatic test method and monitoring host device | |
CN110232018A (en) | Interface test method, device, computer equipment | |
CN110543429A (en) | Test case debugging method, device and storage medium | |
CN117493188A (en) | Interface testing methods and devices, electronic equipment and storage media | |
WO2016188101A1 (en) | Service system test method and device | |
CN114564387A (en) | Scene type automatic testing method and system for OpenStack cloud platform | |
US9304891B1 (en) | Load-test generator | |
CN116955193A (en) | Interface testing method, device, equipment and storage medium | |
CN115048295A (en) | Test method, test device, test terminal and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17904536 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17904536 Country of ref document: EP Kind code of ref document: A1 |