WO2020233065A1 - 网络环境测试方法、装置及终端设备 - Google Patents

网络环境测试方法、装置及终端设备 Download PDF

Info

Publication number
WO2020233065A1
WO2020233065A1 PCT/CN2019/121680 CN2019121680W WO2020233065A1 WO 2020233065 A1 WO2020233065 A1 WO 2020233065A1 CN 2019121680 W CN2019121680 W CN 2019121680W WO 2020233065 A1 WO2020233065 A1 WO 2020233065A1
Authority
WO
WIPO (PCT)
Prior art keywords
network environment
execution result
tested
execution
event
Prior art date
Application number
PCT/CN2019/121680
Other languages
English (en)
French (fr)
Inventor
梅锦振华
孙锦程
徐志成
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2020233065A1 publication Critical patent/WO2020233065A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures

Definitions

  • This application belongs to the field of data processing technology, and particularly relates to network environment testing methods, devices, terminal equipment, and computer non-volatile readable storage media.
  • the switching of the network environment is mainly performed manually. Specifically, when the tester executes the program corresponding to the function to be tested, the network environment is manually switched at the same time. On the one hand, the efficiency of manual switching is low. The test is more troublesome when there are many network environments to be tested; on the other hand, manual operation will also bring about inaccurate testing, that is, it is impossible to guarantee that the operation of the program corresponding to the function to be tested and the switching of the network environment are performed at the same time . In summary, the efficiency and accuracy of network environment testing in the prior art are low.
  • the embodiments of the present application provide a network environment test method, device, terminal device, and computer non-volatile readable storage medium to solve the problem of low efficiency and accuracy of network environment testing in the prior art.
  • the first aspect of the embodiments of the present application provides a network environment testing method, including:
  • the network environment set including a source network environment and a destination network environment
  • the second aspect of the embodiments of the present application provides a network environment testing device, including:
  • the adding unit is used to monitor touch events generated by executing the program corresponding to the function to be tested in a preset standard network environment, add the monitored touch event to the target event set, and determine the corresponding function to the function to be tested The first execution result of the program, wherein the touch event includes a touch position;
  • An obtaining unit configured to obtain at least one network environment set, the network environment set including a source network environment and a destination network environment;
  • the switching unit is configured to determine any network environment set in at least one of the network environment sets as a test environment set, deploy the source network environment in the test environment set, execute the target event set, and During the execution of the target event set, switch the source network environment to the target network environment in the environment set to be tested, and determine the second execution result until the second execution corresponding to each network environment set is obtained So far
  • the output unit is configured to output a prompt indicating that the network environment set test corresponding to the second execution result is successful if the second execution result is consistent with the first execution result.
  • a third aspect of the embodiments of the present application provides a terminal device.
  • the terminal device includes a memory, a processor, and computer-readable instructions that are stored in the memory and run on the processor.
  • the processor The following steps are implemented when the computer-readable instruction is executed:
  • the network environment set including a source network environment and a destination network environment
  • the fourth aspect of the embodiments of the present application provides a computer non-volatile readable storage medium, the computer non-volatile readable storage medium stores computer readable instructions, and the computer readable instructions are executed by a processor When implementing the following steps:
  • the network environment set including a source network environment and a destination network environment
  • the touch events monitored during the execution of the program corresponding to the function to be tested are added to the target event set, and the first execution result of the program corresponding to the function to be tested is determined, and then different network environment sets are deployed.
  • Execute the program corresponding to the function to be tested switch the source network environment in the network environment concentration to the destination network environment during the execution of the program corresponding to the function to be tested, determine the second execution result, and output the second execution result corresponding to the first execution result
  • the network environment set test is successful.
  • the embodiment of the present application realizes automatic testing of different network environment sets by monitoring the touch events generated when the program corresponding to the function to be tested is executed, thereby improving the efficiency and accuracy of the network environment test.
  • FIG. 1 is an implementation flowchart of a network environment testing method provided by Embodiment 1 of the present application;
  • FIG. 2 is an implementation flowchart of the network environment testing method provided in the second embodiment of the present application.
  • FIG. 3 is an implementation flowchart of the network environment testing method provided in the third embodiment of the present application.
  • FIG. 4 is an implementation flowchart of a network environment testing method provided by Embodiment 4 of the present application.
  • FIG. 5 is a structural block diagram of a network environment testing device provided by Embodiment 5 of the present application.
  • FIG. 6 is a schematic diagram of a terminal device provided in Embodiment 6 of the present application.
  • FIG 1 shows the implementation process of the network environment testing method provided by the embodiment of the present application, which is detailed as follows:
  • the tester can manually execute the program corresponding to the function to be tested in the standard network environment.
  • the standard network environment is the expected network environment for executing the program corresponding to the function to be tested, which can be based on actual applications.
  • Set the scene for example, the standard network environment can be 4G environment or Wi-Fi environment, etc.
  • the monitored touch event includes a touch position, which is a coordinate corresponding to the touch event on the terminal device. It is worth noting that the target event set only indicates to categorize and store the monitored touch events, not to a specific storage format.
  • the test instruction corresponding to the program corresponding to the function to be tested can be set in advance, and the test instruction is used as the mark for the start of execution of the program corresponding to the function to be tested.
  • the function set may also be a preset request containing specific data, which is not limited in the embodiment of the present application.
  • the terminal device can determine whether the program corresponding to the function to be tested starts to execute by whether the test instruction is detected.
  • the program corresponding to the function to be tested it can be customized by the tester in advance, or it can be manually entered by the tester after the program corresponding to the function to be tested is executed.
  • the program corresponding to the function to be tested is In the case of the login function, the first execution result may be "login successful".
  • monitoring a touch event that occurs on a terminal device it can be monitored through a specific monitoring method in the operating system applied by the terminal device. For example, if the terminal device uses the Android operating system, you can use the onTouchEvent method in the Android operating system The touch event monitoring is performed. Of course, this does not constitute a limitation to the embodiment of the present application. For example, the monitoring may be performed through a third-party control or tool.
  • At least one network environment set is acquired, the network environment set including a source network environment and a destination network environment.
  • Each network environment set includes the source network environment and the destination network environment.
  • the network environment set is used to indicate the network environment switching of the program corresponding to the function to be tested In this way, the network environment set corresponding to the function to be tested can be specifically selected according to the actual application scenario.
  • the network environments involved in the embodiments of this application include but are not limited to 3G, 4G, Wi-Fi, Edge, and wireless application protocols (Wireless Application Protocol, WAP), 3G and 4G can also be subdivided into network environments provided by different operators (China Mobile, China Unicom or Telecom, etc.).
  • At least one of the network environment sets in the network environment set is determined as the environment set to be tested, the source network environment in the environment set to be tested is deployed, and the target event set is executed.
  • the execution of the event set switch the source network environment to the destination network environment in the environment set to be tested, and determine a second execution result until the second execution result corresponding to each network environment set is obtained until.
  • the execution of the program corresponding to the function to be tested is tested according to each network environment set. Specifically, any network environment set is determined as the environment set to be tested, the source network environment of the set of environment to be tested is deployed on the terminal device, and touch events in the target event set are executed in the source network environment (execution of touch events) The order is the same as the execution order in step S101), then, switch the source network environment to the destination network environment in the environment set to be tested, determine the second execution result generated by executing the target event set, and repeat the above process until you get the same To the second execution result corresponding to the set of network environments. It is worth mentioning that the switch from the source network environment to the destination network environment can be achieved by calling open source tools such as Fidder.
  • the execution duration of the first execution result is determined, and the threshold duration is determined according to the execution duration.
  • the execution duration indicates the length of time from the execution of the program corresponding to the function to be tested to the determination of the first execution result; in the execution of the target event set After the threshold duration, the execution result that appears is determined as the second execution result.
  • determine the execution time of the first execution result in order to improve the test efficiency and prevent the test process of the environment set to be tested from consuming a lot of time, determine the execution time of the first execution result, and the execution time is from the execution of the program corresponding to the function to be tested The duration from the beginning to the determination of the first execution result, and then the threshold duration is determined according to the execution duration.
  • the embodiment of the present application does not limit the method for determining the threshold duration, but the threshold duration is defined to be greater than or equal to the execution duration, such as the execution duration. Based on this, ten minutes is added as the threshold time. After an environment set to be tested has been deployed and the threshold duration of the target event set is started, the execution result that appears is determined as the second execution result. Through the above method, the test process can be avoided because the test process of a certain network environment set is too long.
  • the second execution result is obtained, if the second execution result is consistent with the first execution result, for example, if the first execution result is "login successful" and the second execution result is also "login successful", then the first execution result is output. 2.
  • the monitored touch event is added to the target event set during the execution of the program corresponding to the function to be tested, and the first execution result of the program corresponding to the function to be tested is determined.
  • Obtain at least one network environment set determine any network environment set as the test environment set, deploy the source network environment of the test environment set, execute the target event set, and switch the source network environment to the target event set during the execution of the target event set.
  • the embodiment of the present application realizes automated testing of different network environment sets by monitoring touch events, and improves the efficiency and accuracy of the network environment test.
  • Fig. 2 shows a network environment test method obtained by refining the process of adding monitored touch events to the target event set on the basis of the first embodiment of the present application.
  • the embodiment of the present application provides an implementation flowchart of a network environment testing method. As shown in FIG. 2, the network environment testing method may include the following steps:
  • an interaction event in the target event set is determined, where the interaction event is used to trigger an interaction with a server when executed.
  • different network environment sets are deployed to view the influence of the execution status of the programs corresponding to the function to be tested in different network environment sets. Since changes in the network environment will affect the interaction between the terminal device and the server, in order to improve the accuracy of the test, the network environment is replaced when the program corresponding to the function to be tested is executed and the terminal device interacts with the server. Specifically, when the monitored touch event is added to the target event set, the interaction event in the target event set is determined. The interaction event is used to trigger the interaction with the server when it is executed. Because the touch event is tested It is manually triggered by the personnel, so the tester can also determine the interactive event in the target event set. Of course, there may be other ways to determine the interactive event.
  • the target event set is being executed and the interaction event is detected, the source network environment is switched to the target network environment in the currently deployed environment set to be tested, which is convenient for analyzing the operation of switching the network environment Impact on server interaction.
  • the interaction event in the target event set is determined, where the interaction event is used to trigger the interaction with the server when it is executed, if it is detected that the interaction event is being executed ,
  • the source network environment is switched to the target network environment in the environment to be tested.
  • the embodiment of the present application switches the network environment when the terminal device interacts with the server, which further improves the accuracy of the network environment test.
  • Fig. 3 shows a network environment test method obtained by refining the process of determining interaction events in the target event set on the basis of the second embodiment of the present application.
  • the embodiment of the present application provides an implementation flowchart of a network environment testing method. As shown in FIG. 3, the network environment testing method may include the following steps:
  • the operation log related to the terminal device can be captured, and the embodiment of the present application does not limit the specific capturing method.
  • the format of the interactive requests can be preset.
  • the interactive request can be HyperText Transfer Protocol (HyperText Transfer Protocol, HTTP) request. If an interaction request is found in the running log, a touch event with the closest occurrence time to the interaction request and an occurrence time earlier than the occurrence time of the interaction request is determined as an interaction event.
  • HTTP HyperText Transfer Protocol
  • the operation log is captured, and if an interaction request is found in the operation log, the most recent touch event is determined as an interaction event, and the interaction request is used to communicate with the server
  • the embodiment of the present application determines the interaction event by searching for the interaction request, which reduces manual operations and improves the accuracy of the determined interaction event.
  • Figure 4 shows a network environment test method obtained after expansion on the basis of Embodiment 1 of the present application.
  • the embodiment of the present application provides an implementation flowchart of a network environment testing method. As shown in FIG. 4, the network environment testing method may include the following steps:
  • the state before executing the program corresponding to the function to be tested is saved as an initial state, where the initial state is a precondition for obtaining the first execution result.
  • the functions to be tested may be different types of functions.
  • the functions to be tested may be functions that can be executed repeatedly, such as voting functions or refresh functions. In this case, different network environment sets can be directly deployed repeatedly. And execute the target event set.
  • the function to be tested may also be a function that cannot be executed again after execution. That is, the state of the terminal device will change after the program corresponding to the function to be tested is executed.
  • the function to be tested is to click a button on page A to jump
  • For the function to page B since the current page is page B after executing the program corresponding to the function to be tested once, it is naturally impossible to click the button in page A.
  • the state before executing the program corresponding to the function to be tested is saved as the initial state, which is the precondition for obtaining the first execution result, that is, the state of the terminal device is the initial state
  • the first execution result can be obtained at the time, and the initial state can be the page state or the data state, etc., which is determined according to the actual application scenario.
  • the current state of the terminal device is switched to the initial state to enable the test
  • the program corresponding to the function can support repeated execution.
  • the function to be tested is a page jump function, and the initial state includes an initial page
  • the page return function is triggered to switch the current page to the initial page
  • the function to be tested is a data operation function
  • the first operation statement corresponding to the data operation function is obtained, and a second operation statement corresponding to the first operation statement is created, wherein the first operation statement and the second operation statement are inverse ( That is, if the first operation statement is to add data A to the server, the second operation statement is to delete data A in the server).
  • the second operation statement is executed to eliminate the cause
  • the format of the first operation statement and the second operation statement can be set according to actual application scenarios.
  • the format of the first operation statement and the second operation statement can be structured query language. (Structured Query Language, SQL).
  • the state before executing the program corresponding to the function to be tested is saved as the initial state, and if it is detected that the program corresponding to the function to be tested has been executed, the current state is switched to In the initial state, the embodiment of the present application eliminates the impact caused by executing the program corresponding to the function to be tested, avoids the manual elimination operation of the tester, and improves the applicability of the network environment test.
  • FIG. 5 shows a structural block diagram of the network environment testing device provided by an embodiment of the present application.
  • the network environment testing device includes:
  • the adding unit 51 is configured to monitor touch events generated by executing the program corresponding to the function to be tested in a preset standard network environment, add the monitored touch event to the target event set, and determine that the function to be tested corresponds to The first execution result of the program of, wherein the touch event includes a touch position;
  • the obtaining unit 52 is configured to obtain at least one network environment set, where the network environment set includes a source network environment and a destination network environment;
  • the switching unit 53 is configured to determine any network environment set in at least one of the network environment sets as a test environment set, deploy the source network environment in the test environment set, execute the target event set, During the execution of the target event set, switch the source network environment to the target network environment in the environment set to be tested, and determine the second execution result until the second network environment set corresponding to each network environment set is obtained. Until the result of execution;
  • the output unit 54 is configured to, if the second execution result is consistent with the first execution result, output a prompt that the network environment set test corresponding to the second execution result is successful.
  • the adding unit 51 includes:
  • a determining unit configured to determine an interaction event in the target event set, where the interaction event is used to trigger an interaction with the server when executed;
  • the switching unit 53 includes:
  • the switching subunit is configured to switch the source network environment to the destination network environment in the set of environments to be tested if it is detected that the interaction event is being executed.
  • the determining unit includes:
  • the grab unit is used to grab the running log
  • the determining subunit is configured to, if an interaction request is found in the running log, determine the most recent touch event as the interaction event, and the interaction request is used to interact with the server.
  • the network environment testing device further includes:
  • a saving unit configured to save a state before executing the program corresponding to the function to be tested as an initial state, wherein the initial state is a precondition for obtaining the first execution result
  • the state switching unit is configured to switch the current state to the initial state if it is detected that the execution of the program corresponding to the function to be tested is completed in the standard network environment or the network environment where the network environment is concentrated.
  • the switching unit 53 further includes:
  • a threshold determination unit configured to determine the execution duration of the first execution result, determine the threshold duration according to the execution duration, and the execution duration indicates the time from executing the program corresponding to the function under test to determining the first execution result Duration of time
  • the second execution result determining unit is configured to determine the appearing execution result as the second execution result after the threshold duration of the target event set is executed.
  • the network environment testing device monitors touch events and deploys different network environment sets to realize automated testing of the network environment sets and improve the efficiency and accuracy of the network environment testing.
  • Fig. 6 is a schematic diagram of a terminal device provided by an embodiment of the present application.
  • the terminal device 6 of this embodiment includes: a processor 60, a memory 61, and computer-readable instructions 62 stored in the memory 61 and running on the processor 60, such as a network environment test program.
  • the processor 60 executes the computer-readable instructions 62
  • the steps in the foregoing network environment testing method embodiments such as steps S101 to S104 shown in FIG. 1
  • the processor 60 executes the computer-readable instructions 62
  • the functions of the units in the foregoing embodiments of the network environment test apparatus such as the functions of the units 51 to 54 shown in FIG. 5, are realized.
  • the computer-readable instruction 62 may be divided into one or more units, and the one or more units are stored in the memory 61 and executed by the processor 60 to complete the application .
  • the one or more units may be an instruction segment of a series of computer-readable instructions capable of completing specific functions, and the instruction segment is used to describe the execution process of the computer-readable instruction 62 in the terminal device 6.
  • the computer-readable instruction 62 may be divided into an adding unit, an acquiring unit, a switching unit, and an output unit, and the specific functions of each unit are as follows:
  • the adding unit is used to monitor touch events generated by executing the program corresponding to the function to be tested in a preset standard network environment, add the monitored touch event to the target event set, and determine the corresponding function to the function to be tested The first execution result of the program, wherein the touch event includes a touch position;
  • An obtaining unit configured to obtain at least one network environment set, the network environment set including a source network environment and a destination network environment;
  • the switching unit is configured to determine any network environment set in at least one of the network environment sets as a test environment set, deploy the source network environment in the test environment set, execute the target event set, and During the execution of the target event set, switch the source network environment to the target network environment in the environment set to be tested, and determine the second execution result until the second execution corresponding to each network environment set is obtained So far
  • the output unit is configured to output a prompt indicating that the network environment set test corresponding to the second execution result is successful if the second execution result is consistent with the first execution result.
  • the terminal device 6 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device may include, but is not limited to, a processor 60 and a memory 61.
  • FIG. 6 is only an example of the terminal device 6 and does not constitute a limitation on the terminal device 6. It may include more or less components than shown in the figure, or a combination of certain components, or different components.
  • the terminal device may also include input and output devices, network access devices, buses, etc.
  • the so-called processor 60 may be a central processing unit (Central Processing Unit, CPU), it can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or memory of the terminal device 6.
  • the memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), or a secure digital (Secure Digital, SD) equipped on the terminal device 6. Card, Flash Card (Flash Card, FC), etc.
  • the memory 61 may also include both an internal storage unit of the terminal device 6 and an external storage device.
  • the memory 61 is used to store the computer-readable instructions and other programs and data required by the terminal device.
  • the memory 61 can also be used to temporarily store data that has been output or will be output.
  • Non-volatile memory may include Read-Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory.
  • ROM Read-Only Memory
  • PROM Programmable ROM
  • EPROM Electrically Programmable ROM
  • EEPROM Electrically Erasable Programmable ROM
  • Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory.
  • RAM Random Access Memory
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

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

Abstract

本申请适用于数据处理技术领域,提供了网络环境测试方法、装置、终端设备以及计算机非易失性可读存储介质,包括:在待测功能对应的程序执行期间将监控到的触摸事件添加至目标事件集,确定待测功能对应的程序的第一执行结果;获取至少一个网络环境集,网络环境集包括源网络环境和目的网络环境;将任一网络环境集确定为待测环境集,部署待测环境集中的源网络环境,执行目标事件集,在执行过程中将源网络环境切换至目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的第二执行结果为止;输出与第一执行结果相符的第二执行结果对应的网络环境集测试成功的提示。通过在不同的网络环境集下自动进行功能测试,提升了网络环境测试的效率。

Description

网络环境测试方法、装置及终端设备
本申请要求于2019年05月21日提交中国专利局、申请号为201910422544.X、发明名称为“网络环境测试方法、装置及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于数据处理技术领域,尤其涉及网络环境测试方法、装置、终端设备以及计算机非易失性可读存储介质。
背景技术
随着软件技术的快速发展,终端设备上的软件已可实现越来越多的功能,如数据统计、运动监测以及线上购物等。基于软件工程的基本思想,在软件开发过程中,功能测试是其中必不可少的一环,特别是对于网络环境切换情况的测试。
在现有技术中,主要是依靠人工来完成网络环境的切换,具体在测试人员执行待测功能对应的程序时,同时手动进行网络环境的切换,一方面来说,人工切换的效率较低,在待测试的网络环境较多时测试较为麻烦;另一方面来说,人工操作也会带来测试不准确的问题,即无法保证执行待测功能对应的程序的操作与切换网络环境是同时进行的。综上,现有技术中进行网络环境测试的效率和准确性低。
技术问题
本申请实施例提供了一种网络环境测试方法、装置、终端设备以及计算机非易失性可读存储介质,以解决现有技术中进行网络环境测试的效率和准确性低的问题。
技术解决方案
本申请实施例的第一方面提供了一种网络环境测试方法,包括:
监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置;
获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境;
将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止;
若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
本申请实施例的第二方面提供了一种网络环境测试装置,包括:
添加单元,用于监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置;
获取单元,用于获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境;
切换单元,用于将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止;
输出单元,用于若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
本申请实施例的第三方面提供了一种终端设备,所述终端设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置;
获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境;
将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止;
若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
本申请实施例的第四方面提供了一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如下步骤:
监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置;
获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境;
将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止;
若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
有益效果
本申请实施例,将待测功能对应的程序执行期间监控到的触摸事件添加至目标事件集,同时确定待测功能对应的程序的第一执行结果,然后部署不同的网络环境集,在部署期间执行待测功能对应的程序,在待测功能对应的程序执行期间将网络环境集中的源网络环境切换为目的网络环境,确定第二执行结果,输出与第一执行结果相符的第二执行结果对应的网络环境集测试成功的提示,本申请实施例通过监控执行待测功能对应的程序时产生的触摸事件,实现了对不同网络环境集的自动测试,提升了网络环境测试的效率和准确性。
附图说明
图1是本申请实施例一提供的网络环境测试方法的实现流程图;
图2是本申请实施例二提供的网络环境测试方法的实现流程图;
图3是本申请实施例三提供的网络环境测试方法的实现流程图;
图4是本申请实施例四提供的网络环境测试方法的实现流程图;
图5是本申请实施例五提供的网络环境测试装置的结构框图;
图6是本申请实施例六提供的终端设备的示意图。
本发明的实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定***结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的***、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
图1示出了本申请实施例提供的网络环境测试方法的实现流程,详述如下:
在S101中,监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置。
在本申请实施例中,首先监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所有触摸事件添加至目标事件集,并确定待测功能对应的程序的第一执行结果,在本步骤中,可由测试人员在标准网络环境下手动执行待测功能对应的程序,标准网络环境为预期的执行待测功能对应的程序的网络环境,可根据实际应用场景进行设置,比如标准网络环境可为4G环境或Wi-Fi环境等。监控到的触摸事件包含触摸位置,该触摸位置为触摸事件在终端设备上对应的坐标。值得说明的是,目标事件集仅指示对监控到的触摸事件进行归类存储,而不是指某一种具体的存储格式。
为了便于识别出待测功能对应的程序是否执行,可预先设置与待测功能对应的程序对应的测试指令,并将该测试指令作为待测功能对应的程序开始执行的标识,测试指令可为预设的函数,也可为预设的包含特定数据的请求,本申请实施例对此不做限定。在测试人员手动执行待测功能对应的程序后,终端设备便可通过是否检测到测试指令来判断待测功能对应的程序是否开始执行。对于待测功能对应的程序的第一执行结果,其可由测试人员预先自定义设置,也可在待测功能对应的程序执行完成后,由测试人员手动录入,比如在待测功能对应的程序为登录功能的情况,第一执行结果可为“登录成功”。
在监控终端设备上发生的触摸事件时,可通过终端设备所应用的操作***中特定的监控方式进行监控,举例来说,若终端设备应用安卓操作***,则可通过安卓操作***中的onTouchEvent方法进行触摸事件监控,当然,这并不构成对本申请实施例的限定,比如还可通过第三方的控件或工具进行监控。
在S102中,获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境。
对于待测功能,获取与之对应的至少一个网络环境集,每一个网络环境集都包括源网络环境和目的网络环境,网络环境集用于指示对该待测功能对应的程序进行网络环境切换的方式,可根据实际应用场景具体选定与待测功能对应的网络环境集。本申请实施例中涉及到的网络环境包括但不限于3G、4G、Wi-Fi、Edge以及无线应用协议(Wireless Application Protocol,WAP),3G和4G下还可细分为由不同运营商(移动、联通或电信等)提供的网络环境。
在S103中,将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止。
在获取到至少一个网络环境集后,根据每个网络环境集对待测功能对应的程序的执行情况进行测试。具体地,将任一网络环境集确定为待测环境集,在终端设备上部署待测环境集中的源网络环境,并在该源网络环境下执行目标事件集内的触摸事件(触摸事件的执行顺序与其在步骤S101中的执行顺序一致),然后,将源网络环境切换至该待测环境集内的目的网络环境,确定执行目标事件集产生的第二执行结果,重复上述过程直到得到与每个网络环境集对应的第二执行结果为止。值得一提的是,从源网络环境到目的网络环境的切换可通过调用开源的工具如Fidder工具实现。
可选地,确定第一执行结果的执行时长,根据执行时长确定阈值时长,该执行时长指示从执行待测功能对应的程序开始到确定第一执行结果之间的时长;在执行目标事件集的阈值时长后,将出现的执行结果确定为第二执行结果。在已部署待测环境集的基础上,为了提升测试效率,防止该待测环境集的测试过程耗费大量时间,确定第一执行结果的执行时长,该执行时长为从执行待测功能对应的程序开始到确定第一执行结果之间的时长,然后根据执行时长确定阈值时长,本申请实施例对阈值时长的确定方式不做限定,但限定阈值时长大于或等于执行时长,如可在执行时长的基础上增加十分钟作为阈值时长。在已部署一个待测环境集,且开始执行目标事件集的阈值时长后,将出现的执行结果确定为第二执行结果。通过上述方法可避免因某一个网络环境集的测试过程过长而影响测试进程。
在S104中,若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
在得到第二执行结果后,若第二执行结果与第一执行结果相符,如在第一执行结果为“登录成功”的情况下,第二执行结果也为“登录成功”,则输出该第二执行结果对应的网络环境集测试成功的提示;反之,若第二执行结果与第一执行结果不相符,则输出该第二执行结果对应的网络环境集测试失败的提示。通过输出不同的提示,便于测试人员进行查看。
通过图1所示实施例可知,在本申请实施例中,在待测功能对应的程序执行期间将监控到的触摸事件添加至目标事件集,确定待测功能对应的程序的第一执行结果,获取至少一个网络环境集,将任一网络环境集确定为待测环境集,部署待测环境集中的源网络环境,执行目标事件集,在目标事件集的执行过程中将源网络环境切换至待测环境集内的目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的第二执行结果为止,若第二执行结果与第一执行结果相符,则输出该第二执行结果对应的网络环境集测试成功的提示,本申请实施例通过对触摸事件进行监控,实现了对不同网络环境集的自动化测试,提升了网络环境测试的效率和准确性。
图2所示,是在本申请实施例一的基础上,对将监控到的触摸事件添加至目标事件集的过程进行细化后得到的一种网络环境测试方法。本申请实施例提供了网络环境测试方法的实现流程图,如图2所示,该网络环境测试方法可以包括以下步骤:
在S201中,确定所述目标事件集内的交互事件,其中,所述交互事件用于在被执行时触发与服务器之间的交互。
本申请实施例通过部署不同的网络环境集,来查看不同的网络环境集对待测功能对应的程序的执行情况的影响。由于网络环境的变更会影响到终端设备与服务器之间的交互,故为了提升进行测试的准确性,在执行待测功能对应的程序且终端设备与服务器进行交互时,执行网络环境的更换。具体地,在将监控到的触摸事件加入到目标事件集中的同时,确定目标事件集内的交互事件,该交互事件用于在被执行时触发与服务器之间的交互,由于触摸事件是由测试人员手动触发的,故也可由测试人员在目标事件集中确定交互事件,当然,交互事件还可存在其他的确定方式。
在S202中,若检测到正在执行所述交互事件,则将所述源网络环境切换至所述待测环境集内的所述目的网络环境。
在确定出交互事件后,若正在执行目标事件集,且检测到正在执行交互事件,则将源网络环境切换至当前已部署的待测环境集内的目的网络环境,便于分析切换网络环境的操作对服务器交互的影响。
通过图2所示实施例可知,在本申请实施例中,确定目标事件集内的交互事件,其中,交互事件用于在被执行时触发与服务器之间的交互,若检测到正在执行交互事件,则将源网络环境切换至待测环境集内的目的网络环境,本申请实施例在终端设备与服务器进行交互时切换网络环境,进一步提升了网络环境测试的准确性。
图3所示,是在本申请实施例二的基础上,对确定目标事件集内的交互事件的过程进行细化后得到的一种网络环境测试方法。本申请实施例提供了网络环境测试方法的实现流程图,如图3所示,该网络环境测试方法可以包括以下步骤:
在S301中,抓取运行日志。
在确定交互事件时,可抓取与终端设备相关的运行日志,本申请实施例对具体的抓取方式不做限定。
在S302中,若在所述运行日志中查找到交互请求,则将最近的一次所述触摸事件确定为所述交互事件,所述交互请求用于与所述服务器进行交互。
对于抓取的运行日志,在其中查找交互请求,交互请求的格式可预先设置,比如交互请求可为超文本传输协议(HyperText Transfer Protocol,HTTP)请求。若在运行日志中查找到交互请求,则将与该交互请求的发生时间距离最近,且发生时间早于交互请求的发生时间的一次触摸事件确定为交互事件。
通过图3所示实施例可知,在本申请实施例中,抓取运行日志,若在运行日志中查找到交互请求,则将最近的一次触摸事件确定为交互事件,该交互请求用于与服务器进行交互,本申请实施例通过查找交互请求来确定交互事件,减少了人工操作,并且提升了确定出的交互事件的准确性。
图4所示,是在本申请实施例一的基础上进行扩展后得到的一种网络环境测试方法。本申请实施例提供了网络环境测试方法的实现流程图,如图4所示,该网络环境测试方法可以包括以下步骤:
在S401中,将执行所述待测功能对应的程序之前的状态保存为初始状态,其中,所述初始状态为得到所述第一执行结果的前置条件。
在实际应用场景中,待测功能可能为不同类型的功能,比如待测功能可能为可重复执行的功能,比如投票功能或刷新功能,在该情况下,可直接重复部署不同的网络环境集,并执行目标事件集。但待测功能也可能为执行后无法再度执行的功能,即在执行待测功能对应的程序后,终端设备的状态会发生变化,比如待测功能为点击页面A中的某个按钮,跳转至页面B的功能,由于在执行过一次待测功能对应的程序后,当前页面为页面B,自然无法再点击页面A中的按钮。针对上述情况,在本申请实施例中,将执行待测功能对应的程序之前的状态保存为初始状态,该初始状态为得到第一执行结果的前置条件,即在终端设备的状态为初始状态时,才可得到第一执行结果,初始状态具体可为页面状态或数据状态等,根据实际应用场景确定。
在S402中,若在所述标准网络环境或在所述网络环境集中的网络环境下检测到所述待测功能对应的程序执行完毕,则将当前状态切换为所述初始状态。
若在标准网络环境或在网络环境集中的网络环境(源网络环境或目的网络环境)下检测到待测功能对应的程序执行完毕后,将终端设备的当前状态切换至初始状态,以使待测功能对应的程序能够支持重复执行。举例来说,若待测功能为页面跳转功能,且初始状态包括一个初始页面,则在检测到该页面跳转功能对应的程序执行完毕时,触发页面返回功能,将当前页面切换为初始页面;若待测功能为数据操作功能,则获取与数据操作功能对应的第一操作语句,创建与第一操作语句对应的第二操作语句,其中,第一操作语句与第二操作语句相逆(即若第一操作语句为向服务器增添数据A,则第二操作语句为删除服务器中的数据A),在检测到该数据操作功能对应的程序执行完毕时,执行第二操作语句,从而消除因执行该数据操作功能对应的程序造成的影响,第一操作语句和第二操作语句的格式可根据实际应用场景进行设定,比如第一操作语句和第二操作语句的格式可为结构化查询语言(Structured Query Language,SQL)。
通过图4所示实施例可知,在本申请实施例中,将执行待测功能对应的程序之前的状态保存为初始状态,若检测到待测功能对应的程序执行完毕,则将当前状态切换为初始状态,本申请实施例消除了因执行待测功能对应的程序带来的影响,避免了测试人员的手动消除操作,提升了网络环境测试的适用性。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
对应于上文实施例所述的网络环境测试方法,图5示出了本申请实施例提供的网络环境测试装置的结构框图,参照图5,该网络环境测试装置包括:
添加单元51,用于监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置;
获取单元52,用于获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境;
切换单元53,用于将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止;
输出单元54,用于若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
可选地,添加单元51包括:
确定单元,用于确定所述目标事件集内的交互事件,其中,所述交互事件用于在被执行时触发与服务器之间的交互;
切换单元53包括:
切换子单元,用于若检测到正在执行所述交互事件,则将所述源网络环境切换至所述待测环境集内的所述目的网络环境。
可选地,确定单元包括:
抓取单元,用于抓取运行日志;
确定子单元,用于若在所述运行日志中查找到交互请求,则将最近的一次所述触摸事件确定为所述交互事件,所述交互请求用于与所述服务器进行交互。
可选地,网络环境测试装置还包括:
保存单元,用于将执行所述待测功能对应的程序之前的状态保存为初始状态,其中,所述初始状态为得到所述第一执行结果的前置条件;
状态切换单元,用于若在所述标准网络环境或在所述网络环境集中的网络环境下检测到所述待测功能对应的程序执行完毕,则将当前状态切换为所述初始状态。
可选地,切换单元53还包括:
阈值确定单元,用于确定所述第一执行结果的执行时长,根据所述执行时长确定阈值时长,所述执行时长指示从执行所述待测功能对应的程序到确定所述第一执行结果之间的时长;
第二执行结果确定单元,用于在执行所述目标事件集的所述阈值时长后,将出现的执行结果确定为所述第二执行结果。
因此,本申请实施例提供的网络环境测试装置通过对触摸事件进行监控,并且部署不同的网络环境集,实现了对网络环境集的自动化测试,提升了网络环境测试的效率和准确性。
图6是本申请实施例提供的终端设备的示意图。如图6所示,该实施例的终端设备6包括:处理器60、存储器61以及存储在所述存储器61中并可在所述处理器60上运行的计算机可读指令62,例如网络环境测试程序。所述处理器60执行所述计算机可读指令62时实现上述各个网络环境测试方法实施例中的步骤,例如图1所示的步骤S101至S104。或者,所述处理器60执行所述计算机可读指令62时实现上述各网络环境测试装置实施例中各单元的功能,例如图5所示单元51至54的功能。
示例性的,所述计算机可读指令62可以被分割成一个或多个单元,所述一个或者多个单元被存储在所述存储器61中,并由所述处理器60执行,以完成本申请。所述一个或多个单元可以是能够完成特定功能的一系列计算机可读指令的指令段,该指令段用于描述所述计算机可读指令62在所述终端设备6中的执行过程。例如,所述计算机可读指令62可以被分割成添加单元、获取单元、切换单元以及输出单元,各单元具体功能如下:
添加单元,用于监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置;
获取单元,用于获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境;
切换单元,用于将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止;
输出单元,用于若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
所述终端设备6可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器60、存储器61。本领域技术人员可以理解,图6仅仅是终端设备6的示例,并不构成对终端设备6的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器60可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器61可以是所述终端设备6的内部存储单元,例如终端设备6的硬盘或内存。所述存储器61也可以是所述终端设备6的外部存储设备,例如所述终端设备6上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card,FC)等。进一步地,所述存储器61还可以既包括所述终端设备6的内部存储单元也包括外部存储设备。所述存储器61用于存储所述计算机可读指令以及所述终端设备所需的其他程序和数据。所述存储器61还可用于暂时地存储已经输出或者将要输出的数据。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机非易失性可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink) DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种网络环境测试方法,其特征在于,包括:
    监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置;
    获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境;
    将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止;
    若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
  2. 如权利要求1所述的网络环境测试方法,其特征在于,所述将监控到的所述触摸事件添加至目标事件集,包括:
    确定所述目标事件集内的交互事件,其中,所述交互事件用于在被执行时触发与服务器之间的交互;
    所述在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,包括:
    若检测到正在执行所述交互事件,则将所述源网络环境切换至所述待测环境集内的所述目的网络环境。
  3. 如权利要求2所述的网络环境测试方法,其特征在于,所述确定所述目标事件集内的交互事件,包括:
    抓取运行日志;
    若在所述运行日志中查找到交互请求,则将最近的一次所述触摸事件确定为所述交互事件,所述交互请求用于与所述服务器进行交互。
  4. 如权利要求1所述的网络环境测试方法,其特征在于,还包括:
    将执行所述待测功能对应的程序之前的状态保存为初始状态,其中,所述初始状态为得到所述第一执行结果的前置条件;
    若在所述标准网络环境或在所述网络环境集中的网络环境下检测到所述待测功能对应的程序执行完毕,则将当前状态切换为所述初始状态。
  5. 如权利要求1所述的网络环境测试方法,其特征在于,所述确定第二执行结果,包括:
    确定所述第一执行结果的执行时长,根据所述执行时长确定阈值时长,所述执行时长指示从执行所述待测功能对应的程序到确定所述第一执行结果之间的时长;
    在执行所述目标事件集的所述阈值时长后,将出现的执行结果确定为所述第二执行结果。
  6. 一种网络环境测试装置,其特征在于,包括:
    添加单元,用于监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置;
    获取单元,用于获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境;
    切换单元,用于将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止;
    输出单元,用于若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
  7. 根据权利要求6所述的网络环境测试装置,其特征在于,
    所述添加单元包括确定单元,用于确定所述目标事件集内的交互事件,其中,所述交互事件用于在被执行时触发与服务器之间的交互;
    所述切换单元包括切换子单元,用于若检测到正在执行所述交互事件,则将所述源网络环境切换至所述待测环境集内的所述目的网络环境。
  8. 根据权利要求7所述的网络环境测试装置,其特征在于,所述确定单元包括:
    抓取单元,用于抓取运行日志;
    确定子单元,用于若在所述运行日志中查找到交互请求,则将最近的一次所述触摸事件确定为所述交互事件,所述交互请求用于与所述服务器进行交互。
  9. 根据权利要求6所述的网络环境测试装置,其特征在于,所述网络环境测试装置还包括:
    保存单元,用于将执行所述待测功能对应的程序之前的状态保存为初始状态,其中,所述初始状态为得到所述第一执行结果的前置条件;
    状态切换单元,用于若在所述标准网络环境或在所述网络环境集中的网络环境下检测到所述待测功能对应的程序执行完毕,则将当前状态切换为所述初始状态。
  10. 根据权利要求6所述的网络环境测试装置,其特征在于,所述切换单元还包括:
    阈值确定单元,用于确定所述第一执行结果的执行时长,根据所述执行时长确定阈值时长,所述执行时长指示从执行所述待测功能对应的程序到确定所述第一执行结果之间的时长;
    第二执行结果确定单元,用于在执行所述目标事件集的所述阈值时长后,将出现的执行结果确定为所述第二执行结果。
  11. 一种终端设备,其特征在于,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
    监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置;
    获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境;
    将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止;
    若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
  12. 如权利要求11所述的终端设备,其特征在于,所述将监控到的触摸事件添加至目标事件集,包括:
    确定所述目标事件集内的交互事件,其中,所述交互事件用于在被执行时触发与服务器之间的交互;
    所述在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,包括:
    若检测到正在执行所述交互事件,则将所述源网络环境切换至所述待测环境集内的所述目的网络环境。
  13. 如权利要求12所述的终端设备,其特征在于,所述确定所述目标事件集内的交互事件,包括:
    抓取运行日志;
    若在所述运行日志中查找到交互请求,则将最近的一次所述触摸事件确定为所述交互事件,所述交互请求用于与所述服务器进行交互。
  14. 如权利要求11所述的终端设备,其特征在于,所述处理器执行所述计算机可读指令时还实现如下步骤:
    将执行所述待测功能对应的程序之前的状态保存为初始状态,其中,所述初始状态为得到所述第一执行结果的前置条件;
    若在所述标准网络环境或在所述网络环境集中的网络环境下检测到所述待测功能对应的程序执行完毕,则将当前状态切换为所述初始状态。
  15. 根据权利要求11所述的终端设备,其特征在于,所述确定第二执行结果,包括:
    确定所述第一执行结果的执行时长,根据所述执行时长确定阈值时长,所述执行时长指示从执行所述待测功能对应的程序到确定所述第一执行结果之间的时长;
    在执行所述目标事件集的所述阈值时长后,将出现的执行结果确定为所述第二执行结果。
  16. 一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:
    监控在预设的标准网络环境下执行待测功能对应的程序所产生的触摸事件,将监控到的所述触摸事件添加至目标事件集,并确定所述待测功能对应的程序的第一执行结果,其中,所述触摸事件包含触摸位置;
    获取至少一个网络环境集,所述网络环境集包括源网络环境和目的网络环境;
    将至少一个所述网络环境集中的任一网络环境集确定为待测环境集,部署所述待测环境集中的所述源网络环境,执行所述目标事件集,在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,确定第二执行结果,直到得到与每个网络环境集对应的所述第二执行结果为止;
    若所述第二执行结果与所述第一执行结果相符,则输出所述第二执行结果对应的所述网络环境集测试成功的提示。
  17. 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述将监控到的所述触摸事件添加至目标事件集,包括:
    确定所述目标事件集内的交互事件,其中,所述交互事件用于在被执行时触发与服务器之间的交互;
    所述在所述目标事件集的执行过程中将所述源网络环境切换至所述待测环境集内的所述目的网络环境,包括:
    若检测到正在执行所述交互事件,则将所述源网络环境切换至所述待测环境集内的所述目的网络环境。
  18. 根据权利要求17所述的计算机非易失性可读存储介质,其特征在于,所述确定所述目标事件集内的交互事件,包括:
    抓取运行日志;
    若在所述运行日志中查找到交互请求,则将最近的一次所述触摸事件确定为所述交互事件,所述交互请求用于与所述服务器进行交互。
  19. 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述计算机可读指令被处理器执行时还实现如下步骤:
    将执行所述待测功能对应的程序之前的状态保存为初始状态,其中,所述初始状态为得到所述第一执行结果的前置条件;
    若在所述标准网络环境或在所述网络环境集中的网络环境下检测到所述待测功能对应的程序执行完毕,则将当前状态切换为所述初始状态。
  20. 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述确定第二执行结果,包括:
    确定所述第一执行结果的执行时长,根据所述执行时长确定阈值时长,所述执行时长指示从执行所述待测功能对应的程序到确定所述第一执行结果之间的时长;
    在执行所述目标事件集的所述阈值时长后,将出现的执行结果确定为所述第二执行结果。
PCT/CN2019/121680 2019-05-21 2019-11-28 网络环境测试方法、装置及终端设备 WO2020233065A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910422544.XA CN110232022A (zh) 2019-05-21 2019-05-21 网络环境测试方法、装置及终端设备
CN201910422544.X 2019-05-21

Publications (1)

Publication Number Publication Date
WO2020233065A1 true WO2020233065A1 (zh) 2020-11-26

Family

ID=67860920

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/121680 WO2020233065A1 (zh) 2019-05-21 2019-11-28 网络环境测试方法、装置及终端设备

Country Status (2)

Country Link
CN (1) CN110232022A (zh)
WO (1) WO2020233065A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116225576A (zh) * 2023-05-08 2023-06-06 成都赛力斯科技有限公司 应用程序的数据环境切换方法、装置、电子设备及介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245076A (zh) * 2019-05-21 2019-09-17 深圳壹账通智能科技有限公司 基于功能测试的因素影响程度确定方法、装置及终端设备
CN110232022A (zh) * 2019-05-21 2019-09-13 深圳壹账通智能科技有限公司 网络环境测试方法、装置及终端设备
CN114338846B (zh) * 2020-09-30 2024-06-18 腾讯科技(深圳)有限公司 一种报文测试的方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060179350A1 (en) * 2005-02-10 2006-08-10 Microsoft Corporation Dynamic marshaling testing
CN106375138A (zh) * 2015-07-20 2017-02-01 深圳市中兴微电子技术有限公司 不同网络制式间互操作性能的测试装置及方法
CN106817180A (zh) * 2015-11-30 2017-06-09 展讯通信(上海)有限公司 一种自动化测试***及方法
CN109218136A (zh) * 2018-09-30 2019-01-15 广州掌动智能科技有限公司 Wifi连接性能测试方法、装置、计算机设备和存储介质
CN109634648A (zh) * 2017-10-09 2019-04-16 武汉斗鱼网络科技有限公司 一种快速切换sdk网络接口环境的方法及装置
CN110232022A (zh) * 2019-05-21 2019-09-13 深圳壹账通智能科技有限公司 网络环境测试方法、装置及终端设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140110520A (ko) * 2013-03-08 2014-09-17 주식회사 인프라웨어테크놀러지 단말 자동실행 제어를 이용한 스마트 어플의 자동검증 방법 및 이를 위한 컴퓨터로 판독가능한 기록매체
CN108897692A (zh) * 2018-07-06 2018-11-27 武汉斗鱼网络科技有限公司 网络环境的动态切换方法及***、服务器及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060179350A1 (en) * 2005-02-10 2006-08-10 Microsoft Corporation Dynamic marshaling testing
CN106375138A (zh) * 2015-07-20 2017-02-01 深圳市中兴微电子技术有限公司 不同网络制式间互操作性能的测试装置及方法
CN106817180A (zh) * 2015-11-30 2017-06-09 展讯通信(上海)有限公司 一种自动化测试***及方法
CN109634648A (zh) * 2017-10-09 2019-04-16 武汉斗鱼网络科技有限公司 一种快速切换sdk网络接口环境的方法及装置
CN109218136A (zh) * 2018-09-30 2019-01-15 广州掌动智能科技有限公司 Wifi连接性能测试方法、装置、计算机设备和存储介质
CN110232022A (zh) * 2019-05-21 2019-09-13 深圳壹账通智能科技有限公司 网络环境测试方法、装置及终端设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116225576A (zh) * 2023-05-08 2023-06-06 成都赛力斯科技有限公司 应用程序的数据环境切换方法、装置、电子设备及介质

Also Published As

Publication number Publication date
CN110232022A (zh) 2019-09-13

Similar Documents

Publication Publication Date Title
WO2020233065A1 (zh) 网络环境测试方法、装置及终端设备
US10838838B2 (en) Method and apparatus for dealing with abnormality of application program and storage medium
WO2020186809A1 (zh) 基于大数据平台的hive任务调度方法、装置、设备及存储介质
WO2019161619A1 (zh) 接口自动化测试方法、装置、设备及计算机可读存储介质
CN111221743A (zh) 自动化测试方法及***
US9256513B2 (en) Method, apparatus and computer readable medium for automatic debugging and error prevention
CN108255620B (zh) 一种业务逻辑处理方法、装置、业务服务器及***
WO2020233064A1 (zh) 基于功能测试的因素影响程度确定方法、装置及终端设备
CN107609028B (zh) 一种低效率sql语句的确定方法及装置
CN111611172A (zh) 项目测试缺陷分析方法、装置、设备及存储介质
WO2019169760A1 (zh) 测试用例范围确定方法、装置及存储介质
CN109344066B (zh) 一种浏览器页面的测试方法、***及终端
CN110267215B (zh) 一种数据检测方法、设备及存储介质
WO2020211359A1 (zh) ***性能瓶颈定位方法及***
CN113448862B (zh) 软件版本测试方法、装置及计算机设备
CN110879781A (zh) 程序调试方法、装置、电子设备及计算机可读存储介质
WO2021196454A1 (zh) 一种数据检测方法、设备、服务器及可读存储介质
CN112685745B (zh) 一种固件检测方法、装置、设备及存储介质
CN103268448A (zh) 动态检测移动应用的安全性的方法和***
WO2019148657A1 (zh) 关联环境测试方法、电子装置及计算机可读存储介质
US20070245313A1 (en) Failure tagging
CN111090593A (zh) 确定崩溃归属的方法、装置、电子设备及存储介质
CN110716843A (zh) ***故障分析处理方法、装置、存储介质及电子设备
CN114006891A (zh) 信息的上报方法、装置、设备及存储介质
CN112433872A (zh) 一种接口请求超时提醒方法、***及存储介质

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: 19929492

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.01.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19929492

Country of ref document: EP

Kind code of ref document: A1