CN113656289A - Test method, test device, electronic equipment and computer readable storage medium - Google Patents

Test method, test device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN113656289A
CN113656289A CN202110872479.8A CN202110872479A CN113656289A CN 113656289 A CN113656289 A CN 113656289A CN 202110872479 A CN202110872479 A CN 202110872479A CN 113656289 A CN113656289 A CN 113656289A
Authority
CN
China
Prior art keywords
indication information
client
test
scene
testing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110872479.8A
Other languages
Chinese (zh)
Inventor
何小龙
吴智明
王浩
何燕飞
林顺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Yaji Software Co Ltd
Original Assignee
Xiamen Yaji Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Yaji Software Co Ltd filed Critical Xiamen Yaji Software Co Ltd
Priority to CN202110872479.8A priority Critical patent/CN113656289A/en
Publication of CN113656289A publication Critical patent/CN113656289A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • 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

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

The embodiment of the application provides a testing method, a testing device, electronic equipment and a computer readable storage medium, and relates to the technical field of software testing. The method comprises the following steps: the client responds to the first indication information sent by the server to switch the scene of the target application program, and the test end tests the scene of the target application program based on the third indication information sent by the server.

Description

Test method, test device, electronic equipment and computer readable storage medium
Technical Field
The embodiment of the application relates to the technical field of software testing, in particular to a testing method, a testing device, electronic equipment and a computer-readable storage medium.
Background
Software testing is a process of auditing or comparing between actual output and expected output. The process of operating a program under specified conditions to find out program errors, measuring the quality of the software, and evaluating whether it can meet design requirements is a software test.
With the development of software and IT (Internet Technology ) industries, software development tends to be large-scale and high-complexity, and in order to improve testing efficiency, a testing end is generally adopted to automatically test software.
In the prior art, a test end usually adopts a mode of simulating manual operation when performing automatic test on software, and the process of simulating manual operation needs to perform UI (User Interface) adaptation based on different application platforms to realize the positioning of Interface elements, which has the problems of large workload and low test efficiency.
Disclosure of Invention
The application provides a testing method, a testing device, electronic equipment and a computer readable storage medium, which are used for solving the technical problem of low automatic testing efficiency.
According to a first aspect of the present application, there is provided a testing method applied to a server, the method including:
sending first indication information to a client; the first indication information indicates the client to load and switch a first scene of a target application program;
receiving second indication information sent by the client; the second indication information indicates the client to start testing the first scene;
responding to the second indication information, and sending third indication information to the test terminal; and the third indication information indicates that the test end tests the first scene.
In an optional embodiment of the first aspect, the sending the first indication information to the client includes:
and in each preset sending period, sending first indication information to the client.
In an optional embodiment of the first aspect, after receiving the second indication information sent by the client, the method includes:
receiving fourth indication information sent by the client; the fourth indication information represents that the client finishes loading the first scene;
and sending first indication information to the client, wherein the first indication information indicates the client to load and switch the second scene of the target application program.
According to a second aspect of the present application, there is provided a testing method applied to a testing end, the method including:
receiving third indication information sent by the server; the third indication information is sent by the server in response to the second indication information sent by the client; the second indication information is sent after the client loads and switches the first scene of the target application program and starts testing the first scene;
and responding to the third indication information, and testing the first scene.
According to a third aspect of the present application, there is provided a testing method applied to a client, the method including:
receiving first indication information sent by a server, and loading and switching a first scene of a target application program;
starting a test on the first scene, and sending second indication information to the server; the second indication information indicates the server to send third indication information to the test end; and the third indication information indicates that the test end tests the first scene.
According to a fourth aspect of the present application, there is provided a test apparatus comprising:
the switching module is used for sending first indication information to the client; the first indication information indicates the client to load and switch a first scene of a target application program;
the starting module is used for receiving second indication information sent by the client; the second indication information indicates the client to start testing the first scene;
the test module is used for responding to the second indication information and sending third indication information to the test end; and the third indication information indicates that the test end tests the first scene.
In an optional embodiment of the fourth aspect, the switching module is specifically configured to:
and in each preset sending period, sending first indication information to the client.
In an optional embodiment of the fourth aspect, the starting module is further configured to:
receiving fourth indication information sent by the client; the fourth indication information represents that the client finishes loading the first scene;
and sending first indication information to the client, wherein the first indication information indicates the client to load and switch the second scene of the target application program.
According to a fifth aspect of the present application, there is provided a test apparatus comprising:
the receiving module is used for receiving third indication information sent by the server; the third indication information is sent by the server in response to the second indication information sent by the client; the second indication information is sent after the client loads and switches the first scene of the target application program and starts testing the first scene;
and the response module is used for responding to the third indication information and testing the first scene.
According to a sixth aspect of the present application, there is provided a test apparatus comprising:
the first switching module is used for receiving first indication information sent by the server, loading and switching a first scene of a target application program;
the first test module is used for starting the test of the first scene and sending second indication information to the server; the second indication information indicates the server to send third indication information to the test end; and the third indication information indicates that the test end tests the first scene.
According to a seventh aspect of the present application, there is provided an electronic apparatus comprising: one or more processors, a memory, one or more applications, wherein the one or more applications are stored in the memory and configured to implement the testing method illustrated in the first to third aspects of the present application when executed by the one or more processors.
According to an eighth aspect of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the testing method shown in the first to third aspects of the present application.
According to a ninth aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the methods provided in the various alternative implementations of the first aspect to the third aspect described above.
The beneficial effect that technical scheme that this application provided brought is:
in the implementation manner of the embodiment of the application, the client responds to the first indication information sent by the server to switch the scene of the target application program, and the test end tests the scene of the target application program based on the third indication information sent by the server; according to the method and the device, the scene of the target application program is automatically and sequentially switched and tested based on the interactive mode of three-terminal communication of the client, the server and the testing terminal, compared with the mode of simulating manual operation in the prior art, the display interface of the application program is switched, tested and the like, UI adaptation work of the testing terminal is omitted, testing efficiency is effectively improved, and user experience is improved.
Drawings
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 of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a testing method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a testing method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a testing method according to an embodiment of the present application;
FIG. 4 is a timing diagram of a testing method according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a testing apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a testing apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a testing apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a test electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Software testing is the process of running or testing a software system using manual or automated means with the purpose of checking whether it meets specified requirements or to figure out differences between expected and actual results.
From the viewpoint of whether the internal structure and the specific implementation of the software are concerned, the test method mainly comprises a white box test and a black box test. The white box test methods mainly include a code examination method, a static structure analysis method, a static quality measurement method, a logic coverage method, a basic path test method, a domain test, a symbol test, a path coverage method, and a program variation. The black box testing method mainly comprises an equivalence class division method, a boundary value analysis method, an error estimation method, a causal graph method, a judgment table driving method, an orthogonal test design method, a functional graph method, a scene method and the like.
The test method can be divided into a static test and a dynamic test from the viewpoint of whether or not the program is executed. Static tests include code inspection, static structure analysis, code quality metrics, and the like. The dynamic test consists of 3 parts: and constructing output results of the test case, the executive program and the analysis program.
With the development of software and IT (Internet Technology ) industries, software development tends to be large-scale and high-complexity, and in order to improve software testing efficiency, a testing end is generally adopted to automatically test software. Automated testing is a process that translates human-driven test behavior into machine execution. Typically, after a test case is designed and passes review, the test is performed step by the tester according to the procedures described in the test case, resulting in a comparison of the actual results with the expected results.
In the prior art, a test end usually adopts a mode of simulating manual operation when performing automatic test on software, and because different software is suitable for different application platforms such as a mobile phone end and a PC (Personal Computer) end, the process of simulating manual operation needs to perform UI (User Interface) adaptation based on different application platforms to realize the positioning of Interface elements, so that the problems of large workload, low test efficiency and tedious maintenance work of a test system exist.
The application provides a testing method, a testing device, an electronic device and a computer-readable storage medium, which aim to solve the above technical problems in the prior art.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
The embodiment of the present application provides a testing method, as shown in fig. 1, the method may be applied to a server, and includes the following steps:
s101, sending first indication information to a client; the first indication information indicates the client to load and switch the first scene of the target application program.
Specifically, the server may establish a bidirectional communication connection with the client through a wired network or a wireless network, and send the first indication information to the client. The first indication information may characterize that the server and the client have established a connection, and may instruct the client to load and switch a first scenario of the target application.
The client can be a smart phone, a smart wearable device, a tablet computer or a desktop computer and the like; the server can be a server with an interactive interface, and the server can be one server or a server cluster or a cloud computing service center consisting of a plurality of servers.
In the embodiment of the application, the target application program may be a multimedia application program, a game application program, a social contact application program, or the like; meanwhile, the target application program may be applied to different platforms such as a PC end or a mobile end, and the specific type of the target application program is not specifically limited in this embodiment.
Specifically, the first scene of the target application may be a user interface of the target application. The target application program can have a plurality of scenes, each scene corresponds to one user interface, and the user interface can be a login interface of the target application program, a home page display interface of the target application program, a setting interface of the target application program and the like.
S102, receiving second indication information sent by a client; and the second indication information indicates the client to start the test of the first scene.
The second indication information may represent that the client has switched to the first scenario, and initiate a test of the first scenario.
S103, responding to the second indication information, and sending third indication information to the test end; and the third indication information indicates that the test end tests the first scene.
The testing end can comprise a testing script command matched with the target application program, and the testing script command can be used for controlling the testing process of the target application program; the testing end can be based on an automated testing framework such as an Appium (an open source automated testing tool suitable for native or hybrid mobile applications), a Selenium (a tool for testing Web applications), or a Webdriver (an automated testing tool for Web applications).
In some embodiments, the server may control the client to capture a screenshot of the first scene, generate a test picture, and control the test terminal to obtain a test result based on the test picture.
In other embodiments, the server may control the test end to capture a screenshot of the first scene, generate a test picture, and obtain a test result based on the test picture.
In the implementation manner of the embodiment of the application, the client responds to the first indication information sent by the server to switch the scene of the target application program, and the test end tests the scene of the target application program based on the third indication information sent by the server; according to the method and the device, the scene of the target application program is automatically and sequentially switched and tested based on the interactive mode of three-terminal communication of the client, the server and the testing terminal, compared with the mode of simulating manual operation in the prior art, the display interface of the application program is switched, tested and the like, UI adaptation work of the testing terminal is omitted, testing efficiency is effectively improved, and user experience is improved.
Before sending the first indication information to the client in step S101, a possible implementation manner is provided in this embodiment of the present application, and the method may further include:
and receiving starting information sent by the client.
Wherein the start information represents that the client has started the running of the target application program.
A possible implementation manner is provided in this embodiment of the present application, where the sending of the first indication information to the client in step S101 may include: and in each preset sending period, sending first indication information to the client.
In the embodiment of the present application, the transmission period may be set based on actual application; according to the time for switching the scenes of the client and the time for testing the testing end, for example, the sending period can be set to be 2s, so that the purpose that the server circularly sends the first indication information to the client and controls the automatic switching of the scenes of the target application program is achieved.
After receiving the second indication information sent by the client in step S102, the method may include:
s1021, receiving fourth indication information sent by the client; the fourth indication information represents that the client finishes loading the first scene.
In some embodiments, the server may receive the fourth indication information sent by the client after the test end completes the test.
In other embodiments, the server may further receive fourth indication information sent by the client while the testing end performs the test.
In the embodiment of the application, the server can control the testing end to test and control the client end to switch scenes at the same time, so that the testing efficiency is further improved.
S1022, send the first indication information to the client, where the first indication information indicates the client to load and switch the second scene of the target application program.
In the embodiment of the application, when the server sends the first indication information to the client once, the client can be controlled to switch from the first scene to the second scene of the target application program; therefore, the automatic switching of the scenes of the target application program is realized, the switching of the scenes of the application program by a testing end in a mode of simulating manual operation in the prior art is avoided, and the UI adaptation work of the testing end is avoided; the testing efficiency is effectively improved, and the user experience is improved.
The embodiment of the present application provides a testing method, as shown in fig. 2, the method may be applied to a testing end, and includes the following steps:
s201, receiving third indication information sent by a server; the third indication information is sent by the server in response to the second indication information sent by the client; and the second indication information is sent after the client loads and switches the first scene of the target application program and starts the test of the first scene.
Specifically, the test end may receive third indication information sent by the server, where the third indication information may indicate that the test end tests the first scenario.
The server can establish bidirectional communication connection with the client and the test terminal through a wired network or a wireless network respectively.
In this embodiment of the present application, the test end may include a test script command matched with the target application program, and the test script command may be used to control a test flow of the target application program; the testing end can be based on an automation testing framework such as the Apium, the Selenium or the Webdriver.
The client can be a smart phone, a smart wearable device, a tablet computer or a desktop computer and the like. The server can be a server with an interactive interface, and the server can be one server or a server cluster or a cloud computing service center consisting of a plurality of servers.
The target application program can be a multimedia application program, a game application program or a social application program and the like; the target application program may be applied to different platforms such as a PC end or a mobile end, and the specific type of the target application program is not specifically limited in this embodiment.
S202, responding to the third indication information, and testing the first scene.
The first scene of the target application program can be a user interface of the target application program, and the testing end mainly detects whether rendering of the user interface corresponding to the first scene is correct.
Specifically, the target application may have multiple scenes, each scene corresponds to one user interface, and the user interface may be a login interface of the target application, a home page display interface of the target application, a setting interface of the target application, and the like, which is not limited in this embodiment.
In the embodiment of the application, the test end can call the underlying driver through the app, Selenium or Webdriver framework to realize the control of the application program in the client.
In some embodiments, the testing end may test the first scene based on a test picture intercepted by the client for the first scene;
in other embodiments, the test terminal may capture a test picture from the first scene and test the first scene based on the test picture.
In the implementation manner of the embodiment of the application, the client responds to the first indication information sent by the server to switch the scene of the target application program, and the test end tests the scene of the target application program based on the third indication information sent by the server; according to the method and the device, the scene of the target application program is automatically and sequentially switched and tested based on the interactive mode of three-terminal communication of the client, the server and the testing terminal, compared with the mode of simulating manual operation in the prior art, the display interface of the application program is switched, tested and the like, UI adaptation work of the testing terminal is omitted, testing efficiency is effectively improved, and user experience is improved.
A possible implementation manner is provided in this embodiment of the present application, and the testing the first scenario in step S202 may include:
s2021, obtaining a test picture; the test picture is generated by the client performing screenshot on the first scene.
Specifically, the test end may obtain the test picture from the specified storage address based on the tag of the first scene. The test picture may be an overall screenshot of the user interface corresponding to the first scene, or a local screenshot of a preset position of the user interface corresponding to the first scene.
And S2022, generating a test result based on the test picture and a preset target picture.
Specifically, the test end may obtain a preset target picture from a preset database based on the label of the first scene. The target picture is a picture intercepted when the target application program correctly renders the first scene.
A possible implementation manner is provided in this embodiment of the application, and the testing the first scenario in step S202 may further include:
s2021', screenshot is conducted on the first scene, a test picture is generated, and the test picture is stored.
The test picture may be an overall screenshot of the user interface corresponding to the first scene, or a local screenshot of a preset position of the user interface corresponding to the first scene.
S2022', generating a test result based on the test picture and a preset target picture.
Specifically, the test end may obtain a preset target picture from a preset database based on the label of the first scene. The target picture is a picture intercepted when the target application program correctly renders the first scene.
In the embodiment of the present application, a possible implementation manner is provided, and the generating of the test result based on the test picture and the preset target picture in the steps S2022 and S2022' may include:
s20221, comparing the test picture with the target picture to generate a difference picture.
Specifically, the test picture and the target picture have the same size, and the test end can calculate the difference value of the pixel information of the test picture and the pixel information of the target picture and generate a difference picture based on the pixel difference value.
S20222, splicing the test picture, the target picture and the difference picture to generate a spliced picture.
Specifically, the difference picture has the same size as the test picture and the target picture, and the test picture, the target picture and the difference picture can be preprocessed, then the test picture, the target picture and the difference picture are subjected to image alignment and matching, and operations such as image fusion and boundary smoothing are performed to generate the spliced picture. Because the spliced picture contains the information of the test picture, the target picture and the difference picture, the image information is richer, and the comparison and the processing can be carried out from multiple dimensions, so that the test result is more accurate.
S20223, confirming the test result based on the stitched picture.
Specifically, the test end may obtain the test result based on all pixel information included in the stitched picture.
The test result can represent whether the rendering of the first scene is normal or not, and if not, the test result also comprises pixel information with abnormal rendering, so that testers can find information of abnormal components in the first scene conveniently and process the abnormality in time.
In some examples, the above test process of picture comparison and splicing may be performed at the same time of screenshot by the client or the test end; that is, each time the client or the test end intercepts one test picture, the test end immediately acquires the test picture to confirm the test result and complete the test of the current scene until all the scenes are tested.
In other examples, the test process of the picture comparison and the splicing may be performed after all the scenes of the target application program are captured by the client or the test end; that is to say, each time the client or the test end intercepts one test picture, the test end marks the scene corresponding to the test picture until all scenes of the target application program are marked, and then the test end acquires the corresponding test picture based on the scene mark to confirm the test result until the test of all scenes is completed.
The embodiment of the present application provides a testing method, as shown in fig. 3, the method may be applied to a client, and includes the following steps:
s301, receiving first indication information sent by the server, and loading and switching a first scene of the target application program.
Specifically, the client may establish a bidirectional communication connection with the server through a wired network or a wireless network, and receive the first indication information sent by the server. The first indication information may characterize that the server and the client have established a connection, and may instruct the client to load and switch a first scenario of the target application.
The client can be a smart phone, a smart wearable device, a tablet computer or a desktop computer and the like; the server can be a server with an interactive interface, and the server can be one server or a server cluster or a cloud computing service center consisting of a plurality of servers.
In the embodiment of the application, the target application program may be a multimedia application program, a game application program, a social contact application program, or the like; meanwhile, the target application program may be applied to different platforms such as a PC end or a mobile end, and the specific type of the target application program is not specifically limited in this embodiment.
Specifically, the first scene of the target application may be a user interface of the target application. The target application program can have a plurality of scenes, each scene corresponds to one user interface, and the user interface can be a login interface of the target application program, a home page display interface of the target application program, a setting interface of the target application program and the like.
S302, starting a test on the first scene, and sending second indication information to a server; the second indication information indicates the server to send third indication information to the test end; and the third indication information indicates that the test end tests the first scene.
The second indication information may represent that the client has switched to the first scenario, and initiate a test of the first scenario.
In the implementation manner of the embodiment of the application, the client responds to the first indication information sent by the server to switch the scene of the target application program, and the test end tests the scene of the target application program based on the third indication information sent by the server; according to the method and the device, the scene of the target application program is automatically and sequentially switched and tested based on the interactive mode of three-terminal communication of the client, the server and the testing terminal, compared with the mode of simulating manual operation in the prior art, the display interface of the application program is switched, tested and the like, UI adaptation work of the testing terminal is omitted, testing efficiency is effectively improved, and user experience is improved.
In this embodiment of the present application, a possible implementation manner is provided, where the receiving of the first indication information sent by the server in step S301 may include:
and receiving first indication information sent by the server in each preset sending period.
In the embodiment of the present application, the transmission period may be set based on actual application; according to the time for switching the scenes of the client and the time for testing the testing end, for example, the sending period can be set to be 2s, so that the client circularly receives the first indication information sent by the server, and the client automatically switches the scenes of the target application program.
In this embodiment, a possible implementation manner is provided, and after the sending of the second indication information to the server in step S302, the method may further include:
s3021, sending fourth indication information to the server; and the fourth indication information represents that the first scene is completely loaded.
In some embodiments, the client may send the fourth indication information to the server after the testing end completes the testing.
In other embodiments, the client may send the fourth indication information to the server while the testing end performs the test.
And S3022, receiving the first indication information sent by the server, and loading and switching a second scene of the target application program.
In the embodiment of the application, the client switches the scenes of the target application program every time the client receives the first indication information of the server, so that the automatic switching and testing of the scenes are realized, the situation that the testing end switches the scenes of the application program in a mode of simulating manual operation in the prior art is avoided, and the UI adaptation work of the testing end is avoided; the testing efficiency is effectively improved, and the user experience is improved.
In order to more clearly explain the test method of the present application, the test method will be further explained below with reference to specific examples.
A possible implementation manner is provided in the embodiment of the present application, and the present application provides a testing method, as shown in fig. 4, including the following steps:
s401, the client starts and runs the target application program, and sends starting information to the server.
Specifically, after receiving the installation package and the test case of the target application program, the client installs the installation package of the target application program, loads the test case, starts and runs the target application program, and executes the test case.
S402, the server sends first indication information to the client.
Specifically, the server may establish a bidirectional communication connection with the client through a wired network or a wireless network, and send the first indication information to the client.
S403, the client receives the first indication information sent by the server, and loads and switches the first scene of the target application program.
Specifically, the first scene of the target application may be a user interface of the target application. The target application program can have a plurality of scenes, each scene corresponds to one user interface, and the user interface can be a login interface of the target application program, a home page display interface of the target application program, a setting interface of the target application program and the like.
S404, the client starts the test of the first scene and sends second indication information to the server.
And the second indication information represents that the client side has switched to the first scene, and starts testing the first scene.
S405, the server responds to the second indication information and sends third indication information to the testing end.
Specifically, the server sends the third indication information to the test end to control the test end to test the first scene.
S406, the test terminal captures the first scene to generate a test picture, and the test picture is stored.
Specifically, the test picture may be an overall screenshot of the user interface corresponding to the first scene, or a local screenshot of a preset position of the user interface corresponding to the first scene, and the test terminal may store the test picture in a designated address.
And S407, the test end compares the test picture with a preset target picture to generate a difference picture.
Specifically, the target picture may be an interface picture when the first scene is correctly rendered, and the test end may directly obtain the target picture from the preset database based on the tag of the first scene.
Optionally, the test image features and the target image features of the test image and the target image may be extracted first, and then the difference image may be generated based on the difference between the test image features and the target image features.
And S408, the test end splices the test picture, the target picture and the difference picture to generate a spliced picture, and confirms the test result based on the spliced picture.
Specifically, the test picture, the target picture and the difference picture may be preprocessed, then the test picture, the target picture and the difference picture may be subjected to image alignment and matching, and operations such as image fusion and boundary smoothing may be performed to generate the stitched picture.
S409, the client sends fourth indication information to the server; the fourth indication information represents that the client has finished loading the first scene.
Specifically, the client may send the fourth indication information after the test end generates the test result; the client may also send the fourth indication information while the test end generates the test result, which is not specifically limited in this embodiment of the application.
And S410, the server sends first indication information to the client at intervals of a preset sending period, and the first indication information indicates the client to load and switch a second scene of the target application program. And repeating the steps S404 to S409 to finish the test of the second scene.
Specifically, the transmission period may be set based on actual application; according to the time for switching the scenes of the client and the time for capturing the pictures of the test end, the sending period can be set to be 2s, so that the purpose that the server sends the first indication information to the client circularly and automatically switches the scenes of the target application program is achieved.
And S411, repeating the step S410 until all scenes of the target application program are tested.
It is to be understood that fig. 4 is only a schematic illustration and does not limit the testing method of the embodiment of the present application. In addition, the implementation steps related to the technical scheme may be other, for example, in other implementation manners, the testing end may capture the screenshot of the game scene first, and then perform the comparison test of the test picture until all scenes are captured, so as to determine the test result. The embodiments of the present application do not limit this.
In the implementation manner of the embodiment of the application, the client responds to the first indication information sent by the server to switch the scene of the target application program, and the test end tests the scene of the target application program based on the third indication information sent by the server; meanwhile, the server sends the first indication information to the client at preset sending periods, so that the scenes of the target application program are automatically and sequentially switched. The embodiment of the application adopts a mode of three-terminal communication of the client, the server and the test terminal to carry out automatic test, replaces the mode of simulating manual operation in the prior art to carry out operations such as switching and screenshot on the display interface of the application program, removes UI adaptation work of the test terminal, effectively improves the test efficiency and improves the user experience.
The embodiment of the present application provides a testing apparatus, as shown in fig. 5, the testing apparatus 50 may include: a switching module 501, a starting module 502 and a testing module 503.
The switching module 501 is configured to send first indication information to a client; the first indication information indicates the client to load and switch a first scene of a target application program;
the starting module 502 is configured to receive second indication information sent by the client; the second indication information indicates the client to start testing the first scene;
the test module 503 is configured to send third indication information to the test end in response to the second indication information; and the third indication information indicates that the test end tests the first scene.
In the implementation manner of the embodiment of the application, the client responds to the first indication information sent by the server to switch the scene of the target application program, and the test end tests the scene of the target application program based on the third indication information sent by the server; according to the method and the device, the scene of the target application program is automatically and sequentially switched and tested based on the interactive mode of three-terminal communication of the client, the server and the testing terminal, compared with the mode of simulating manual operation in the prior art, the display interface of the application program is switched, tested and the like, UI adaptation work of the testing terminal is omitted, testing efficiency is effectively improved, and user experience is improved.
In the embodiment of the present application, a possible implementation manner is provided, and the switching module 501 may be specifically configured to:
and in each preset sending period, sending first indication information to the client.
In an embodiment of the present application, a possible implementation manner is provided, and the starting module 502 may be further configured to:
receiving fourth indication information sent by the client; the fourth indication information represents that the client finishes loading the first scene;
and sending first indication information to the client, wherein the first indication information indicates the client to load and switch the second scene of the target application program.
The embodiment of the present application provides a testing apparatus, as shown in fig. 6, the testing apparatus 60 may include: a receiving module 601 and a response module 602.
The receiving module 601 is configured to receive third indication information sent by the server; the third indication information is sent by the server in response to the second indication information sent by the client; the second indication information is sent after the client loads and switches the first scene of the target application program and starts testing the first scene;
the response module 602 is configured to test the first scenario in response to the third indication information.
The embodiment of the present application provides a testing apparatus, as shown in fig. 7, the testing apparatus 70 may include: a first switching module 701 and a first testing module 702.
The first switching module 701 is configured to receive first indication information sent by a server, load and switch a first scene of a target application program;
the first testing module 702 is configured to start testing a first scenario and send second indication information to the server; the second indication information indicates the server to send third indication information to the test end; and the third indication information indicates that the test end tests the first scene.
The testing apparatus of this embodiment can perform the testing method shown in the above embodiments of the present application, and the implementation principles thereof are similar, and are not described herein again.
An embodiment of the present application provides an electronic device, including: one or more processors, memory, one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, may achieve, compared to the prior art: in the implementation manner of the embodiment of the application, the client responds to the first indication information sent by the server to switch the scene of the target application program, and the test end tests the scene of the target application program based on the third indication information sent by the server; according to the method and the device, the scene of the target application program is automatically and sequentially switched and tested based on the interactive mode of three-terminal communication of the client, the server and the testing terminal, compared with the mode of simulating manual operation in the prior art, the display interface of the application program is switched, tested and the like, UI adaptation work of the testing terminal is omitted, testing efficiency is effectively improved, and user experience is improved.
In an alternative embodiment, an electronic device is provided, as shown in fig. 8, the electronic device 80 shown in fig. 8 comprising: a processor 801 and a memory 803. Wherein the processor 801 is coupled to a memory 803, such as via a bus 802. Optionally, the electronic device 80 may further include a transceiver 804, and the transceiver 804 may be used for data interaction between the electronic device and other devices, such as data transmission and/or data reception. It should be noted that the transceiver 804 is not limited to one in practical applications, and the structure of the electronic device 80 is not limited to the embodiment of the present application.
The Processor 801 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 801 may also be a combination of computing functions, e.g., comprising one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 802 may include a path that transfers information between the above components. The bus 802 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 802 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The Memory 803 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 803 is used for storing application program codes (computer programs) for executing the present scheme, and is controlled by the processor 801 to execute the programs. The processor 801 is configured to execute application program code stored in the memory 803 to implement the content shown in the foregoing method embodiments.
The electronic devices include, but are not limited to, mobile terminals such as mobile phones, notebook computers, PADs, etc., and fixed terminals such as digital TVs, desktop computers, etc.
The embodiment of the application provides a computer readable storage medium, and a computer program is stored on the computer readable storage medium, and when being executed by a processor, the computer program realizes the corresponding content in the foregoing method embodiment.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device realizes the following when executed:
sending first indication information to a client; the first indication information indicates the client to load and switch a first scene of a target application program; receiving second indication information sent by the client; the second indication information indicates the client to start testing the first scene; responding to the second indication information, and sending third indication information to the test terminal; and the third indication information indicates that the test end tests the first scene.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A testing method is applied to a server and is characterized by comprising the following steps:
sending first indication information to a client; the first indication information indicates the client to load and switch a first scene of a target application program;
receiving second indication information sent by the client; wherein the second indication information indicates that the client initiates testing of the first scenario;
responding to the second indication information, and sending third indication information to the testing end; and the third indication information indicates that the test end tests the first scene.
2. The testing method according to claim 1, wherein the sending the first indication information to the client comprises:
and sending the first indication information to the client in each preset sending period.
3. The testing method according to claim 1, wherein after receiving the second indication information sent by the client, the method comprises:
receiving fourth indication information sent by the client; the fourth indication information represents that the client finishes loading the first scene;
and sending the first indication information to the client, wherein the first indication information indicates the client to load and switch a second scene of a target application program.
4. A test method is applied to a test end and is characterized by comprising the following steps:
receiving third indication information sent by the server; the third indication information is sent by the server in response to second indication information sent by a client; the second indication information is sent after the client loads and switches a first scene of a target application program, and starts testing the first scene;
and responding to the third indication information, and testing the first scene.
5. A testing method is applied to a client side, and is characterized by comprising the following steps:
receiving first indication information sent by a server, and loading and switching a first scene of the target application program;
starting the test of the first scene, and sending second indication information to the server; the second indication information indicates the server to send third indication information to the test terminal; and the third indication information indicates the testing end to test the first scene.
6. A test apparatus, comprising:
the switching module is used for sending first indication information to the client; the first indication information indicates the client to load and switch a first scene of a target application program;
the starting module is used for receiving second indication information sent by the client; wherein the second indication information indicates that the client initiates testing of the first scenario;
the test module is used for responding to the second indication information and sending third indication information to the test end; and the third indication information indicates that the test end tests the first scene.
7. A test apparatus, comprising:
the receiving module is used for receiving third indication information sent by the server; the third indication information is sent by the server in response to second indication information sent by a client; the second indication information is sent after the client loads and switches a first scene of a target application program, and starts testing the first scene;
and the response module is used for responding to the third indication information and testing the first scene.
8. A test apparatus, comprising:
the first switching module is used for receiving first indication information sent by a server, loading and switching a first scene of the target application program;
the first testing module is used for starting the test of the first scene and sending second indication information to the server; the second indication information indicates the server to send third indication information to the test terminal; and the third indication information indicates the testing end to test the first scene.
9. An electronic device, comprising:
one or more processors;
a memory;
one or more application programs, wherein the one or more application programs are stored in the memory and configured to implement the testing method of any of claims 1-5 when executed by the one or more processors.
10. A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, carries out the testing method of any one of claims 1 to 5.
CN202110872479.8A 2021-07-30 2021-07-30 Test method, test device, electronic equipment and computer readable storage medium Pending CN113656289A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110872479.8A CN113656289A (en) 2021-07-30 2021-07-30 Test method, test device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110872479.8A CN113656289A (en) 2021-07-30 2021-07-30 Test method, test device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN113656289A true CN113656289A (en) 2021-11-16

Family

ID=78478133

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110872479.8A Pending CN113656289A (en) 2021-07-30 2021-07-30 Test method, test device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113656289A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2512690A1 (en) * 2005-07-20 2007-01-20 Ibm Canada Limited-Ibm Canada Limitee Enhanced scenario testing of an application under test
CN104050076A (en) * 2013-03-12 2014-09-17 阿里巴巴集团控股有限公司 Testing method, device and system of application software on mobile terminal
CN105260301A (en) * 2015-09-24 2016-01-20 努比亚技术有限公司 Visual effect comparison test device of user interfaces and realization method of visual effect comparison test device of user interfaces
CN109600282A (en) * 2018-12-26 2019-04-09 世纪龙信息网络有限责任公司 Test macro and test method based on cloud prototype

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2512690A1 (en) * 2005-07-20 2007-01-20 Ibm Canada Limited-Ibm Canada Limitee Enhanced scenario testing of an application under test
CN104050076A (en) * 2013-03-12 2014-09-17 阿里巴巴集团控股有限公司 Testing method, device and system of application software on mobile terminal
CN105260301A (en) * 2015-09-24 2016-01-20 努比亚技术有限公司 Visual effect comparison test device of user interfaces and realization method of visual effect comparison test device of user interfaces
CN109600282A (en) * 2018-12-26 2019-04-09 世纪龙信息网络有限责任公司 Test macro and test method based on cloud prototype

Similar Documents

Publication Publication Date Title
CN109302522B (en) Test method, test device, computer system, and computer medium
CN108959068B (en) Software interface testing method, device and storage medium
CN109885480B (en) Automatic interface compatibility testing method and device based on debugging bridge
CN110058998B (en) Software testing method and device
CN108228444B (en) Test method and device
CN109344066B (en) Method, system and terminal for testing browser page
CN104717337A (en) Method for testing mobile application in batch and equipment used in method
CN111522738A (en) Test method and device of micro-service system, storage medium and electronic equipment
CN109739700B (en) Interface testing method and device
CN111338616A (en) Protocol analysis code generation method and device and electronic equipment
CN104978276A (en) Method, device and system used for detecting software
CN115542875A (en) Vehicle detection method based on SOA service and related equipment
CN109656791B (en) gPC performance test method and device based on Jmeter
CN105446870B (en) The method and apparatus that automatic test is carried out to app application
CN106302011B (en) Multi-terminal-based test method and terminal
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN113656289A (en) Test method, test device, electronic equipment and computer readable storage medium
CN114721968B (en) Test method, test device and storage medium
CN116431522A (en) Automatic test method and system for low-code object storage gateway
CN113590498B (en) Method and system for testing application starting time of desktop operating system
CN111949510B (en) Test processing method, device, electronic equipment and readable storage medium
US20130046503A1 (en) Testing system and method having wireless data transmission capability
CN109739752B (en) Built-in resource testing method and device, electronic equipment and readable storage medium
CN112416750A (en) Application program boundary testing method and system
CN113434417B (en) Regression testing method and device for loopholes, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination