CN115599674A - Software testing method and device, electronic equipment and storage medium - Google Patents

Software testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115599674A
CN115599674A CN202211284345.5A CN202211284345A CN115599674A CN 115599674 A CN115599674 A CN 115599674A CN 202211284345 A CN202211284345 A CN 202211284345A CN 115599674 A CN115599674 A CN 115599674A
Authority
CN
China
Prior art keywords
terminal device
interface information
target software
target
instruction
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
CN202211284345.5A
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 Ziroom Information Technology Co Ltd
Original Assignee
Beijing Ziroom Information Technology 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 Ziroom Information Technology Co Ltd filed Critical Beijing Ziroom Information Technology Co Ltd
Priority to CN202211284345.5A priority Critical patent/CN115599674A/en
Publication of CN115599674A publication Critical patent/CN115599674A/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/3696Methods or tools to render software testable
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content

Abstract

The invention relates to the field of software testing, in particular to a software testing method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring at least one terminal device connected with the electronic device, and controlling each terminal device to open target software; sending an operation instruction aiming at the target software to each terminal device, and receiving an instruction operation result returned by each terminal device; acquiring current interface information corresponding to each terminal device; analyzing the current interface information, and verifying the instruction operation result according to the identification result to determine the test result of the target software. According to the software testing method, a tester is not required to test the target software on each terminal device, so that the software testing efficiency is improved, a large amount of manpower, material resources and financial resources are saved, and the automatic compatibility test and normal business process test on the target software are realized.

Description

Software testing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the field of software testing, in particular to a software testing method and device, electronic equipment and a storage medium.
Background
In the current society, the mobile internet is rapidly developed, the content carried by software is also explosively increased, the version iteration of the mobile software is rapidly carried out, and one version is released from the first one month to the current one week.
This also requires that the software development tester perform a test regression on the software before each version of the software is released. Therefore, a great test workload is brought to the tester. The method needs a large amount of software development testers to test the software, wastes a large amount of manpower, material resources and financial resources, and has low efficiency.
Disclosure of Invention
In view of this, embodiments of the present invention provide a software testing method and apparatus, an electronic device, and a storage medium, so as to solve the problems that in the prior art, a large number of software development testers are required to test software, a large amount of manpower, material resources, and financial resources are wasted, and efficiency is low.
According to a first aspect, an embodiment of the present invention provides a software testing method, including:
acquiring at least one terminal device connected with the electronic device, and controlling each terminal device to open target software;
sending an operation instruction aiming at the target software to each terminal device, and receiving an instruction operation result returned by each terminal device;
acquiring current interface information corresponding to each terminal device;
analyzing the current interface information, and verifying the instruction operation result according to the identification result to determine the test result of the target software.
According to the software testing method provided by the embodiment of the invention, at least one terminal device connected with the electronic device is obtained, which indicates that the electronic device can be simultaneously connected with a plurality of electronic devices, so that the target software in the plurality of terminal devices can be tested. Then, the electronic device controls each terminal device to open the target software, and sends an operation instruction for the target software to each terminal device, so that each terminal device can receive the operation instruction sent by the electronic device and operate based on the received operation instruction. And then, the electronic equipment receives the instruction operation result returned by each terminal equipment, and then acquires the current interface information corresponding to each terminal equipment. The electronic equipment analyzes the current interface information and verifies the instruction operation result according to the identification result so as to determine the test result of the target software, thereby ensuring the accuracy of the determined test result of the target software. According to the software testing method, a tester is not required to test the target software on each terminal device, so that the software testing efficiency is improved, a large amount of manpower, material resources and financial resources are saved, and the automatic compatibility test and normal business process test on the target software are realized.
With reference to the first aspect, in a first implementation manner of the first aspect, the step of analyzing current interface information and verifying an instruction operation result according to an identification result, where the instruction operation result includes that the instruction operation is successful, includes:
acquiring target interface information corresponding to the current interface information; the target interface information is used for representing the interface information after the terminal equipment successfully completes the operation instruction;
analyzing the current interface information, and comparing the current interface information with the target interface information;
when the current interface information is consistent with the target interface information, determining that the instruction operation result is accurate, and determining that the target software is tested successfully;
and when the current interface information is inconsistent with the target interface information, determining that the instruction operation result is inaccurate, and determining that the target software fails to test.
The software testing method provided by the embodiment of the invention obtains the target interface information corresponding to the current interface information, and ensures the accuracy of the target interface information corresponding to the obtained current interface information. Then, the current interface information is analyzed, and the current interface information is compared with the target interface information, so that the accuracy of the comparison result of the obtained current interface information and the target interface information is ensured. When the current interface information is consistent with the target interface information, determining that the instruction operation result is accurate, and determining that the target software is tested successfully; when the current interface information is inconsistent with the target interface information, the instruction operation result is determined to be inaccurate, the target software test is determined to fail, and the accuracy of the obtained test result of the target software is ensured.
With reference to the first implementation manner of the first aspect, in a second implementation manner of the first aspect, the instruction operation result includes an instruction operation failure, and the method further includes:
when the current interface information is consistent with the target interface information, determining that the instruction operation result is inaccurate, and determining that the target software fails to test;
and when the current interface information is inconsistent with the target interface information, determining that the instruction operation result is accurate, and determining that the target software fails to test.
According to the software testing method provided by the embodiment of the invention, when the current interface information is consistent with the target interface information, the instruction operation result is determined to be inaccurate, and the target software is determined to fail to test; when the current interface information is inconsistent with the target interface information, the instruction operation result is determined to be accurate, the target software test failure is determined, and the accuracy of the test result corresponding to the determined target software is ensured.
With reference to the second implementation manner of the first aspect, in a third implementation manner of the first aspect, after the operation instruction for the target software is sent to each terminal device, the method further includes:
sending a screen recording instruction to each terminal device, wherein the screen recording instruction is used for instructing each terminal device to perform screen recording and screen capture when executing an operation instruction;
and receiving a screen recording video and a screenshot image sent by the terminal equipment.
According to the software testing method provided by the embodiment of the invention, the screen recording instruction is sent to each terminal device, the screen recording instruction is used for indicating each terminal device to perform screen recording and screen capture when executing the operation instruction, and the screen recording video and the screen capture image sent by the terminal device are received, so that the electronic device can be ensured to trace the process of finishing the operation instruction by the terminal device according to the screen recording video and the screen capture image.
With reference to the third implementation manner of the first aspect, in a fourth implementation manner of the first aspect, after determining that the target software test fails, the method further includes:
identifying the screen recording video and the screenshot image;
determining the whole process of finishing the operation instruction by each terminal device according to the identification result;
and analyzing the whole process and determining the reason of the failure of the target software test.
The software testing method provided by the embodiment of the invention identifies the screen recording video and the screenshot image, determines the whole process of finishing the operation instruction by each terminal device according to the identification result, and ensures the accuracy of the determined whole process of finishing the operation instruction by each terminal device. The whole process is analyzed, the reason of the target software test failure is determined, and the accuracy of the determined reason of the target software test failure is guaranteed.
With reference to the fourth implementation manner of the first aspect, in the fifth implementation manner of the first aspect, analyzing the whole process to determine the reason for the failure of the target software test includes:
analyzing the whole process, and determining interface characteristics, running time and interface element attribute information corresponding to each step when the terminal equipment executes an operation instruction;
and analyzing the interface characteristics, the running time and the interface element attribute information to determine the reason of the test failure of the target software.
The software testing method provided by the embodiment of the invention analyzes the whole process, determines the interface characteristic, the running time and the interface element attribute information corresponding to each step of the terminal equipment when executing the operation instruction, and ensures the accuracy of the interface characteristic, the running time and the interface element attribute information corresponding to each step of the determined terminal equipment when executing the operation instruction. And then, analyzing the interface characteristics, the running time and the interface element attribute information to determine the reason of the target software test failure, thereby ensuring the accuracy of the determined reason of the target software test failure.
With reference to the first aspect, in a sixth implementation manner of the first aspect, the method further includes:
obtaining a test result of target software corresponding to each terminal device;
analyzing the test result of the target software corresponding to each terminal device to generate a sub-target software test report corresponding to each terminal device;
and splicing and aggregating the sub-target software test reports corresponding to each terminal device to generate a total target software test report, and displaying the total target software test report.
The software testing method provided by the embodiment of the invention obtains the testing result of the target software corresponding to each terminal device, analyzes the testing result of the target software corresponding to each terminal device, generates the sub-target software testing report corresponding to each terminal device, and ensures the accuracy of the generated sub-target software testing report corresponding to each terminal device. And splicing and aggregating the sub-target software test reports corresponding to each terminal device to generate a total target software test report, and displaying the total target software test report, so that the accuracy of the generated total target software test report is ensured, and a user can more intuitively obtain the total target software test report.
According to a second aspect, an embodiment of the present invention further provides a software testing apparatus, including:
the first acquisition module is used for acquiring at least one terminal device connected with the electronic device and controlling each terminal device to open the target software;
the first sending module is used for sending an operation instruction aiming at the target software to each terminal device and receiving an instruction operation result returned by each terminal device;
the second acquisition module is used for acquiring current interface information corresponding to each terminal device;
and the first determining module is used for analyzing the current interface information and verifying the instruction operation result according to the identification result so as to determine the test result of the target software.
The software testing device provided by the embodiment of the invention obtains at least one terminal device connected with the electronic device, and shows that the electronic device can be simultaneously connected with a plurality of electronic devices, so that the target software in the plurality of terminal devices can be tested. Then, the electronic device controls each terminal device to open the target software, and sends an operation instruction for the target software to each terminal device, so that each terminal device can receive the operation instruction sent by the electronic device and perform operation based on the received operation instruction. And then, the electronic equipment receives the instruction operation result returned by each terminal equipment, and then acquires the current interface information corresponding to each terminal equipment. The electronic equipment analyzes the current interface information and verifies the instruction operation result according to the identification result so as to determine the test result of the target software, thereby ensuring the accuracy of the determined test result of the target software. According to the software testing device, a tester does not need to test the target software on each terminal device, so that the software testing efficiency is improved, a large amount of manpower, material resources and financial resources are saved, and the automatic compatibility test and normal business process test on the target software are realized.
According to a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory and a processor, where the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions, so as to execute the software testing method in the first aspect or any one of the implementation manners of the first aspect.
According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the software testing method of the first aspect or any one of the implementation manners of the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a software testing method provided by an embodiment of the invention;
FIG. 2 is a flow chart of a software testing method provided by another embodiment of the invention;
FIG. 3 is a flow chart of a software testing method provided by another embodiment of the invention;
fig. 4 is a schematic diagram of an intelligent device control platform provided by another embodiment of the invention;
FIG. 5 is a functional block diagram of a software testing apparatus provided by an embodiment of the present invention;
FIG. 6 is a functional block diagram of a software testing apparatus provided by an embodiment of the present invention;
FIG. 7 is a functional block diagram of a software testing apparatus provided by an embodiment of the present invention;
FIG. 8 is a functional block diagram of a software testing apparatus provided by an embodiment of the present invention;
fig. 9 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that in the software testing method provided in this embodiment of the present application, an execution main body of the software testing method may be a software testing device, and the software testing device may be implemented in a software, hardware, or a combination of software and hardware to become part or all of an electronic device, where the electronic device may be a server or a terminal, where the server in this embodiment of the present application may be one server or a server cluster composed of multiple servers, and the terminal in this embodiment of the present application may be another intelligent hardware device such as a smart phone, a personal computer, a tablet computer, a wearable device, and an intelligent robot. In the following method embodiments, the execution subject is an electronic device as an example.
In an embodiment of the present application, as shown in fig. 1, a software testing method is provided, which is described by taking an example that the method is applied to an electronic device, and includes the following steps:
s11, at least one terminal device connected with the electronic device is obtained, and each terminal device is controlled to open the target software.
In an optional implementation manner of the present application, the electronic device may be connected to each terminal device based on a local area network, and therefore, the electronic device may send response information to each terminal device in a broadcast manner, and after receiving feedback information returned by each terminal device based on the received response information, the electronic device determines at least one terminal device connected to the electronic device.
In another optional embodiment of the present application, the electronic device may be connected to each terminal device based on the connection line, and then send response information to each terminal device based on the connection line, and after receiving feedback information returned by each terminal device based on the received response information, the electronic device determines at least one terminal device connected to the electronic device.
In an optional implementation manner of the present application, after determining each terminal device connected to the electronic device, before controlling each terminal device to open the target software, the electronic device may send a detection instruction for detecting whether the target software is installed to each terminal device, and after receiving the detection instruction, the terminal device detects whether the target software is installed. When the terminal equipment does not install the target software, installing the target software; after the terminal devices complete installation of the target software, the electronic device may control the respective terminal devices to open the target software based on the adb command.
The target software may be an application installed in the terminal device, or may be other software, and the target software is not specifically limited in this embodiment of the present application.
And S12, sending an operation instruction aiming at the target software to each terminal device, and receiving an instruction operation result returned by each terminal device.
Specifically, after the electronic device determines that each terminal device opens the target software, the electronic device may send an operation instruction for the target software to each terminal device based on the connection relationship between the electronic device and each terminal device.
The operation instruction may include a click operation, a slide operation, a property operation of a read and set control, a determination of whether an element has an operation, a drag operation, a detection section offset and external offset operation, an event waiting operation, and the like. The embodiment of the application is not particularly limited to that the electronic device can send the operation instruction aiming at the target software to each terminal device.
After receiving the operation instruction, which is sent by the electronic device and is specific to the target software, the terminal device may complete corresponding operations according to the operation instruction, and send the instruction operation result to the electronic device. Therefore, the electronic equipment can receive the instruction operation result returned by each terminal equipment.
And S13, acquiring current interface information corresponding to each terminal device.
Specifically, after the electronic device receives the instruction operation result returned by each terminal device, the electronic device may obtain current interface information of the target software corresponding to each terminal device based on the connection with each terminal device.
And S14, analyzing the current interface information, and verifying the instruction operation result according to the identification result to determine the test result of the target software.
Specifically, after acquiring the current interface information of the target software corresponding to each terminal device, the electronic device may analyze the current interface information, and determine the identification information corresponding to the current interface included in the current interface information and attribute information such as the position, shape, color, and the like of each element in the current interface. And then, the electronic equipment judges whether the instruction operation result returned by the terminal equipment is accurate according to the result corresponding to the identified current interface information, and determines the test result of the target software according to the obtained instruction operation result.
For example, it is assumed that an operation instruction sent by the electronic device to the terminal device is a rightward sliding operation, after receiving the operation instruction, the terminal device completes an operation corresponding to the operation instruction, and after the operation instruction is completed, returns an instruction operation result to the electronic device. After receiving the instruction operation result returned by the terminal equipment, the electronic equipment acquires current interface information corresponding to target software in the terminal equipment, then carries out identification analysis on the current interface information, and determines whether the current interface information is an interface which should be displayed by the target software after the electronic equipment completes the operation instruction, so as to judge whether the instruction operation result returned by the terminal equipment is accurate, and determines the test result of the target software according to the acquired instruction operation result.
It should be noted that, the foregoing embodiment is only an example for the rightward sliding operation, and other operation instructions are the same, and are not described again in the embodiment of the present application.
According to the software testing method provided by the embodiment of the invention, at least one terminal device connected with the electronic device is obtained, which indicates that the electronic device can be simultaneously connected with a plurality of electronic devices, so that the target software in the plurality of terminal devices can be tested. Then, the electronic device controls each terminal device to open the target software, and sends an operation instruction for the target software to each terminal device, so that each terminal device can receive the operation instruction sent by the electronic device and operate based on the received operation instruction. And then, the electronic equipment receives the instruction operation result returned by each terminal equipment, and then acquires the current interface information corresponding to each terminal equipment. The electronic equipment analyzes the current interface information and verifies the instruction operation result according to the identification result so as to determine the test result of the target software, thereby ensuring the accuracy of the determined test result of the target software. According to the software testing method, a tester is not required to test the target software on each terminal device, so that the software testing efficiency is improved, a large amount of manpower, material resources and financial resources are saved, and the automatic compatibility test and normal business process test on the target software are realized.
In an embodiment of the present application, as shown in fig. 2, a software testing method is provided, which is described by taking an example that the method is applied to an electronic device, and includes the following steps:
s21, acquiring at least one terminal device connected with the electronic device, and controlling each terminal device to open the target software.
For this step, please refer to fig. 1 for description of S11, which is not described herein.
And S22, sending an operation instruction aiming at the target software to each terminal device, and receiving an instruction operation result returned by each terminal device.
Please refer to fig. 1 for an introduction of S12 for this step, which is not described herein.
And S23, sending a screen recording instruction to each terminal device.
The screen recording instruction is used for instructing each terminal device to perform screen recording and screen capture when executing the operation instruction.
Specifically, after the electronic device sends an operation instruction for the target software to each terminal device, the electronic device may send a screen recording instruction to each terminal device again based on the connection with each terminal device.
In an optional implementation manner of the present application, the electronic device may further send an operation instruction and a screen recording instruction for the target software to the terminal device simultaneously based on the connection with the terminal device.
And S24, receiving the screen recording video and the screenshot image sent by the terminal equipment.
Specifically, after each terminal device completes the operation instruction and performs screen recording and screen capture on the whole operation instruction completion process, the screen recording video and the screen capture image are sent to the electronic device, so that the electronic device can receive the screen recording video and the screen capture image sent by the terminal device.
And S25, acquiring current interface information corresponding to each terminal device.
Please refer to fig. 1 for an introduction of S13, which is not described herein.
And S26, analyzing the current interface information, and verifying the instruction operation result according to the identification result to determine the test result of the target software.
In an optional implementation manner of the present application, the instruction operation result includes that the instruction operation is successful, and the step S26 "analyze the current interface information and verify the instruction operation result according to the recognition result" may include the following steps:
s261, target interface information corresponding to the current interface information is obtained.
The target interface information is used for representing the interface information after the terminal equipment successfully completes the operation instruction.
Optionally, after the current interface information is obtained, the electronic device may receive target interface information corresponding to the current interface information input by the user, or may search and obtain the target interface information corresponding to the current interface information from a storage medium of the electronic device. The method for acquiring the target interface information corresponding to the current interface information by the electronic device is not particularly limited in the embodiment of the application.
And S262, analyzing the current interface information, and comparing the current interface information with the target interface information.
Specifically, after the current interface information and the target interface information corresponding to the current interface information are obtained, the electronic device may analyze the current interface information and the target interface information corresponding to the current interface information, compare the identification information corresponding to the current interface information and the identification information corresponding to the target interface, and compare each element included in the current interface information with the corresponding element included in the target interface.
And S263, when the current interface information is consistent with the target interface information, determining that the instruction operation result is accurate, and determining that the target software is tested successfully.
Specifically, when the instruction operation result sent by the terminal device is that the instruction operation is successful and the electronic device determines that the current interface information is consistent with the target interface information, the electronic device determines that the instruction operation result sent by the terminal device is accurate and determines that the target software test result corresponding to the terminal device is successful.
And S264, when the current interface information is inconsistent with the target interface information, determining that the instruction operation result is inaccurate, and determining that the target software fails to test.
Specifically, when the instruction operation result sent by the terminal device is that the instruction operation is successful and the electronic device determines that the current interface information is inconsistent with the target interface information, the electronic device determines that the instruction operation result sent by the terminal device is inaccurate and determines that the target software test result corresponding to the terminal device is a test failure.
In an optional implementation manner of the present application, the instruction operation result includes an instruction operation failure, and therefore, the software testing method further includes the following steps:
and S265, when the current interface information is consistent with the target interface information, determining that the instruction operation result is inaccurate, and determining that the target software fails to be tested.
Specifically, when the instruction operation result sent by the terminal device is an instruction operation failure and the electronic device determines that the current interface information is consistent with the target interface information, the electronic device determines that the instruction operation result sent by the terminal device is inaccurate and determines that the target software test result corresponding to the terminal device is a test failure.
And S266, when the current interface information is inconsistent with the target interface information, determining that the instruction operation result is accurate, and determining that the target software fails to test.
Specifically, when the instruction operation result sent by the terminal device is an instruction operation failure and the electronic device determines that the current interface information is inconsistent with the target interface information, the electronic device determines that the instruction operation result sent by the terminal device is accurate, but determines that the target software test result corresponding to the terminal device is a test failure.
For example, it is assumed that an operation instruction sent by the electronic device to the terminal device is a rightward sliding operation, after receiving the operation instruction, the terminal device completes an operation corresponding to the operation instruction, and after the operation instruction is completed, returns an instruction operation result to the electronic device. After receiving an instruction operation result returned by the terminal device, the electronic device acquires current interface information corresponding to target software in the terminal device, then acquires target interface information corresponding to the current interface information, analyzes the current interface information, and compares identification information corresponding to a current interface and attribute information of the position, shape, color and the like of each element in the current interface included in the current interface information with identification information corresponding to a target interface and attribute information of the position, shape, color and the like of each element in the target interface included in the target interface information.
When the instruction operation result returned by the terminal equipment is that the instruction operation is successful, and when the electronic equipment determines that the current interface information is consistent with the target interface information, the electronic equipment determines that the instruction operation result returned by the terminal equipment is accurate, and determines that the target software is tested successfully. And when the electronic equipment determines that the current interface information is inconsistent with the target interface information, the electronic equipment determines that the instruction operation result returned by the terminal equipment is inaccurate, and determines that the target software test fails.
When the instruction operation result returned by the terminal equipment is instruction operation failure, and when the electronic equipment determines that the current interface information is consistent with the target interface information, the electronic equipment determines that the instruction operation result returned by the terminal equipment is not accurate, and determines that the target software test fails. And when the electronic equipment determines that the current interface information is inconsistent with the target interface information, the electronic equipment determines that the instruction operation result returned by the terminal equipment is inaccurate, and determines that the target software fails to be tested.
It should be noted that, the above embodiments are only examples of the rightward sliding operation, and other operation instructions are the same, and are not described again in the embodiments of the present application.
In an optional embodiment of the present application, after determining that the target software fails to be tested, the software testing method further includes the following steps:
and S27, identifying the screen recording video and the screenshot image.
Specifically, after the electronic device determines that the target software corresponding to the terminal device fails to be tested, the electronic device may obtain a screen recording video and a screenshot image corresponding to the terminal device. The electronic device can then identify the screen-recorded video and the screenshot image using image recognition technology or deep learning technology.
And S28, determining that each terminal device completes the whole process of the operation instruction according to the identification result.
Specifically, after the electronic device identifies the screen recording video and the screenshot image, the whole process of finishing the operation instruction by each terminal device can be determined according to the identification result.
And S29, analyzing the whole process and determining the reason of the test failure of the target software.
In an optional embodiment of the present application, the step S29 "analyzing the whole process to determine the reason for the failure of the target software test" may include the following steps:
and S291, analyzing the whole process, and determining interface characteristics, running time and interface element attribute information corresponding to each step of the terminal equipment when executing the operation instruction.
Specifically, after the electronic device determines that each terminal device completes the whole process of the operation instruction, the electronic device may analyze the whole process of the operation instruction completed by the terminal device, and determine the interface characteristics, the operation time, and the interface element attribute information corresponding to each step when the terminal device executes the operation instruction. The interface features may be used to ensure identification information of the interface, and the interface element attribute information may include attribute information corresponding to each element in the interface.
And S292, analyzing the interface characteristics, the running time and the interface element attribute information, and determining the reason of the test failure of the target software.
Specifically, after determining the interface feature, the runtime, and the interface element attribute information corresponding to each step of the terminal device when executing the operation instruction, the electronic device may analyze the interface feature, the runtime, and the interface element attribute information to determine a reason why the target software fails in the test.
According to the software testing method provided by the embodiment of the invention, the target interface information corresponding to the current interface information is obtained, and the accuracy of the target interface information corresponding to the obtained current interface information is ensured. Then, the current interface information is analyzed, and the current interface information is compared with the target interface information, so that the accuracy of the comparison result of the obtained current interface information and the target interface information is ensured. When the current interface information is consistent with the target interface information, determining that the instruction operation result is accurate, and determining that the target software is tested successfully; when the current interface information is consistent with the target interface information, the instruction operation result is determined to be inaccurate, the target software test failure is determined, and the accuracy of the obtained test result of the target software is ensured. When the current interface information is consistent with the target interface information, determining that the instruction operation result is inaccurate, and determining that the target software fails to test; when the current interface information is consistent with the target interface information, the instruction operation result is determined to be accurate, the target software test failure is determined, and the accuracy of the test result corresponding to the determined target software is ensured.
In addition, after the operation instruction aiming at the target software is sent to each terminal device, the electronic device can send a screen recording instruction to each terminal device, the screen recording instruction is used for indicating each terminal device to record a screen and capture a screen when the operation instruction is executed, and a screen recording video and a screen capture image sent by the terminal device are received, so that the electronic device can trace the process of finishing the operation instruction by the terminal device according to the screen recording video and the screen capture image.
In addition, after the target software is determined to fail to be tested, the electronic equipment can identify the screen recording video and the screenshot image, and the whole process that each terminal equipment completes the operation instruction is determined according to the identification result, so that the accuracy of the whole process that each determined terminal equipment completes the operation instruction is guaranteed. The whole process is analyzed, the interface characteristic, the running time and the interface element attribute information corresponding to each step of the terminal equipment when the terminal equipment executes the operation instruction are determined, and the accuracy of the interface characteristic, the running time and the interface element attribute information corresponding to each step of the determined terminal equipment when the terminal equipment executes the operation instruction is guaranteed. And then, analyzing the interface characteristics, the running time and the interface element attribute information to determine the reason of the target software test failure, thereby ensuring the accuracy of the determined reason of the target software test failure.
In an embodiment of the present application, as shown in fig. 3, a software testing method is provided, which is described by taking an example that the method is applied to an electronic device, and includes the following steps:
and S31, acquiring at least one terminal device connected with the electronic device, and controlling each terminal device to open the target software.
For this step, please refer to the description of S21 in fig. 2, which is not described herein.
And S32, sending an operation instruction aiming at the target software to each terminal device, and receiving an instruction operation result returned by each terminal device.
Please refer to the description of S22 in fig. 2 for this step, which is not repeated herein.
And S33, acquiring current interface information corresponding to each terminal device.
For this step, please refer to the description of S25 in fig. 2, which is not described herein.
And S34, analyzing the current interface information, and verifying the instruction operation result according to the identification result to determine the test result of the target software.
For this step, please refer to the description of S26 in fig. 2, which is not described herein.
And S35, obtaining the test result of the target software corresponding to each terminal device.
Specifically, after the electronic device determines the test result of the target software, the electronic device may obtain the test result of the target software corresponding to each terminal device.
And S36, analyzing the test result of the target software corresponding to each terminal device, and generating a sub-target software test report corresponding to each terminal device.
Specifically, after the electronic device obtains the test result of the target software corresponding to each terminal device, the electronic device may analyze the test result of the target software corresponding to each terminal device, and generate a sub-target software test report corresponding to each terminal device.
And S37, splicing and aggregating the sub-target software test reports corresponding to each terminal device to generate a total target software test report, and displaying the total target software test report.
Specifically, after the electronic device generates the sub-target software test reports corresponding to each terminal device, the electronic device may perform splicing and aggregation processing on the sub-target software test reports corresponding to each terminal device, generate a total target software test report, and display the total target software test report.
For example, it is assumed that the electronic device is connected to 10 terminal devices, and therefore, 10 sub-target software test reports may be generated, and the electronic device may splice and aggregate the 10 sub-target software test reports to generate a total target software test report, where the total target software test report includes 10 sub-target software test reports. The electronic equipment can display the total target software test report to a user through the display equipment, can receive a report display instruction input by the user, and can display specific report contents in at least one sub-target software test report in the total target software test report.
The software testing method provided by the embodiment of the invention acquires the testing result of the target software corresponding to each terminal device, analyzes the testing result of the target software corresponding to each terminal device, generates the sub-target software testing report corresponding to each terminal device, and ensures the accuracy of the generated sub-target software testing report corresponding to each terminal device. And splicing and aggregating the sub-target software test reports corresponding to each terminal device to generate a total target software test report, and displaying the total target software test report, so that the accuracy of the generated total target software test report is ensured, and a user can obtain the total target software test report more intuitively.
In order to better describe the software testing method provided by the embodiment of the present application, as shown in fig. 4, the embodiment of the present application provides an intelligent device control platform. The intelligent equipment control platform comprises platform building, script compiling, intelligent analysis, cluster management and cluster construction. The platform is built for generating an automatic test scheme, and the automatic test scheme comprises a timing test task, a regression test task and an equipment compatibility test task; compiling scripts for resource unified management, wherein the scripts comprise application packages, test scripts, test cases, accounts and equipment resources; the intelligent analysis is used for analyzing the automatic report, and comprises report summarization, a performance report, an error report, a screen recording and a script log; the cluster management is used for devicekeepers and comprises cluster management, remote maintenance, batch control, intelligent power control and remote real machines; the cluster construction is used for real machine cluster construction and comprises android real machine cluster construction and IOS real machine cluster construction.
It should be understood that although the various steps in the flow charts of fig. 1-3 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 described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-3 may include multiple 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 in turn or alternately with other steps or at least some of the other steps.
As shown in fig. 5, the present embodiment provides a software testing apparatus, including:
a first obtaining module 41, configured to obtain at least one terminal device connected to an electronic device, and control each terminal device to open target software;
a first sending module 42, configured to send an operation instruction for the target software to each terminal device, and receive an instruction operation result returned by each terminal device;
a second obtaining module 43, configured to obtain current interface information corresponding to each terminal device;
and the first determining module 44 is configured to analyze the current interface information, and verify the instruction operation result according to the identification result to determine a test result of the target software.
In an embodiment of the present application, the instruction operation result includes that the instruction operation is successful, and the first determining module 44 is specifically configured to obtain target interface information corresponding to the current interface information; the target interface information is used for representing the interface information after the terminal equipment successfully completes the operation instruction; analyzing the current interface information, and comparing the current interface information with the target interface information; when the current interface information is consistent with the target interface information, determining that the instruction operation result is accurate, and determining that the target software is tested successfully; and when the current interface information is inconsistent with the target interface information, determining that the instruction operation result is inaccurate, and determining that the target software fails to test.
In an embodiment of the present application, the instruction operation result includes an instruction operation failure, and the first determining module 44 is specifically configured to determine that the instruction operation result is inaccurate and determine that the target software test fails when the current interface information is consistent with the target interface information; and when the current interface information is inconsistent with the target interface information, determining that the instruction operation result is accurate, and determining that the target software fails to test.
As shown in fig. 6, in an embodiment of the present application, the software testing apparatus further includes:
a second sending module 45, configured to send a screen recording instruction to each terminal device, where the screen recording instruction is used to instruct each terminal device to perform screen recording and screenshot when executing an operation instruction;
and the receiving module 46 is configured to receive the screen recording video and the screenshot image sent by the terminal device.
As shown in fig. 7, in an embodiment of the present application, the software testing apparatus further includes:
the recognition module 47 is configured to recognize a screen recording video and a screenshot image;
a second determining module 48, configured to determine, according to the identification result, that each terminal device completes the whole process of the operation instruction;
and the third determining module 49 is used for analyzing the whole process and determining the reason of the test failure of the target software.
In an embodiment of the present application, the third determining module 49 is specifically configured to analyze the whole process, and determine interface characteristics, running time, and interface element attribute information corresponding to each step when the terminal device executes the operation instruction; and analyzing the interface characteristics, the running time and the interface element attribute information to determine the reason of the test failure of the target software.
As shown in fig. 8, in an embodiment of the present application, the software testing apparatus further includes:
a third obtaining module 410, configured to obtain a test result of the target software corresponding to each terminal device;
the generating module 411 is configured to analyze a test result of the target software corresponding to each terminal device, and generate a sub-target software test report corresponding to each terminal device;
and the display module 412 is configured to perform splicing and aggregation processing on the sub-target software test reports corresponding to each terminal device, generate a total target software test report, and display the total target software test report.
For the specific limitations and beneficial effects of the software testing apparatus, reference may be made to the limitations of the software testing method described above, and details are not described herein again. The modules in the software testing device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the electronic device, or can be stored in a memory in the electronic device in a software form, so that the processor can call and execute operations corresponding to the modules.
An embodiment of the present invention further provides an electronic device, which has the software testing apparatus shown in fig. 5 to 8.
As shown in fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an alternative embodiment of the present invention, and as shown in fig. 9, the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, memory 54, at least one communication bus 52. Wherein a communication bus 52 is used to enable the connection communication between these components. The communication interface 53 may include a Display (Display) and a Keyboard (Keyboard), and the optional communication interface 53 may also include a standard wired interface and a standard wireless interface. The Memory 54 may be a high-speed RAM Memory (volatile Random Access Memory) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The memory 54 may alternatively be at least one memory device located remotely from the processor 51. Wherein the processor 51 may be combined with the apparatus described in fig. 5, 6, 7 and 8, the memory 54 stores an application program, and the processor 51 calls the program code stored in the memory 54 for executing any of the above method steps.
The communication bus 52 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 52 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. 9, but this does not indicate only one bus or one type of bus.
The memory 54 may include a volatile memory (RAM), such as a random-access memory (RAM); the memory may also include a non-volatile memory (english: flash memory), such as a Hard Disk Drive (HDD) or a solid-state drive (SSD); the memory 54 may also comprise a combination of the above types of memories.
The processor 51 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP.
The processor 51 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
Optionally, the memory 54 is also used to store program instructions. The processor 51 may call program instructions to implement the software testing method as shown in the embodiments of fig. 1 to 3 of the present application.
The embodiment of the invention also provides a non-transitory computer storage medium, wherein the computer storage medium stores computer executable instructions which can execute the software testing method in any method embodiment. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk Drive (Hard Disk Drive, abbreviated as HDD), or a Solid State Drive (SSD); the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. A software testing method, comprising:
acquiring at least one terminal device connected with an electronic device, and controlling each terminal device to open target software;
sending an operation instruction aiming at the target software to each terminal device, and receiving an instruction operation result returned by each terminal device;
acquiring current interface information corresponding to each terminal device;
and analyzing the current interface information, and verifying the instruction operation result according to the identification result to determine the test result of the target software.
2. The method of claim 1, wherein the instruction operation result comprises an instruction operation success, wherein analyzing the current interface information and verifying the instruction operation result according to the recognition result comprises:
acquiring target interface information corresponding to the current interface information; the target interface information is used for representing the interface information after the terminal equipment successfully completes the operation instruction;
analyzing the current interface information, and comparing the current interface information with the target interface information;
when the current interface information is consistent with the target interface information, determining that the instruction operation result is accurate, and determining that the target software is tested successfully;
and when the current interface information is inconsistent with the target interface information, determining that the instruction operation result is inaccurate, and determining that the target software fails to test.
3. The method of claim 2, wherein the instruction operation result comprises an instruction operation failure, the method further comprising:
when the current interface information is consistent with the target interface information, determining that the instruction operation result is inaccurate, and determining that the target software fails to test;
and when the current interface information is inconsistent with the target interface information, determining that the instruction operation result is accurate, and determining that the target software fails to test.
4. The method according to claim 3, wherein after the sending of the operation instruction for the target software to each of the terminal devices, the method further comprises:
sending a screen recording instruction to each terminal device, wherein the screen recording instruction is used for instructing each terminal device to perform screen recording and screen capture when the terminal device executes the operation instruction;
and receiving the screen recording video and the screenshot image sent by the terminal equipment.
5. The method of claim 4, wherein after the determining that the target software test failed, the method further comprises:
identifying the screen recording video and the screenshot image;
determining that each terminal device completes the whole process of the operation instruction according to the identification result;
and analyzing the whole process to determine the reason of the failure of the target software test.
6. The method of claim 5, wherein analyzing the overall process to determine the reason for the failure of the target software test comprises:
analyzing the whole process, and determining interface characteristics, running time and interface element attribute information corresponding to each step of the terminal equipment when executing the operation instruction;
analyzing the interface characteristics, the running time and the interface element attribute information, and determining the reason of the target software test failure.
7. The method of claim 1, further comprising:
obtaining a test result of the target software corresponding to each terminal device;
analyzing the test result of the target software corresponding to each terminal device to generate a sub-target software test report corresponding to each terminal device;
and splicing and aggregating the sub-target software test reports corresponding to the terminal equipment to generate a total target software test report, and displaying the total target software test report.
8. A software testing apparatus, comprising:
the first acquisition module is used for acquiring at least one terminal device connected with the electronic device and controlling each terminal device to open target software;
the first sending module is used for sending an operation instruction aiming at the target software to each terminal device and receiving an instruction operation result returned by each terminal device;
the second acquisition module is used for acquiring current interface information corresponding to each terminal device;
and the first determining module is used for analyzing the current interface information and verifying the instruction operation result according to the identification result so as to determine the test result of the target software.
9. An electronic device comprising a memory having computer instructions stored therein and a processor that executes the computer instructions to perform the software testing method of any one of claims 1-7.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the software testing method of any one of claims 1-7.
CN202211284345.5A 2022-10-19 2022-10-19 Software testing method and device, electronic equipment and storage medium Pending CN115599674A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211284345.5A CN115599674A (en) 2022-10-19 2022-10-19 Software testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211284345.5A CN115599674A (en) 2022-10-19 2022-10-19 Software testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115599674A true CN115599674A (en) 2023-01-13

Family

ID=84848893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211284345.5A Pending CN115599674A (en) 2022-10-19 2022-10-19 Software testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115599674A (en)

Similar Documents

Publication Publication Date Title
CN106844217B (en) Method and device for embedding point of applied control and readable storage medium
US20210011840A1 (en) Software testing method, system, apparatus, device medium, and computer program product
US20140211021A1 (en) Test system for evaluating mobile device and driving method thereof
CN110765026B (en) Automatic test method, device, storage medium and equipment
CN109885480B (en) Automatic interface compatibility testing method and device based on debugging bridge
CN112463580A (en) Test system and method based on virtualization device
CN112463467B (en) Automated integrated test system and method thereof
US20200364133A1 (en) Analyzing time-series data in an automated application testing system
CN113778898A (en) User interface automatic testing method and device, electronic equipment and storage medium
CN111414309B (en) Automatic test method of application program, computer equipment and storage medium
CN111475412B (en) Software testing method, device, electronic equipment and computer readable storage medium
CN111198797B (en) Operation monitoring method and device and operation analysis method and device
CN116166525A (en) Method and device for generating test script
CN115658529A (en) Automatic testing method for user page and related equipment
CN112231206A (en) Script editing method for application program test, computer readable storage medium and test platform
CN116069571A (en) Storage device performance automatic test method, device, equipment and storage medium
CN117421217A (en) Automatic software function test method, system, terminal and medium
CN115599674A (en) Software testing method and device, electronic equipment and storage medium
CN115422091A (en) Firmware debugging method and device, electronic equipment and storage medium
CN115599683A (en) Automatic testing method, device, equipment and storage medium
CN115422052A (en) Vehicle navigation app test system and method
CN116932360A (en) Page testing method and device, computer equipment and storage medium
CN108845932B (en) Unit testing method and device of network library, storage medium and terminal
CN111522742A (en) Page view generating method and device, computer equipment and storage medium
CN112286753B (en) Method, device, server and storage medium for testing image processing accuracy

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