CN117591406A - Application program testing method and system - Google Patents

Application program testing method and system Download PDF

Info

Publication number
CN117591406A
CN117591406A CN202311559219.0A CN202311559219A CN117591406A CN 117591406 A CN117591406 A CN 117591406A CN 202311559219 A CN202311559219 A CN 202311559219A CN 117591406 A CN117591406 A CN 117591406A
Authority
CN
China
Prior art keywords
application program
terminal
display image
test
tested
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
CN202311559219.0A
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.)
Beijing Baolande Software Co ltd
Original Assignee
Beijing Baolande 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 Beijing Baolande Software Co ltd filed Critical Beijing Baolande Software Co ltd
Priority to CN202311559219.0A priority Critical patent/CN117591406A/en
Publication of CN117591406A publication Critical patent/CN117591406A/en
Pending legal-status Critical Current

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/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • 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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

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 application provides a test method and a test system for an application program, and relates to the technical field of computers. The method comprises the following steps: the test platform remotely controls the application program to be tested to execute related operations through the system application program, and sends a screenshot instruction to the terminal through the system application program; receiving at least one display image and a page extensible markup language file corresponding to the at least one display image sent by a terminal; at least one display image is an image obtained by executing screenshot operation on the current display interface of the terminal based on the screenshot instruction in the process of executing related operation by the application program to be tested; and generating a test case based on at least one display image and the page extensible markup language file corresponding to the at least one display image, and sending the test case to a system application program, wherein the test case is used for testing the application program to be tested, so that the efficiency of testing the application program can be effectively improved.

Description

Application program testing method and system
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and a system for testing an application program.
Background
The true mobile phone dial testing is a testing method, and mainly tests the application program performances under different mobile phone models, operating system versions and network environments, so that the application program quality is improved.
At present, an application program is mainly tested through a cloud real machine testing scheme; alternatively, the application is tested by a true machine test scheme.
However, the cloud real machine test scheme has high requirements on network environment and cannot be used in an intranet of an application program connecting company, and if the cloud real machine test scheme is directly connected with an external network, the security of application program data is difficult to control. The real machine test scheme mainly relies on manual writing of test scripts, and cannot conduct test work on a large scale at different places. In addition, the cloud real machine testing scheme and the real machine testing scheme both need a data line to be connected with the real machine to be tested, and the communication speed is low. Thus, using both of the above methods can result in inefficiency in testing of the real machine application.
Disclosure of Invention
The application program testing method and system can effectively improve the testing efficiency and safety of the true machine application program.
The application provides a test method of an application program, which is applied to a test platform in a test system of the application program, wherein the test platform establishes remote connection with a terminal through a system application program in the terminal, and the terminal runs the application program to be tested, and the test method of the application program can comprise the following steps:
Remotely controlling the application program to be tested to execute related operations through the system application program, and sending a screenshot instruction to the terminal through the system application program;
receiving at least one display image and a page extensible markup language file corresponding to the at least one display image sent by the terminal; the at least one display image is an image obtained by executing screenshot operation on the current display interface of the terminal based on the screenshot instruction in the process of executing the related operation by the application program to be tested;
generating a test case based on the at least one display image and the page extensible markup language file corresponding to the at least one display image, and sending the test case to the system application program, wherein the test case is used for testing the application program to be tested.
According to the application program testing method, the system application program remotely controls the application program to be tested to execute related operations, and the method comprises the following steps:
displaying a previous display image corresponding to a previous related operation on a touch layer of the test platform;
responding to the related operation of a first control in the previous display image, and determining position information corresponding to the first control based on the first control and a page extensible markup language file corresponding to the previous display image;
And sending the position information corresponding to the first control to the system application program, and controlling the application program to be tested to execute the related operation through the system application program in the terminal.
According to the method for testing the application program provided by the application program, the generating test cases based on the at least one display image and the page extensible markup language file corresponding to the at least one display image includes:
generating a test screen video of the application program to be tested based on the at least one display image and a page extensible markup language file corresponding to the at least one display image;
and generating the test case based on the test screen recording video.
According to the application program testing method, the system application program remotely controls the application program to be tested to execute related operations, and the method comprises the following steps:
transmitting a control instruction to the terminal through the system application program, wherein the control instruction comprises at least one of an adb instruction, an app ium instruction or an barrier-free service instruction;
the control instruction is used for controlling the application program to be tested to execute the related operation by the terminal.
According to the application program testing method, the remote connection is established between the system application program in the terminal and the terminal, and the method comprises the following steps:
receiving a connection request sent by the system application program, wherein the connection request comprises socket information;
and establishing the remote connection with the system application program based on the socket information.
The application program testing method can be applied to a terminal in a testing system, the terminal establishes remote connection with the testing platform through a system application program in the terminal, and the terminal runs an application program to be tested, and the method comprises the following steps:
in the process of controlling the application program to be tested to execute related operations through the system application program, receiving a screenshot instruction sent by the test platform through the system application program;
performing screenshot operation on a current display interface of the terminal based on the screenshot instruction to obtain at least one display image;
sending the at least one display image and a page extensible markup language file corresponding to the at least one display image to the test platform;
and receiving a test case sent by the test platform through the system application program, and testing the application program to be tested based on the test case, wherein the test case is generated based on the at least one display image and a page extensible markup language file corresponding to the at least one display image by the test platform.
According to the application program testing method, the system application program controls the application program to be tested to execute related operations, and the method comprises the following steps:
receiving, by the system application, a control instruction, the control instruction including at least one of an adb instruction, an app ium instruction, or an barrier-free service instruction;
and controlling the application program to be tested to execute the related operation based on the control instruction.
The application program testing device is applied to a testing platform in a testing system of the application program, the testing platform establishes remote connection with a terminal through a system application program in the terminal, and the application program testing device can comprise:
the control unit is used for remotely controlling the application program to be tested to execute related operations through the system application program and sending a screenshot instruction to the terminal through the system application program;
the first processing unit is used for receiving at least one display image sent by the terminal and a page extensible markup language file corresponding to the at least one display image; the at least one display image is an image obtained by executing screenshot operation on the current display interface of the terminal based on the screenshot instruction in the process of executing the related operation by the application program to be tested;
The second processing unit is used for generating a test case based on the at least one display image and the page extensible markup language file corresponding to the at least one display image, and sending the test case to the system application program, wherein the test case is used for testing the application program to be tested.
According to the application program testing device provided by the application program, the control unit is specifically configured to:
displaying a previous display image corresponding to a previous related operation on a touch layer of the test platform; responding to the related operation of a first control in the previous display image, and determining position information corresponding to the first control based on the first control and a page extensible markup language file corresponding to the previous display image; and sending the position information corresponding to the first control to the system application program, and controlling the application program to be tested to execute the related operation through the system application program in the terminal.
According to the application program testing device provided by the application program, the control unit is specifically configured to:
transmitting a control instruction to the terminal through the system application program, wherein the control instruction comprises at least one of an adb instruction, an app ium instruction or an barrier-free service instruction; the control instruction is used for controlling the application program to be tested to execute the related operation by the terminal.
According to the application program testing device provided by the application program, the second processing unit is specifically configured to:
generating a test screen video of the application program to be tested based on the at least one display image and a page extensible markup language file corresponding to the at least one display image; and generating the test case based on the test screen recording video.
According to the application program testing device, the device further comprises a third processing unit, wherein the third processing unit is used for:
receiving a connection request sent by the system application program, wherein the connection request comprises socket information; and establishing the remote connection with the system application program based on the socket information.
The application program testing device is applied to a terminal in a testing system of the application program, the terminal establishes remote connection with the testing platform through a system application program in the terminal, and the terminal is operated with the application program to be tested, and the application program testing device can comprise:
the fourth processing unit is used for receiving a screenshot instruction sent by the test platform through the system application program in the process of controlling the application program to be tested to execute related operations through the system application program;
The fifth processing unit is used for executing screenshot operation on the current display interface of the terminal based on the screenshot instruction to obtain at least one display image;
the sending unit is used for sending the at least one display image and the page extensible markup language file corresponding to the at least one display image to the test platform;
the sixth processing unit is configured to receive, by using the system application program, a test case sent by the test platform, and test the application program to be tested based on the test case, where the test case is generated based on the test platform and based on the at least one display image and a page extensible markup language file corresponding to the at least one display image.
According to the application program testing device provided by the application program, the fourth processing unit is specifically configured to:
receiving, by the system application, a control instruction, the control instruction including at least one of an adb instruction, an app ium instruction, or an barrier-free service instruction; and controlling the application program to be tested to execute the related operation based on the control instruction.
The application also provides a test platform, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the test platform realizes the test method of any one of the application programs when executing the program.
The application also provides a terminal comprising a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the terminal realizes the testing method of any one of the application programs when executing the program.
The application program testing system can comprise the testing platform and the terminal shown in any embodiment.
The present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of testing an application as described in any of the above.
According to the application program testing method and system, when the application program is tested, the testing platform can remotely control the application program to be tested to execute related operations through the system application program, and a screenshot instruction is sent to the terminal through the system application program; receiving at least one display image and a page extensible markup language file corresponding to the at least one display image sent by a terminal; at least one display image is an image obtained by executing screenshot operation on the current display interface of the terminal based on the screenshot instruction in the process of executing related operation by the application program to be tested; generating a test case based on at least one display image and a page extensible markup language file corresponding to the at least one display image, and sending the test case to a system application program, wherein the test case is used for testing the application program to be tested. The test platform generates the test cases through the to-be-tested application program of the system application program remote control terminal installed in the terminal, tests the to-be-tested application program based on the test cases, can test the application programs at different positions in a large scale at the same time without being limited by data lines, and effectively improves the test efficiency of the real machine application program.
Drawings
For a clearer description of the present application or of the prior art, the drawings that are used in the description of the embodiments or of the prior art will be briefly described, it being apparent that the drawings in the description below are some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic architecture diagram of a test system for an application according to an embodiment of the present application;
fig. 2 is a flow chart of a testing method of an application program according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another testing method of an application according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a remote control according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a test device for an application according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of another testing device for an application according to an embodiment of the present disclosure;
fig. 7 is a schematic physical structure diagram of a test platform according to an embodiment of the present application;
fig. 8 is a schematic entity structure of a terminal according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is apparent that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: there are three cases, a alone, a and B together, and B alone, wherein a, B may be singular or plural. In the text description of the present application, the character "/" generally indicates that the front-rear association object is an or relationship.
The technical scheme provided by the embodiment of the application program can be applied to the determination scene of the true mobile phone dial testing application program. At present, an application program is mainly tested through a cloud real machine testing scheme; alternatively, the application is tested by a true machine test scheme.
However, the cloud real machine test scheme has high requirements on network environment and cannot be used in an intranet of an application program connecting company, and if the cloud real machine test scheme is directly connected with an external network, the security of application program data is difficult to control. The real machine test scheme mainly relies on manual writing of test scripts, and cannot conduct test work on a large scale at different places. In addition, the cloud real machine test scheme and the real machine test scheme both need USB data lines to connect the mobile phone and the host machine, and the communication speed is low. Thus, using both of the above methods can result in inefficiency in testing of the real machine application.
In order to effectively improve the testing efficiency of a true machine application program, the embodiment of the application program testing method is provided, when the application program is tested, a testing platform can remotely control the application program to be tested to execute related operations through a system application program, and a screenshot instruction is sent to a terminal through the system application program; receiving at least one display image and a page extensible markup language file corresponding to the at least one display image sent by a terminal; at least one display image is an image obtained by executing screenshot operation on the current display interface of the terminal based on the screenshot instruction in the process of executing related operation by the application program to be tested; generating a test case based on at least one display image and a page extensible markup language file corresponding to the at least one display image, and sending the test case to a system application program, wherein the test case is used for testing the application program to be tested. The test platform generates the test cases through the to-be-tested application program of the system application program remote control terminal installed in the terminal, tests the to-be-tested application program based on the test cases, can test the application programs at different positions in a large scale at the same time without being limited by data lines, and effectively improves the test efficiency of the real machine application program.
In order to realize the method for testing the application program provided by the embodiment of the application, the embodiment of the application provides a system for testing the application program, which is used for realizing the method for testing the application program provided by the embodiment of the application.
For example, referring to fig. 1, fig. 1 is a schematic architecture diagram of an application testing system provided in an embodiment of the present application, where the application testing system may include a testing platform and two terminals, namely, a terminal 1, a terminal 2, and a terminal 3. The terminal 1 is provided with a system application program and an application program to be tested of the terminal 1, the terminal 2 is provided with a system application program and an application program to be tested of the terminal 2, and the terminal 3 is provided with a system application program and an application program to be tested of the terminal 3. The test platform establishes remote connection with the terminal 1 through the system application program in the terminal 1, the test platform establishes remote connection with the terminal 2 through the system application program in the terminal 2, and the test platform establishes remote connection with the terminal 3 through the system application program in the terminal 3.
By adopting the method for testing the application program, the test platform remotely controls the application program to be tested in the terminal 1 to execute related operations through the system application program installed in the terminal 1 so as to generate a test case 1 of the application program to be tested in the terminal 1, and tests the application program to be tested in the terminal 1 based on the test case 1; the method comprises the steps that through a system application program installed in a terminal 2, the application program to be tested in the terminal 2 is remotely controlled to execute related operations so as to generate a test case 2 of the program to be tested in the terminal 2, and the program to be tested in the terminal 2 is tested based on the test case 2; the system application program installed in the terminal 3 is used for remotely controlling the application program to be tested in the terminal 3 to execute related operations so as to generate a test case 3 of the application program to be tested in the terminal 3, and the test is performed on the application program to be tested in the terminal 3 based on the test case 3, so that the application programs in different positions can be tested in a large scale at the same time without being limited by data lines, and the test efficiency of the application program of a real machine is effectively improved.
Hereinafter, a test method of the application program provided in the present application will be described in detail by means of the following several specific examples. It is to be understood that the following embodiments may be combined with each other and that some embodiments may not be repeated for the same or similar concepts or processes.
Fig. 2 is a flow chart of a testing method of an application program, which is provided in an embodiment of the present application, and is applied to a testing platform in a testing system, where the testing method of the application program may be executed by a software and/or hardware device, and the testing platform establishes a remote connection with a terminal through a system application program in the terminal, and the terminal runs an application program to be tested. For example, referring to fig. 2, the method for testing the application program may include:
step 201, the test platform remotely controls an application program to be tested to execute related operations through a system application program, and sends a screenshot instruction to the terminal through the system application program.
For example, the screenshot instruction may be periodically sent to the terminal by the test platform through the system application program, where the interval period may be 100ms or 200ms, and may specifically be set according to actual needs.
Illustratively, in the embodiment of the present application, the test platform sends a control instruction to the terminal through the system application program, where the control instruction includes at least one of an adb instruction, an app ium instruction, or an unobstructed service instruction. The control instruction is used for controlling the application program to be tested to execute related operations by the terminal.
For example, the application program to be tested may be an application program on a mobile phone above the Android 11 system, and includes applications of multiple development languages such as a native terminal and ReactNative, flutter, html. The setting may be specifically performed according to actual needs, and herein, the embodiment of the present application is not specifically limited.
Illustratively, in the embodiments of the present application, the related operations may be: the method includes the steps of locking a screen, unlocking the screen, rotating the screen, system keys, switching networks, clicking coordinates, long-pressing the coordinates, sliding dragging, multi-point touch, opening an application, installing the application, unloading the application, terminating the application, running in the background, judging whether an element exists, clicking the element, inputting a text by the element, dragging the element, long-pressing the element, acquiring an element text value, verifying a text value, verifying an element attribute, verifying activity, acquiring a screenshot, step intervals and the like.
For example, in the embodiment of the present application, when the application to be tested is remotely controlled by the system application to perform the related operation, a previous display image corresponding to the previous related operation may be displayed on the touch layer of the test platform; responding to the related operation of the first control in the previous display image, and determining the position information corresponding to the first control based on the first control and the page extensible markup language file corresponding to the previous display image; and finally, the position information corresponding to the first control is sent to a system application program, and the system application program in the terminal controls the application program to be tested to execute related operations.
The display image at least comprises a first control of the current related operation, the page extensible markup language file xml corresponding to the display image at least comprises position information and time information of the first control, the position information and the time information can be specifically set according to actual needs, and the terminal compresses the display image and sends the compressed display image to the test platform to realize real-time display of the terminal on the test platform.
For example, when a user clicks a first control on a display image by operating a mouse on a background management page of a test platform, information such as xpath, ID, attribute and the like corresponding to the first control can be obtained, so that remote control of an application to be tested is realized.
For example, the first control corresponding to the operation of opening the application may be an icon of the application in the display image, and the corresponding related operation is an opening operation; the first control corresponding to the operation of rotating the screen may be a rotation key in the display image, and the corresponding related operation is a rotation operation.
The test platform remotely controls the application program to be tested to execute related operations through the system application program, after a screenshot instruction is sent to the terminal through the system application program, the terminal can correspondingly execute the screenshot operation on the current display interface of the terminal based on the screenshot instruction to obtain at least one display image, and at least one display image and a page extensible markup language file corresponding to the at least one display image are sent to the test platform.
It should be noted that, when the terminal obtains at least one display image based on the screenshot instruction, the related operations may be the same or different. For example, under the operation of unlocking a screen, the screenshot is obtained to at least one display image, under the operation of sliding and dragging, the screenshot is obtained to at least one display image, and the like, through the operation, the screenshot can be obtained to at least one display image, and the display images are uniformly compressed through a system application program and then sent to a test platform, so that real-time display of the terminal is realized.
For example, in the embodiment of the present application, before the test platform remotely controls the application program to be tested in the terminal to execute the related operation, the test platform may be first made to establish a remote connection with the terminal through the system application program in the terminal, and the specific process includes: the test platform can receive a connection request sent by a system application program, wherein the connection request comprises socket information; and based on socket information, remote connection is established with the system application program, so that after the test platform establishes remote connection with the system application program, the test platform can remotely control the application program to be tested to execute related operations through the system application program, and a screenshot instruction is sent to the terminal through the system application program.
Illustratively, during the connection, the socket information socket may be encrypted in order to secure the test data.
Step 202, a test platform receives at least one display image and a page extensible markup language file corresponding to the at least one display image sent by a terminal; and at least one display image is an image obtained by executing screenshot operation on the current display interface of the terminal based on the screenshot instruction in the process of executing related operation by the application program to be tested.
Step 203, the test platform generates a test case based on at least one display image and a page extensible markup language file corresponding to the at least one display image, and sends the test case to the system application program, wherein the test case is used for testing the application program to be tested.
For example, in the embodiment of the application, when a test case is generated based on at least one display image and a page extensible markup language file corresponding to the at least one display image, a test video of an application to be tested may be generated first; and generating test cases based on the test screen video.
The test platform sends the test cases to the system application program of the terminal, and the terminal can test the application program to be tested based on the test cases. When the terminal tests the application program to be tested based on the test case, the terminal can bind the generated test case and the application program to be tested to generate a test suite, and bind the test suite and the cron expression, so that the application program to be tested is tested.
It can be seen that, in the embodiment of the present application, when testing an application program to be tested installed in a terminal, a test platform may first remotely control the application program to be tested to execute related operations through a system application program, and send a screenshot instruction to the terminal through the system application program; receiving at least one display image and a page extensible markup language file corresponding to the at least one display image sent by a terminal; at least one display image is an image obtained by executing screenshot operation on the current display interface of the terminal based on the screenshot instruction in the process of executing related operation by the application program to be tested; generating a test case based on at least one display image and a page extensible markup language file corresponding to the at least one display image, and sending the test case to a system application program, wherein the test case is used for testing the application program to be tested. The test platform generates the test cases through the to-be-tested application program of the system application program remote control terminal installed in the terminal, tests the to-be-tested application program based on the test cases, can test the application programs at different positions in a large scale at the same time without being limited by data lines, and effectively improves the test efficiency of the real machine application program.
Fig. 3 is a flow chart of another testing method of an application program provided in an embodiment of the present application, which is applied to a terminal in a testing system, where the testing method of the application program may be executed by a software and/or hardware device, the terminal establishes a remote connection with a testing platform through a system application program, and the terminal runs an application program to be tested. For example, referring to fig. 3, the method for testing the application program may include:
step 301, the terminal receives a screenshot instruction sent by the test platform through the system application program in the process of controlling the application program to be tested to execute related operations through the system application program.
Illustratively, in the embodiment of the present application, the terminal receives a control instruction through the system application program, where the control instruction includes at least one of an adb instruction, an app ium instruction, or an unobstructed service instruction; and controlling the application program to be tested to execute related operations based on the control instruction.
For example, the application program to be tested may be an application program on a mobile phone above the Android 11 system, and includes applications of multiple development languages such as a native terminal and ReactNative, flutter, html. Can be specifically set according to actual needs, and the embodiment of the present application is not specifically limited
And 302, the terminal executes screenshot operation on a current display interface of the terminal based on the screenshot instruction to obtain at least one display image.
The terminal can execute screenshot operation on the current display interface of the terminal based on the screenshot instruction, and when at least one display image is obtained, related operations can be the same or different. For example, under the operation of unlocking a screen, the screenshot is obtained to at least one display image, under the operation of sliding and dragging, the screenshot is obtained to at least one display image, and the like, through the operation, the screenshot can be obtained to at least one display image, and the display images are uniformly compressed through a system application program and then sent to a test platform, so that real-time display of the terminal is realized.
Step 303, the terminal sends at least one display image and a page extensible markup language file corresponding to the at least one display image to the test platform.
After receiving at least one display image and a page extensible markup language file corresponding to the at least one display image sent by the terminal, the test platform generates a test case based on the at least one display image and the page extensible markup language file corresponding to the at least one display image, and sends the test case to the terminal, and the terminal continues to execute the following step 304.
Step 304, the terminal receives a test case sent by the test platform through the system application program, and tests the application program to be tested based on the test case, wherein the test case is generated based on at least one display image and a page extensible markup language file corresponding to the at least one display image by the test platform.
It can be seen that, in this embodiment of the present application, when testing a program to be tested installed in a terminal, the terminal establishes a remote connection with a test platform through a system application installed in the terminal, and receives a screenshot instruction sent by the test platform through the system application, performs a screenshot operation on a current display interface of the terminal based on the screenshot instruction to obtain at least one display image, sends the at least one display image and a page extensible markup language file corresponding to the at least one display image to the test platform, receives a test case sent by the test platform through the system application, and tests the application to be tested based on the test case, where the test case is generated based on the test platform based on the at least one display image and the page extensible markup language file corresponding to the at least one display image. Therefore, the internal exchange of the data between the test platform and the terminal to be tested is realized through the system application program, the intervention of a third party platform is not needed, the same type of terminal to be tested in different regions can be remotely controlled by a user at the same time, and a large number of tests are carried out, so that the safety of cloud test data is improved, and the test efficiency of the terminal application program is also effectively improved.
In order to facilitate understanding of the test method of the application program provided in the embodiment of the present application, a detailed description will be given below of how to implement the test of the application program to be tested in the terminal 1, the terminal 2 and the terminal 3, taking the scenario shown in fig. 1 as an example, and referring to fig. 4, fig. 4 is a schematic diagram of remote control provided in the embodiment of the present application, and in combination with fig. 4, the test of the application program to be tested in the terminal 1, the terminal 2 and the terminal 3 may be implemented.
Before the test platform remotely controls the application programs to be tested in the terminal 1, the terminal 2 and the terminal 3 to execute related operations, firstly, the test platform can receive connection requests containing socket information sent by the system application programs of the terminal 1, the terminal 2 and the terminal 3, and establish remote connection with the system application programs in the terminal 1, the terminal 2 and the terminal 3 respectively based on the socket information.
On the basis of establishing remote connection, the test platform remotely controls an application program to be tested in the terminal 1 to execute related operations through a system application program in the terminal 1, and sends a screenshot instruction to the terminal 1 through the system application program in the terminal 1; the method comprises the steps that an application program to be tested in a terminal 2 is remotely controlled by the system application program in the terminal 2 to execute related operations, and a screenshot instruction is sent to the terminal 2 by the system application program in the terminal 2; and remotely controlling an application program to be tested in the terminal 3 to execute related operations through the system application program in the terminal 3, and sending a screenshot instruction to the terminal 3 through the system application program in the terminal 3.
Correspondingly, the terminal 1 receives a screenshot instruction sent by the test platform through a system application program, performs screenshot operation on the current display interface of the terminal 1 based on the screenshot instruction in the process of executing related operation to obtain a display image, and sends the display image and a corresponding page extensible markup language file to the test platform; the terminal 2 receives a screenshot instruction sent by the test platform through a system application program, performs screenshot operation on a current display interface of the terminal 2 based on the screenshot instruction in the process of executing related operation to obtain a display image, and sends the display image and a corresponding page extensible markup language file to the test platform; the terminal 3 receives a screenshot instruction sent by the test platform through a system application program, performs screenshot operation on the current display interface of the terminal 3 based on the screenshot instruction in the process of executing related operation to obtain a display image, and sends the display image and a corresponding page extensible markup language file to the test platform.
Then, after receiving the display image and the corresponding page extensible markup language file sent by the terminal 1, the test platform generates a test case based on the display image and the corresponding page extensible markup language file, and sends the test case to a system application program in the terminal 1; after receiving the display image and the corresponding page extensible markup language file sent by the terminal 2, generating a test case based on the display image and the corresponding page extensible markup language file, and sending the test case to a system application program in the terminal 2; after receiving the display image and the corresponding page extensible markup language file sent by the terminal 3, generating a test case based on the display image and the corresponding page extensible markup language file, and sending the test case to a system application program in the terminal 3.
Finally, the system application program in the terminal 1 tests the application program to be tested in the terminal 1 through the test case received by the terminal 1; the system application program in the terminal 2 tests the application program to be tested in the terminal 2 through the test case received by the terminal 2; the system application program in the terminal 3 tests the application program to be tested in the terminal 3 through the test case received by the terminal 3.
It can be understood that if the terminal 1, the terminal 2 and the terminal 3 are terminals with completely consistent parameters, the test platform may only generate one test case, and then send the test case to the terminal 1, the terminal 2 and the terminal 3 respectively, so as to implement the test of the application to be tested in the terminal 1, the terminal 2 and the terminal 3. The test platform remotely controls the application programs to be tested to generate test cases through the system application programs installed in the terminal 1, the terminal 2 and the terminal 3, tests the application programs to be tested based on the test cases, can test the application programs in different positions in a large scale at the same time without being limited by data lines, and effectively improves the test efficiency of the real machine application program.
Fig. 5 is a schematic structural diagram of an application testing device 50 provided in an embodiment of the present application, which is applied to a testing platform in a testing system of an application, where the testing platform establishes a remote connection with a terminal through a system application in the terminal, for example, please refer to fig. 5, the application testing device 50 may include:
The control unit 501 is configured to remotely control, by using a system application, an application to be tested to perform a related operation, and send a screenshot instruction to the terminal through the system application.
The first processing unit 502 is configured to receive at least one display image sent by a terminal and a page extensible markup language file corresponding to the at least one display image; and at least one display image is an image obtained by executing screenshot operation on the current display interface of the terminal based on the screenshot instruction in the process of executing related operation by the application program to be tested.
The second processing unit 503 is configured to generate a test case based on at least one display image and a page extensible markup language file corresponding to the at least one display image, and send the test case to a system application program, where the test case is used to test an application program to be tested.
Illustratively, in the present embodiment, the control unit 501 is specifically configured to:
displaying a previous display image corresponding to the previous related operation on a touch layer of the test platform; responding to the related operation of the first control in the previous display image, and determining the position information corresponding to the first control based on the first control and the page extensible markup language file corresponding to the previous display image; and sending the position information corresponding to the first control to a system application program, and controlling the application program to be tested to execute related operations through the system application program in the terminal.
Illustratively, in the present embodiment, the control unit 501 is specifically configured to:
transmitting a control instruction to the terminal through a system application program, wherein the control instruction comprises at least one of an adb instruction, an app ium instruction or an barrier-free service instruction; the control instruction is used for controlling the application program to be tested to execute related operations by the terminal.
Illustratively, in the present embodiment, the second processing unit 503 is specifically configured to:
generating a test screen video of the application to be tested based on at least one display image and a page extensible markup language file corresponding to the at least one display image; and generating test cases based on the test video.
Illustratively, in an embodiment of the present application, the test apparatus of the application further includes a third processing unit configured to:
receiving a connection request sent by a system application program, wherein the connection request comprises socket information; based on the socket information, a remote connection is established with the system application.
Fig. 6 is a schematic structural diagram of another application testing device 60 provided in the embodiment of the present application, which is applied to a terminal in a testing system of an application, where the terminal establishes a remote connection with a testing platform through a system application in the terminal, and the terminal runs an application to be tested, for example, please refer to fig. 6, the application testing device 60 may include:
The fourth processing unit 601 is configured to receive, by the system application, a screenshot instruction sent by the test platform in a process of controlling, by the system application, the application to be tested to perform a related operation.
And the fifth processing unit 602 is configured to perform a screenshot operation on a current display interface of the terminal based on the screenshot instruction to obtain at least one display image.
The sending unit 603 is configured to send at least one display image and a page extensible markup language file corresponding to the at least one display image to the test platform.
The sixth processing unit 604 is configured to receive, by using the system application program, a test case sent by the test platform, and test the application program to be tested based on the test case, where the test case is generated based on at least one display image and a page extensible markup language file corresponding to the at least one display image by using the test platform.
Illustratively, in the present embodiment, the fourth processing unit 601 is specifically configured to:
receiving a control instruction by a system application program, wherein the control instruction comprises at least one of an adb instruction, an app ium instruction or an barrier-free service instruction; and controlling the application program to be tested to execute related operations based on the control instruction.
Fig. 7 is a schematic physical structure diagram of a test platform according to an embodiment of the present application, and as shown in fig. 7, the test platform may include: processor 710, communication interface (Communications Interface) 720, memory 730, and communication bus 740, wherein processor 710, communication interface 720, memory 730 communicate with each other via communication bus 740. Processor 710 may call logic instructions in memory 730 to perform a test method for an application program, the method comprising: the test platform controls the application program to be tested to execute related operations through the system application program, and sends a screenshot instruction to the terminal through the system application program; receiving at least one display image and a page extensible markup language file corresponding to the at least one display image sent by a terminal; at least one display image is an image obtained by executing screenshot operation on the current display interface of the terminal based on the screenshot instruction in the process of executing related operation by the application program to be tested; generating a test case based on at least one display image and a page extensible markup language file corresponding to the at least one display image, and sending the test case to a system application program, wherein the test case is used for testing the application program to be tested.
Further, the logic instructions in the memory 730 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Fig. 8 is a schematic entity structure diagram of a terminal provided in an embodiment of the present application, and as shown in fig. 8, the terminal may include: processor 810, communication interface (Communications Interface) 820, memory 830, and communication bus 840, wherein processor 810, communication interface 820, memory 830 accomplish communication with each other through communication bus 840. Processor 810 may call logic instructions in memory 830 to perform a test method for an application program, the method comprising: the method comprises the steps that a terminal receives a screenshot instruction sent by a test platform through a system application program in the process of controlling the application program to be tested to execute related operations through the system application program; performing screenshot operation on a current display interface of the terminal based on the screenshot instruction to obtain at least one display image; transmitting at least one display image and a page extensible markup language file corresponding to the at least one display image to a test platform; the method comprises the steps of receiving a test case sent by a test platform through a system application program, and testing the application program to be tested based on the test case, wherein the test case is generated based on at least one display image and a page extensible markup language file corresponding to the at least one display image by the test platform.
Further, the logic instructions in the memory 830 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The embodiment of the application program testing system may further include the testing platform and the terminal shown in any one of the embodiments, and the application program testing system provided in the embodiment of the application program may execute the technical scheme of the application program testing method in any one of the embodiments, and the implementation principle and the beneficial effects of the application program testing method are similar to those of the application program testing method, and may be referred to herein without redundant description.
In another aspect, the present application also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of executing the method of testing an application provided by the methods described above, the method comprising: the test platform controls the application program to be tested to execute related operations through the system application program, and sends a screenshot instruction to the terminal through the system application program, and the terminal receives the screenshot instruction sent by the test platform through the system application program. The terminal executes screenshot operation on a current display interface of the terminal based on the screenshot instruction to obtain at least one display image, and sends the at least one display image and a page extensible markup language file corresponding to the at least one display image to the test platform; the testing platform receives at least one display image and a page extensible markup language file corresponding to the at least one display image, wherein the at least one display image is an image obtained by executing screenshot operation on a current display interface of the terminal based on a screenshot instruction in the process of executing related operation on an application program to be tested. The test platform generates a test case based on at least one display image and a page extensible markup language file corresponding to the at least one display image, the test case is sent to a system application program, and the terminal receives the test case sent by the test platform through the system application program and tests the application program to be tested based on the test case;
Alternatively, the method comprises: the terminal receives a screenshot instruction sent by the test platform through the system application program in the process of controlling the application program to be tested to execute related operations through the system application program; performing screenshot operation on a current display interface of the terminal based on the screenshot instruction to obtain at least one display image; sending the at least one display image and a page extensible markup language file corresponding to the at least one display image to the test platform; and receiving a test case sent by the test platform through the system application program, and testing the application program to be tested based on the test case, wherein the test case is generated based on the at least one display image and a page extensible markup language file corresponding to the at least one display image by the test platform.
In yet another aspect, the present application further provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform a method of testing an application provided by the methods described above, the method comprising: the test platform controls the application program to be tested to execute related operations through the system application program, and sends a screenshot instruction to the terminal through the system application program, and the terminal receives the screenshot instruction sent by the test platform through the system application program. The terminal executes screenshot operation on a current display interface of the terminal based on the screenshot instruction to obtain at least one display image, and sends the at least one display image and a page extensible markup language file corresponding to the at least one display image to the test platform; the testing platform receives at least one display image and a page extensible markup language file corresponding to the at least one display image, wherein the at least one display image is an image obtained by executing screenshot operation on a current display interface of the terminal based on a screenshot instruction in the process of executing related operation on an application program to be tested. The test platform generates a test case based on at least one display image and a page extensible markup language file corresponding to the at least one display image, the test case is sent to a system application program, and the terminal receives the test case sent by the test platform through the system application program and tests the application program to be tested based on the test case;
Alternatively, the method comprises: the terminal receives a screenshot instruction sent by the test platform through the system application program in the process of controlling the application program to be tested to execute related operations through the system application program; performing screenshot operation on a current display interface of the terminal based on the screenshot instruction to obtain at least one display image; sending the at least one display image and a page extensible markup language file corresponding to the at least one display image to the test platform; and receiving a test case sent by the test platform through the system application program, and testing the application program to be tested based on the test case, wherein the test case is generated based on the at least one display image and a page extensible markup language file corresponding to the at least one display image by the test platform.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (10)

1. The utility model provides a test method of application program, its characterized in that is applied to the test platform in the test system of application program, the test platform establishes remote connection with terminal through the system application program in the terminal, the operation has the application program that awaits measuring on the terminal, the method includes:
remotely controlling the application program to be tested to execute related operations through the system application program, and sending a screenshot instruction to the terminal through the system application program;
receiving at least one display image and a page extensible markup language file corresponding to the at least one display image sent by the terminal; the at least one display image is an image obtained by executing screenshot operation on the current display interface of the terminal based on the screenshot instruction in the process of executing the related operation by the application program to be tested;
Generating a test case based on the at least one display image and the page extensible markup language file corresponding to the at least one display image, and sending the test case to the system application program, wherein the test case is used for testing the application program to be tested.
2. The method for testing an application program according to claim 1, wherein said remotely controlling, by the system application program, the application program to be tested to perform related operations comprises:
displaying a previous display image corresponding to a previous related operation on a touch layer of the test platform;
responding to the related operation of a first control in the previous display image, and determining position information corresponding to the first control based on the first control and a page extensible markup language file corresponding to the previous display image;
and sending the position information corresponding to the first control to the system application program, and controlling the application program to be tested to execute the related operation through the system application program in the terminal.
3. The method for testing an application program according to claim 1 or 2, wherein the generating a test case based on the at least one display image and the page extensible markup language file corresponding to the at least one display image includes:
Generating a test screen video of the application program to be tested based on the at least one display image and a page extensible markup language file corresponding to the at least one display image;
and generating the test case based on the test screen recording video.
4. The method for testing an application program according to claim 1 or 2, wherein the remote control of the application program to be tested by the system application program to perform related operations comprises:
transmitting a control instruction to the terminal through the system application program, wherein the control instruction comprises at least one of an adb instruction, an app ium instruction or an barrier-free service instruction;
the control instruction is used for controlling the application program to be tested to execute the related operation by the terminal.
5. The method for testing an application program according to claim 1 or 2, wherein the establishing a remote connection with the terminal through a system application program in the terminal comprises:
receiving a connection request sent by the system application program, wherein the connection request comprises socket information;
and establishing the remote connection with the system application program based on the socket information.
6. The utility model provides a test method of application program, its characterized in that is applied to the terminal in the test system of application program, the terminal establishes remote connection through the system application program in the terminal with test platform, the terminal is operated and is awaited measuring the application program, the method includes:
in the process of controlling the application program to be tested to execute related operations through the system application program, receiving a screenshot instruction sent by the test platform through the system application program;
performing screenshot operation on a current display interface of the terminal based on the screenshot instruction to obtain at least one display image;
sending the at least one display image and a page extensible markup language file corresponding to the at least one display image to the test platform;
and receiving a test case sent by the test platform through the system application program, and testing the application program to be tested based on the test case, wherein the test case is generated based on the at least one display image and a page extensible markup language file corresponding to the at least one display image by the test platform.
7. The method for testing an application program according to claim 6, wherein the controlling, by the system application program, the application program to be tested to perform the related operation includes:
Receiving, by the system application, a control instruction, the control instruction including at least one of an adb instruction, an app ium instruction, or an barrier-free service instruction;
and controlling the application program to be tested to execute the related operation based on the control instruction.
8. A test platform comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of testing an application program according to any one of claims 1 to 5 when executing the program.
9. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method for testing an application program according to claim 6 or 7 when executing the program.
10. A test system for an application program, comprising the test platform of claim 8 and the terminal of claim 9.
CN202311559219.0A 2023-11-21 2023-11-21 Application program testing method and system Pending CN117591406A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311559219.0A CN117591406A (en) 2023-11-21 2023-11-21 Application program testing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311559219.0A CN117591406A (en) 2023-11-21 2023-11-21 Application program testing method and system

Publications (1)

Publication Number Publication Date
CN117591406A true CN117591406A (en) 2024-02-23

Family

ID=89914587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311559219.0A Pending CN117591406A (en) 2023-11-21 2023-11-21 Application program testing method and system

Country Status (1)

Country Link
CN (1) CN117591406A (en)

Similar Documents

Publication Publication Date Title
EP2875425B1 (en) Providing access to a remote application via a web client
CN108804302B (en) Remote testing method, system and related equipment
CN108959068B (en) Software interface testing method, device and storage medium
CN110659206A (en) Simulation architecture establishing method, device, medium and electronic equipment based on microservice
CN112835782B (en) Interface access test method and system
CN113608812A (en) Remote control method, device, system and storage medium
CN111444095A (en) Test platform system and test method of mobile equipment
CN106952426B (en) Data processing method and device
CN113608997B (en) Remote debugging method and device for embedded webpage of application program and electronic equipment
CN112866312A (en) Script generation method, remote operation method and related equipment
CN109711124B (en) Method, apparatus, computer device and storage medium for managing mobile device
CN113849356A (en) Equipment testing method and device, electronic equipment and storage medium
EP4030373A1 (en) Object comparison method, and device
US20240020960A1 (en) Neural Network Host Platform for Detecting Anomalies in Cybersecurity Modules
CN112783597A (en) Remote desktop implementation method and related equipment
CN116662193A (en) Page testing method and device
CN117591406A (en) Application program testing method and system
CN114422236B (en) Intelligent device access method and device and electronic device
CN111984543B (en) Instruction testing method, device and system
CN113434384B (en) Pressure testing method and device
CN111552572A (en) Task processing method, readable storage medium and electronic device
CN112600786B (en) Data interaction method and device
CN115145464B (en) Page testing method and device, electronic equipment and storage medium
US20240004781A1 (en) Network status simulation for remote device infrastructure
CN110737601A (en) test methods, devices, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication