CN113553261B - Software automated testing method, device and computer readable storage medium - Google Patents

Software automated testing method, device and computer readable storage medium Download PDF

Info

Publication number
CN113553261B
CN113553261B CN202110828791.7A CN202110828791A CN113553261B CN 113553261 B CN113553261 B CN 113553261B CN 202110828791 A CN202110828791 A CN 202110828791A CN 113553261 B CN113553261 B CN 113553261B
Authority
CN
China
Prior art keywords
test
interface
software
comparison
target interface
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.)
Active
Application number
CN202110828791.7A
Other languages
Chinese (zh)
Other versions
CN113553261A (en
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.)
SAIC GM Wuling Automobile Co Ltd
Original Assignee
SAIC GM Wuling Automobile 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 SAIC GM Wuling Automobile Co Ltd filed Critical SAIC GM Wuling Automobile Co Ltd
Priority to CN202110828791.7A priority Critical patent/CN113553261B/en
Publication of CN113553261A publication Critical patent/CN113553261A/en
Application granted granted Critical
Publication of CN113553261B publication Critical patent/CN113553261B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The invention discloses a software automatic test method, which is based on an image recognition technology, and is used for positioning a target control of a software interface, guiding a test process and obtaining a test result. And the mechanical point touch pen is matched to operate a car machine or a mobile phone screen, so that automatic testing of car and software and mobile phone software is realized. The invention also discloses a test device and a computer readable storage medium. The invention can realize the continuous test of the automatic test based on the image recognition technology in the whole day, improves the test efficiency, reduces the labor investment, reduces the cost and increases the efficiency, is more sensitive to the change of a software interface, and can not generate the beneficial effect of data loss caused by the visual fatigue of the manual test by capturing the interface dynamic in real time.

Description

Software automated testing method, device and computer readable storage medium
Technical Field
The present invention relates to the field of automated testing, and in particular, to a method and apparatus for automatically testing software, and a computer readable storage medium.
Background
At present, the interconnection of the vehicle and the mobile phone not only enables the functions of the vehicle to be more and more, but also causes the related functions of mobile phone software to be more and more, the intelligent network test items to be more and more complex, the manual test is still relied on under most conditions, and the problems often limit the normal running of the automatic test.
Disclosure of Invention
The invention mainly aims to provide a software automatic testing method, software automatic testing equipment and a computer readable storage medium, and aims to solve the technical problems that the traditional testing period is long, the testing process and the testing time are difficult to control, the human resources are large in investment, and human errors are easily caused by long-term testing.
In order to achieve the above object, the present invention provides a software automation test method, which includes:
the method comprises the steps that a target interface of each testing step is obtained in advance according to testing requirements before testing, and template information in the target interface is obtained;
acquiring an actual interface during testing, and judging whether the actual interface passes the test relative to a target interface according to the template information;
if the test is passed, the preset reference position of the template to be operated is obtained to guide the next test operation.
Optionally, the step of pre-acquiring the target interface of each test step includes:
gray measurement is carried out on pictures acquired by the image acquisition equipment according to the test requirement, and a screen area is automatically selected as a target interface in a frame mode;
or when the acquired picture is insufficient to support automatic frame selection, modifying frame selection parameters or adjusting the acquisition environment based on the operation instruction, and then re-acquiring the picture for frame selection so as to select a screen area as a target interface.
Optionally, the step of obtaining template information in the target interface includes:
intercepting one or more interface elements used for identifying the target interface on the target interface as templates of the target interface, and acquiring template information of the templates used for describing the target interface.
Optionally, the template information includes:
one or more of the size, shape, coordinates, gray values of the templates and the positional relationship between the respective templates.
Optionally, the step of judging whether the test passed by the actual interface relative to the target interface according to the template information includes:
comparing interface elements of the actual interface with the template, wherein the more the interface element information of the actual interface is matched with the template information, the higher the similarity between the actual interface and the target interface is;
if the similarity is greater than the comparison threshold, judging that the test is passed;
and if the similarity is smaller than or equal to the comparison threshold value, judging that the test is not passed.
Optionally, if the similarity is greater than the comparison threshold, the step of determining that the test passes further includes:
if the similarity is larger than the comparison threshold, acquiring response time, wherein the response time is the time from the starting to the displaying of the actual interface;
if the response time is smaller than the preset maximum response time, judging that the test is passed;
if the response time is greater than or equal to the preset maximum response time, the test is judged not to pass.
Optionally, the step of obtaining the comparison threshold value includes:
and using a preset contrast threshold, or adjusting the contrast threshold according to the resolution of the screen of the device to be tested and the testing environment.
Optionally, the step of judging whether the test passed or not for the actual interface relative to the target interface according to the template information further includes:
if the comparison is not passed, storing comparison information which does not pass the comparison in an exception log, and adjusting parameters related to the comparison according to the exception log in the later period.
The invention also provides a software automation test device, which comprises: the system comprises a memory, a processor and a software automation test program stored in the memory and capable of running on the processor, wherein the software automation test program realizes the steps of the software automation test method when being executed by the processor.
The invention also provides a computer readable storage medium, which is characterized in that the computer readable storage medium stores a software automation test program, and the software automation test program realizes the steps of the software automation test method when being executed by a processor.
The invention can realize the continuous test of the automatic test based on the image recognition technology in the whole day, improves the test efficiency, reduces the labor investment, reduces the cost and increases the efficiency, is more sensitive to the change of a software interface, and can not generate the beneficial effect of Bug loss caused by the visual fatigue of the manual test by capturing the interface dynamic in real time.
Drawings
FIG. 1 is a schematic diagram of the hardware architecture of an alternative processing terminal for implementing various embodiments of the present invention;
FIG. 2 is a flow chart of an embodiment of a software automated testing method based on image recognition technology according to the present invention;
FIG. 3 is an interface diagram of an operation interface of an automatic test system according to an embodiment of the present invention;
FIG. 4 is a schematic view of a desktop of a vehicle according to an embodiment of the invention;
FIG. 5 is a schematic view of a template in the acquisition target interface according to the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The main solutions of the embodiments of the present invention are: and positioning a target control of the software interface based on an image recognition technology, guiding a test process, and acquiring a test result. And the mechanical point touch pen is matched to operate a car machine or a mobile phone screen, so that automatic testing of car and software and mobile phone software is realized.
In order to better understand the above technical solutions, the following detailed description will refer to the accompanying drawings and specific embodiments.
As shown in fig. 1, fig. 1 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a PC, or can be a mobile terminal device with a display function, such as a smart phone, a tablet personal computer, an electronic book reader, an MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert compression standard audio layer 3) player, an MP4 (Moving Picture Experts Group AudioLayer IV, dynamic image expert compression standard audio layer 3) player, a portable computer and the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Optionally, the terminal may also include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and so on. Among other sensors, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal moves to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile terminal is stationary, and the mobile terminal can be used for recognizing the gesture of the mobile terminal (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, which are not described herein.
It will be appreciated by those skilled in the art that the terminal structure shown in fig. 1 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a software automation test program may be included in a memory 1005, which is a type of computer storage medium.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call a software automation test program stored in the memory 1005 and perform the following operations:
the method comprises the steps that a target interface of each testing step is obtained in advance according to testing requirements before testing, and template information in the target interface is obtained;
acquiring an actual interface during testing, and judging whether the actual interface passes the test relative to a target interface according to the template information;
if the test is passed, the preset reference position of the template to be operated is obtained to guide the next test operation.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and further perform the following operations:
gray measurement is carried out on pictures acquired by the image acquisition equipment according to the test requirement, and a screen area is automatically selected as a target interface in a frame mode;
or when the acquired picture is insufficient to support automatic frame selection, modifying frame selection parameters or adjusting the acquisition environment based on the operation instruction, and then re-acquiring the picture for frame selection so as to select a screen area as a target interface.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and further perform the following operations:
intercepting one or more interface elements used for identifying the target interface on the target interface as templates of the target interface, and acquiring template information of the templates used for describing the target interface.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and further perform the following operations:
the acquired template information comprises: one or more of the size, shape, coordinates, gray values of the templates and the positional relationship between the respective templates.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and further perform the following operations:
comparing interface elements of the actual interface with the template, wherein the more the interface element information of the actual interface is matched with the template information, the higher the similarity between the actual interface and the target interface is;
if the similarity is greater than the comparison threshold, judging that the test is passed;
and if the similarity is smaller than or equal to the comparison threshold value, judging that the test is not passed.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and further perform the following operations:
if the similarity is larger than the comparison threshold, acquiring response time, wherein the response time is the time from the starting to the displaying of the actual interface;
if the response time is smaller than the preset maximum response time, judging that the test is passed;
if the response time is greater than or equal to the preset maximum response time, the test is judged not to pass.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and further perform the following operations:
and using a preset contrast threshold, or adjusting the contrast threshold according to the resolution of the screen of the device to be tested and the testing environment.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and further perform the following operations:
if the comparison is not passed, storing comparison information which does not pass the comparison in an exception log, and adjusting parameters related to the comparison according to the exception log in the later period.
Referring to fig. 2, the present invention provides a software automated testing method, and in one embodiment of the software automated testing method of the present invention, the software automated testing method includes:
step S10, a target interface of each test step is obtained in advance according to test requirements before testing, and template information in the target interface is obtained.
The test requirement comprises recording operation image-text video, and performing test services such as pressure test, function test, fluency test, verification test, position test, stability test and the like. The equipment to be tested comprises a mobile phone, a tablet personal computer, a car personal computer intelligent networking system and the like which perform touch operation to finish interface change so as to realize specific functions. Before testing, the target interface refers to a testing step with testing requirements, picture acquisition is performed in advance on the screen state before or after the testing step, screen area interception is performed on the acquired picture to obtain the target interface, and template information in the target interface is acquired.
Before testing, a test script is written through operations such as image recognition, variable value judgment, script control and the like according to the test requirements, and the test requirements of instrument pointer types, icon types, semitransparent icons, icon flickering, character flickering, display characteristic areas and the like can be met by matching with a high-precision image algorithm.
And step S20, acquiring an actual interface during testing, and judging whether the actual interface passes the test relative to the target interface according to the template information.
The actual interface is that in the actual testing process, for the testing step with testing requirement, the picture is collected on the screen before or after the testing step according to the testing requirement, and the screen area is intercepted on the collected picture to obtain the actual interface.
When the screen area is intercepted, the screen area of a specific testing step is automatically framed and selected as an actual interface by using the same preset parameters as those of the framing and selecting the target interface on the integral rack picture for the integral rack picture during actual operation acquired by the same image acquisition equipment, and the screen picture of the equipment to be tested during actual testing operation is obtained. Or the same manually modified frame selection parameters are used for automatically selecting the actual whole rack picture to obtain an actual interface when the template is established. Or when the camera is adjusted, the picture shot by the camera is the picture of the screen area, and the picture acquired by the camera is directly used as an actual interface. According to the template information: and comparing the template with the control or characteristic elements of the target interface on the actual interface according to one or more of the size, shape, coordinates, gray value and position relation among the templates, and judging whether the test passes or not according to the comparison result.
Step S30, if the test is passed, the preset reference position of the template to be operated is obtained to guide the next test operation.
When the templates of the target interface are acquired, attribute information of the templates is automatically acquired, wherein the attribute information comprises one or more of the size, the shape, the coordinates, the gray value and the position relation among the templates. And determining a template to be operated according to the testing step, and using coordinates in attribute information of the template to be operated as a preset reference position to guide a stylus of the manipulator to perform the next testing operation. The coordinates may be the center position of the template to be operated or the coordinates within the shape range of the template to be operated, and the coordinates capable of supporting at least the next test operation are used as reference coordinates.
Or in the similarity comparison process of the actual interface and the target interface, the acquired actual interface with the highest similarity with the target interface template is used, and the coordinates of the control or the characteristic element are used as a preset reference position to guide the next test operation. Similarly, the coordinates may be the center position of the control or the feature element in the actual interface with the highest similarity, or the coordinates within the shape range of the control or the feature element, and the coordinates capable of supporting at least the next test operation are taken as reference coordinates.
In this embodiment, the target interface is obtained in advance according to the test requirement before the test, the template information is intercepted in the target interface, the template information is used to determine whether the actual interface passes the test relative to the target interface during the test, if the test passes, the template is guided to perform the technical scheme of the next test operation by the preset reference position of the template, the template of the target interface is compared with the characteristic elements and/or the control of the actual interface to determine whether the test passes, and then the next test operation is guided, and the test is performed continuously throughout the day by the automated test method based on the image recognition technology, so that the complexity of the manual test and the possible errors caused by the long-time test are reduced, the labor input is reduced while the efficiency is improved, and the test result is more accurate.
Specifically, the step of acquiring in advance the target interface of each test step includes:
gray measurement is carried out on pictures acquired by the image acquisition equipment according to the test requirement, and a screen area is automatically selected as a target interface in a frame mode;
or when the acquired picture is insufficient to support automatic frame selection, modifying frame selection parameters or adjusting the acquisition environment based on the operation instruction, and then re-acquiring the picture for frame selection so as to select a screen area as a target interface.
Firstly, acquiring a picture of an integral rack corresponding to a specific testing step acquired by a visual industrial camera of a high-frame-rate high-definition machine, then automatically selecting a target interface required by the specific testing step, namely a screen area picture of equipment to be tested, according to preset parameters on the picture of the integral rack by a gray level measurement method, or manually modifying frame selection parameters or acquiring the picture again after adjusting an acquisition environment when the acquired picture is insufficient to support automatic frame selection, and carrying out frame selection. Or adjusting camera parameters to enable the camera to shoot the screen area, and directly taking the picture acquired by the camera as a target interface. And storing frame selection parameters, acquisition environment variables, high-frame-rate high-definition visual industrial camera parameters and the like which cannot be automatically frame selected into an abnormal log for later adjustment and convenient maintenance.
The operation interface of the frame selection target interface is shown in fig. 3, in which four numerical values represent the coordinate positions of the upper left and lower right, or upper right and lower left of the frame selection region. Checking an automatic check box to perform automatic box selection, wherein coordinate values are obtained through gray scale measurement according to the acquired picture information and are automatically filled in; when the acquired picture is insufficient to support automatic frame selection, canceling to check an 'automatic' check box, manually inputting coordinate values of a frame selection area or manually adjusting the size of the frame selection area on the whole frame picture, and taking a frame selection screen area as a target interface; if the effect of the screen picture area selected by the manual frame selection is unsatisfactory, the image can be collected again after the collection environment is adjusted, and then the automatic or manual frame selection is performed.
The picture acquired by the picture acquisition equipment is automatically framed and selected by a gray level measurement method to serve as a target interface, so that the trouble of manually confirming the screen area is eliminated, the efficiency is improved by automatic framing and selection, and human errors are reduced.
Further, the step of obtaining template information in the target interface includes:
intercepting one or more interface elements used for identifying the target interface on the target interface as templates of the target interface, and acquiring template information of the templates used for describing the target interface.
After the target interface is obtained, manually intercepting one or more templates of the target interface on the target interface, and obtaining template information of each template in the target interface, wherein the template serving as the target interface refers to a control or a characteristic element which can most represent the target interface, and the target interface is most easily and most prominently identified for describing the target interface. As shown in fig. 5, after the target interface of the radio station is acquired, when the template of the radio station is acquired, manually intercepting an "FM and AM" image as the template, or manually intercepting a play/pause, a previous, next and fast forward key images as the template, or taking the two images together as the template, or intercepting more or fewer controls or feature elements as the template individually or in combination, namely taking the interface element as the template of the target interface.
One or more interface elements are intercepted on the target interface as templates of the target interface, and the mode of flexibly and variably confirming the templates is used, so that the application scene of the embodiment of the invention is increased, and more requirements can be covered.
Specifically, after the templates of the target interface are obtained by interception, attribute information of the templates is automatically obtained, wherein the attribute information comprises one or more of the size, shape, coordinates, gray values and position relations among the templates. As shown in fig. 5, in an embodiment of the present invention, the size of the "FM, AM" image is taken as the template size; taking the linear or curved lines of the cut-out 'FM and AM' images as the shape of the template; taking the central coordinates of the cut-out 'FM and AM' images as template coordinates, or taking the central coordinates of the 'FM' images as the template coordinates if the next operation is clicking the 'FM' key; taking the gray values of the cut-out 'FM and AM' images as the gray values of the template; if templates are also intercepted at the radio station interface, the position relationship between the coordinates of the intercepted FM and AM images and the coordinates of the existing templates comprises the distance, the direction and the like as the position relationship among the templates. And judging whether the actual interface passes the test relative to the target interface according to the template information during the test.
Specifically, the step of judging whether the test passes or not for the actual interface relative to the target interface according to the template information includes:
comparing interface elements of the actual interface with the template, wherein the more the interface element information of the actual interface is matched with the template information, the higher the similarity between the actual interface and the target interface is;
if the similarity is greater than the comparison threshold, judging that the test is passed;
and if the similarity is smaller than or equal to the comparison threshold value, judging that the test is not passed.
And distributing weight coefficients to template information, namely the size, shape, coordinates, gray values and the position relation among the templates. Comparing the template information by using a preset weight coefficient, for example, a weight coefficient of 1:1:2:3:1, and distributing the comparison matching score of each item of template information in the proportion of the weight coefficient, namely, multiplying the template size comparison matching score by 1/8, the template shape comparison matching score by 1/8, the template coordinate comparison matching score by 2/8, the template gray value comparison matching score by 3/8, and the position relationship comparison matching score among the templates by 1/8, wherein the final score represents the similarity of comparison. Or adjusting the weight coefficient of each template information according to the comparison effect and/or the test requirement so as to obtain the optimal comparison effect. The similarity is expressed by directly adding the matching scores of each item of template information, or a certain combination is used as a comparison item, for example, the size and the shape are used as the same comparison item, the size and the shape of the actual interface element are considered at the same time during comparison, and then the matching scores are multiplied by the weight distributed after combination. The more the comparison with the template information is consistent, the more the matching is, the higher the final score is, and the higher the similarity between the actual interface and the target interface is. And if the similarity is greater than the comparison threshold, judging that the test is passed.
And comparing the interface element of the actual interface with the template, wherein the more the interface element information of the actual interface is matched with the template information, the higher the similarity between the actual interface and the target interface is. If the similarity is greater than the comparison threshold, the test is judged to pass, and the test method of the embodiment can automatically detect the conforming actual interface to realize automatic test. By comparing the actual interface with the target interface to judge whether the actual interface meets the test requirement or not, and by different similarity comparison scoring methods, more accurate similarity comparison can be performed on different test items and different test scenes and test interfaces, so that the automatic test method of the embodiment can be used in more different test items.
Further, if the similarity is greater than the comparison threshold, the step of determining that the test passes further includes:
if the similarity is larger than the comparison threshold, acquiring response time, wherein the response time is the time from the starting to the displaying of the actual interface;
if the response time is smaller than the preset maximum response time, judging that the test is passed;
if the response time is greater than or equal to the preset maximum response time, the test is judged not to pass.
And if the similarity is greater than the comparison threshold value when the interface element of the actual interface is compared with the template of the target interface in similarity, acquiring and judging the response time of the actual interface. As shown in fig. 4, the actual interface in an embodiment of the present invention includes 8 keys of "navigation", "music", "radio", "telephone", "air conditioner", "setting", "personal center", "360 panorama", wherein "radio" is used as a template of the target interface, and "radio" is clicked as a test step. The time when the actual interface is started is the time when the 'radio station' key is clicked and triggered, and the clicking time sent by the manipulator with the stylus is taken as the starting time for calculating the response time of the actual interface, namely the time when the actual interface is started. The radio interface shown in fig. 5 uses the acquired picture acquisition time of the first radio interface compared with the similarity as the end time for calculating the response time of the actual interface, that is, the acquired picture acquisition time of the first radio interface compared with the similarity as the end time, that is, the display time of the actual interface. The smoothness is characterized by the response time, so that the software is updated and optimized subsequently. After the response time for opening the actual interface is calculated, whether the response time is within a reasonable range or not needs to be judged, and if the response time is smaller than the preset maximum response time, the smoothness meeting the test requirement is indicated, and the test is judged to pass; if the response time is greater than or equal to the preset maximum response time, one or more of software blocking or system errors, problems in template selection, problems in acquisition environment or camera parameters and the like are indicated, further investigation and correction are needed, and the test is judged not to pass. The maximum response time can be adjusted according to the test requirement and the test effect, for example, a simple icon such as the flickering of a vehicle-mounted fault lamp, the test requirement is to detect whether the fault lamp flickering, the test of the response smoothness can be properly relaxed, and the maximum response time can be properly increased by only testing whether the fault lamp passes the contrast test. For example, clicking operation of a certain software of a mobile phone not only needs the target interface to compare through the similarity, but also has very important smoothness, so that the maximum response time can be properly reduced, and the software is continuously optimized.
After the comparison of the similarity is performed, the comparison of the comparison time is increased, the fluency of the object software of the automatic test is judged, and the response speed of the characterization software is improved, so that the data acquisition of the automatic test method in the embodiment is richer and more comprehensive, the test result is more accurate, and the background can calculate and count a large amount of response time, so that the automatic test method in the embodiment is more reliable and accurate.
Specifically, the step of obtaining the contrast threshold value includes:
and using a preset contrast threshold, or adjusting the contrast threshold according to the resolution of the screen of the device to be tested and the testing environment.
In the similarity comparison process of the actual interface and the target interface, a preset comparison threshold value is used for the comparison threshold value, or a comparison threshold value which is modified and adjusted according to the screen resolution of the equipment to be tested is used, or a comparison threshold value which is modified and adjusted according to the test environment is used, or a comparison threshold value which is modified and adjusted according to the screen resolution of the equipment to be tested and the test environment is used together, or a comparison threshold value which is modified and adjusted according to comparison information in an abnormal log is used.
Specifically, if the comparison fails, the comparison information of the failed comparison is stored in an exception log, and the parameters related to the comparison are adjusted according to the exception log in the later period.
In the later adjustment, one or more of setting parameters, lighting parameters, positions between the rack and the image acquisition equipment, positions between the image acquisition equipment and the tested equipment, similarity comparison threshold values, similarity comparison weight coefficients, maximum comparison time, interception area size, a target interface and a template are selected according to the abnormal log to be adjusted, so that the optimal automatic test effect is obtained.
In addition, the embodiment of the invention also provides software automation testing equipment, which comprises: the system comprises a memory, a processor and a software automation test program which is stored in the memory and can run on the processor, wherein the software automation test program realizes the steps of the software automation test method embodiments when being executed by the processor.
In addition, the embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium is stored with a software automation test program, and the steps of the software automation test method are realized when the software automation test program is executed by a processor.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (6)

1. A software automated testing method, the software automated testing method comprising:
before testing, gray scale measurement is carried out on the picture of the whole rack acquired by the image acquisition equipment according to the testing requirement, and a screen area is automatically selected as a target interface;
or when the acquired picture is insufficient to support automatic frame selection, modifying frame selection parameters or adjusting an acquisition environment based on an operation instruction, re-acquiring the picture for frame selection, selecting a screen area as a target interface, and acquiring template information in the target interface, wherein the template information comprises: one or more of the size, shape, coordinates, gray values of the templates and positional relationships between the respective templates;
acquiring an actual interface during testing, comparing interface elements of the actual interface with the template information, and determining a comparison matching score of each item of template information according to a preset weight coefficient;
taking the total comparison matching score of the interface element and the template information as the similarity between the interface element and the template information, wherein the more the interface element information of the actual interface is matched with the template information, the higher the similarity between the actual interface and the target interface is;
if the similarity is larger than a comparison threshold, judging that the test is passed, and acquiring coordinates in template information of a template to be operated as a preset reference position to guide a stylus of a manipulator to perform the next test operation, wherein the comparison threshold is a comparison threshold obtained by adjusting the preset comparison threshold according to the resolution of a screen of the equipment to be tested and a test environment;
and if the similarity is smaller than or equal to the comparison threshold value, judging that the test is not passed.
2. The method of automated software testing according to claim 1, wherein the step of obtaining template information in the target interface comprises:
intercepting one or more interface elements used for identifying the target interface on the target interface as templates of the target interface, and acquiring template information of the templates used for describing the target interface.
3. The method of automated software testing according to claim 1, wherein if the similarity is greater than a comparison threshold, the step of determining that the test passed further comprises:
if the similarity is larger than the comparison threshold, acquiring response time, wherein the response time is the time from the starting to the displaying of the actual interface;
if the response time is smaller than the preset maximum response time, judging that the test is passed;
if the response time is greater than or equal to the preset maximum response time, the test is judged not to pass.
4. The software automated test method of claim 1, further comprising, after the step of determining that the test fails:
if the comparison is not passed, storing comparison information which does not pass the comparison in an exception log, and adjusting parameters related to the comparison according to the exception log in the later period.
5. A test apparatus, the test apparatus comprising: a memory, a processor and a software automation test program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the software automation test method of any one of claims 1 to 4.
6. A computer-readable storage medium, on which a software automation test program is stored, which when executed by a processor implements the steps of the software automation test method according to any one of claims 1 to 4.
CN202110828791.7A 2021-07-22 2021-07-22 Software automated testing method, device and computer readable storage medium Active CN113553261B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110828791.7A CN113553261B (en) 2021-07-22 2021-07-22 Software automated testing method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110828791.7A CN113553261B (en) 2021-07-22 2021-07-22 Software automated testing method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113553261A CN113553261A (en) 2021-10-26
CN113553261B true CN113553261B (en) 2023-09-15

Family

ID=78132359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110828791.7A Active CN113553261B (en) 2021-07-22 2021-07-22 Software automated testing method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113553261B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114791880A (en) * 2022-04-22 2022-07-26 镁佳(北京)科技有限公司 Automatic testing method and device and computer equipment
CN115375645A (en) * 2022-08-17 2022-11-22 武汉海微科技有限公司 Method, device and equipment for testing abnormal display of vehicle-mounted display screen and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902961A (en) * 2012-12-28 2014-07-02 汉王科技股份有限公司 Face recognition method and device
CN109117358A (en) * 2017-06-23 2019-01-01 百度在线网络技术(北京)有限公司 test method and test device for electronic equipment
CN109598683A (en) * 2018-11-12 2019-04-09 平安科技(深圳)有限公司 Image display method, apparatus and computer readable storage medium
CN109766250A (en) * 2017-11-09 2019-05-17 广东欧珀移动通信有限公司 Mobile terminal and its response performance test method, device and storage medium
CN109857652A (en) * 2019-01-16 2019-06-07 深圳壹账通智能科技有限公司 A kind of automated testing method of user interface, terminal device and medium
CN110287101A (en) * 2019-05-22 2019-09-27 深圳壹账通智能科技有限公司 User interface automated testing method, device, computer equipment and storage medium
CN111143188A (en) * 2018-11-02 2020-05-12 中移(杭州)信息技术有限公司 Method and equipment for automatically testing application
CN111767224A (en) * 2020-06-29 2020-10-13 浙江中控技术股份有限公司 Method, device and equipment for automatic testing and computer storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5291133B2 (en) * 2011-03-09 2013-09-18 日本電信電話株式会社 Image processing method, image processing apparatus, video encoding / decoding method, video encoding / decoding apparatus, and programs thereof
US10949225B2 (en) * 2019-02-06 2021-03-16 Sap Se Automatic detection of user interface elements

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103902961A (en) * 2012-12-28 2014-07-02 汉王科技股份有限公司 Face recognition method and device
CN109117358A (en) * 2017-06-23 2019-01-01 百度在线网络技术(北京)有限公司 test method and test device for electronic equipment
CN109766250A (en) * 2017-11-09 2019-05-17 广东欧珀移动通信有限公司 Mobile terminal and its response performance test method, device and storage medium
CN111143188A (en) * 2018-11-02 2020-05-12 中移(杭州)信息技术有限公司 Method and equipment for automatically testing application
CN109598683A (en) * 2018-11-12 2019-04-09 平安科技(深圳)有限公司 Image display method, apparatus and computer readable storage medium
CN109857652A (en) * 2019-01-16 2019-06-07 深圳壹账通智能科技有限公司 A kind of automated testing method of user interface, terminal device and medium
CN110287101A (en) * 2019-05-22 2019-09-27 深圳壹账通智能科技有限公司 User interface automated testing method, device, computer equipment and storage medium
CN111767224A (en) * 2020-06-29 2020-10-13 浙江中控技术股份有限公司 Method, device and equipment for automatic testing and computer storage medium

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Graph similarity scoring and matching;Laura A. Zager 等;《Applied Mathematics Letters》;第21卷(第1期);第86-94页 *
Web应用测试用例自动生成技术研究;化云龙;《中国优秀硕士学位论文全文数据库 信息科技辑》;I139-103 *
王文峰 等.《MATLAB计算机视觉与机器认知》.北京航空航天大学出版社,2017,第101-102页. *
自动化测试中GUI目标的模式识别方法研究;周子闻;《中国优秀硕士学位论文全文数据库 信息科技辑》;20210615;I138-133 *
藤田一弥 等著.《实践深度学习》.机械工业出版社,2020,第51页. *

Also Published As

Publication number Publication date
CN113553261A (en) 2021-10-26

Similar Documents

Publication Publication Date Title
CN109361865B (en) Shooting method and terminal
CN113553261B (en) Software automated testing method, device and computer readable storage medium
US20220180621A1 (en) Article identification method and device, and computer readable storage medium
CN111353458B (en) Text box labeling method, device and storage medium
CN112100431B (en) Evaluation method, device and equipment of OCR system and readable storage medium
CN108848313B (en) Multi-person photographing method, terminal and storage medium
CN108683850B (en) Shooting prompting method and mobile terminal
WO2014206055A1 (en) A method and system for generating a user interface
CN111491211B (en) Video processing method, video processing device and electronic equipment
CN109246474B (en) Video file editing method and mobile terminal
CN110908627A (en) Screen projection method and first electronic device
US9977661B2 (en) Method and system for generating a user interface
CN109947988B (en) Information processing method and device, terminal equipment and server
CN109885490B (en) Picture comparison method and device
CN111914693A (en) Face posture adjusting method, system, device, equipment and medium
CN111652942A (en) Calibration method of camera module, first electronic device and second electronic device
CN107920272B (en) Bullet screen screening method and device and mobile terminal
CN107957841A (en) Roll screenshotss method and device
CN114116435A (en) Game testing method, system, electronic device and computer readable storage medium
CN109871324B (en) Control operation method and device
CN111723843A (en) Sign-in method, device, electronic equipment and storage medium
CN111147750B (en) Object display method, electronic device, and medium
CN113780291A (en) Image processing method and device, electronic equipment and storage medium
CN113076201B (en) Mutual exclusion checking method for task instruction and electronic equipment
CN115543831A (en) Test script generation method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant