CN113553261A - Software automation test method, equipment and computer readable storage medium - Google Patents

Software automation test method, equipment and computer readable storage medium Download PDF

Info

Publication number
CN113553261A
CN113553261A CN202110828791.7A CN202110828791A CN113553261A CN 113553261 A CN113553261 A CN 113553261A CN 202110828791 A CN202110828791 A CN 202110828791A CN 113553261 A CN113553261 A CN 113553261A
Authority
CN
China
Prior art keywords
test
interface
target interface
software
software automation
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.)
Granted
Application number
CN202110828791.7A
Other languages
Chinese (zh)
Other versions
CN113553261B (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

Images

Classifications

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

Landscapes

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

Abstract

The invention discloses a software automation testing method which is based on an image recognition technology, locates a target control of a software interface, guides a testing process and obtains a testing result. And the mechanical point touch pen is matched to operate a car machine or a mobile phone screen, so that the automatic test of car 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 uninterrupted test of the automatic test based on the image recognition technology all day, improve the test efficiency, reduce the human input, reduce the cost and improve the efficiency, is more sensitive to the change of the software interface, and can not generate the data loss caused by the visual fatigue of the manual test by capturing the dynamic state of the interface in real time.

Description

Software automation test method, equipment and computer readable storage medium
Technical Field
The invention relates to the field of automatic testing, in particular to a software automatic testing method, software automatic testing equipment and a computer readable storage medium.
Background
At present, the interconnection of the car machine and the mobile phone is realized, so that the functions of the car machine are more and more, the functions of related mobile phone software are more and more, the test items of the intelligent internet become more and more complicated, the manual test is still relied on under most conditions of the test, and the normal operation of the automatic test is often limited by the problems.
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 resource investment is large, and the long-term testing easily causes human errors.
In order to achieve the above object, the present invention provides a software automation testing method, which includes:
the method comprises the steps of obtaining a target interface of each testing step in advance according to testing requirements before testing, and obtaining template information in the target interface;
acquiring an actual interface during testing, and judging whether the actual interface passes the testing relative to a target interface or not according to the template information;
and if the test is passed, acquiring a preset reference position of the template to be operated to guide the next test operation.
Optionally, the step of pre-acquiring the target interface of each testing step includes:
carrying out gray measurement on the pictures acquired by the image acquisition equipment according to the test requirements, and automatically framing out a screen area as a target interface;
or when the collected picture is not enough to support automatic frame selection, modifying frame selection parameters based on the operation instruction or adjusting the collection environment and then collecting the picture again for frame selection to select a screen area as a target interface.
Optionally, the step of acquiring template information in the target interface includes:
one or more interface elements used for identifying the target interface are intercepted on the target interface and serve as templates of the target interface, and template information of the templates used for describing the target interface is obtained.
Optionally, the template information includes:
one or more of the size, shape, coordinates, gradation values of the templates, and positional relationships between the respective templates.
Optionally, the step of judging whether the actual interface passes the test relative to the target interface according to the template information includes:
comparing the 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 contrast threshold, judging that the test is passed;
and if the similarity is less than or equal to the comparison threshold, judging that the test is not passed.
Optionally, if the similarity is greater than the contrast threshold, the step of determining that the test is passed further includes:
if the similarity is larger than the contrast 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 less than the preset maximum response time, judging that the test is passed;
and if the response time is greater than or equal to the preset maximum response time, judging that the test is not passed.
Optionally, the step of obtaining the contrast threshold includes:
and using a preset contrast threshold value, or adjusting the contrast threshold value according to the resolution of the screen of the device to be tested and the test environment.
Optionally, after the step of determining whether the test of the actual interface relative to the target interface passes according to the template information, the method further includes:
if the comparison is not passed, storing comparison information which is not passed in comparison in an abnormal log, and adjusting parameters related to the comparison according to the abnormal log in the later period.
The invention also provides a software automation test device, which comprises: the software automation test system comprises a memory, a processor and a software automation test program which is stored on the memory and can run 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 uninterrupted test of the automatic test based on the image recognition technology all day, improve the test efficiency, reduce the human input, reduce the cost and improve the efficiency, is more sensitive to the change of the software interface, and can not generate the Bug loss generated by the visual fatigue of the manual test by capturing the interface dynamic state in real time.
Drawings
Fig. 1 is a schematic hardware configuration diagram of an optional processing terminal for implementing various embodiments of the present invention;
FIG. 2 is a schematic flow chart illustrating an embodiment of a software automation testing method based on image recognition technology according to the present invention;
FIG. 3 is a schematic 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 scene of a desktop of a vehicle in an embodiment of the present invention;
FIG. 5 is a schematic view of a scene for acquiring a template in a target interface according to the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: and based on an image recognition technology, positioning a target control of a software interface, 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 the automatic test of car software and mobile phone software is realized.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a PC, and can also be a mobile terminal device with a display function, such as a smart phone, a tablet computer, an electronic book reader, an MP3(Moving Picture Experts Group Audio Layer III, dynamic video Experts compress standard Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, dynamic video Experts compress 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 a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also 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 non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. 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 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, the memory 1005, which is a type of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a software automation test program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend 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 invoke the software automation test program stored in the memory 1005 and perform the following operations:
the method comprises the steps of obtaining a target interface of each testing step in advance according to testing requirements before testing, and obtaining template information in the target interface;
acquiring an actual interface during testing, and judging whether the actual interface passes the testing relative to a target interface or not according to the template information;
and if the test is passed, acquiring a preset reference position of the template to be operated to guide the next test operation.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and also perform the following operations:
carrying out gray measurement on the pictures acquired by the image acquisition equipment according to the test requirements, and automatically framing out a screen area as a target interface;
or when the collected picture is not enough to support automatic frame selection, modifying frame selection parameters based on the operation instruction or adjusting the collection environment and then collecting the picture again for frame selection 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 also perform the following operations:
one or more interface elements used for identifying the target interface are intercepted on the target interface and serve as templates of the target interface, and template information of the templates used for describing the target interface is obtained.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and also perform the following operations:
the acquired template information includes: one or more of the size, shape, coordinates, gradation values of the templates, and positional relationships between the respective templates.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and also perform the following operations:
comparing the 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 contrast threshold, judging that the test is passed;
and if the similarity is less than or equal to the comparison threshold, judging that the test is not passed.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and also perform the following operations:
if the similarity is larger than the contrast 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 less than the preset maximum response time, judging that the test is passed;
and if the response time is greater than or equal to the preset maximum response time, judging that the test is not passed.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and also perform the following operations:
and using a preset contrast threshold value, or adjusting the contrast threshold value according to the resolution of the screen of the device to be tested and the test environment.
Further, the processor 1001 may call the software automation test program stored in the memory 1005, and also perform the following operations:
if the comparison is not passed, storing comparison information which is not passed in comparison in an abnormal log, and adjusting parameters related to the comparison according to the abnormal log in the later period.
Referring to fig. 2, the present invention provides a software automation testing method, and in an embodiment of the software automation testing method of the present invention, the software automation testing method includes:
and step S10, acquiring the target interface of each test step in advance according to the test requirement before the test, and acquiring the template information in the target interface.
The test requirements comprise recording operation image-text videos, and carrying out test services such as pressure test, function test, fluency test, verification test, position test, stability test and the like. The device to be tested comprises a device or a system which is used for carrying out touch operation to complete interface change so as to realize specific functions, such as a mobile phone, a tablet computer, a vehicle computer intelligent network system and the like. The target interface refers to a testing step with testing requirements before testing, picture acquisition is carried out in advance in a screen state before or after the testing step, the acquired picture is intercepted in a screen area to obtain the target interface, and template information in the target interface is obtained.
Before testing, a test script is written out through operations such as image identification, variable value judgment, script control and the like according to test requirements, and the test requirements of instrument pointer type, icon type, semitransparent icon, icon flicker, character flicker, display characteristic area 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 obtained by acquiring pictures of a screen before or after a testing step with a testing requirement according to the testing requirement and intercepting a screen area of the acquired pictures in the testing step in the actual testing process.
When the screen area is intercepted, the screen area of the specific test step is automatically framed and selected as the actual interface by using the same preset parameters on the whole rack picture through a gray scale measurement method when the target interface is framed and selected for the whole rack picture during actual operation acquired by the same image acquisition equipment, and the screen picture of the equipment to be tested during actual test operation is obtained. Or automatically framing the actual integral rack picture by using the same manually modified framing parameters during template building to obtain an actual interface. Or adjusting the camera to enable the picture shot by the camera to be the screen area picture, and directly taking the picture acquired by the camera in actual operation as an actual interface. According to the template information: comparing the size, shape, coordinates and gray value of the template with one or more items in the position relation between the templates on the actual interface with the control or the characteristic element of the target interface, and judging whether the test is passed or not according to the comparison result.
And step S30, if the test is passed, acquiring the preset reference position guide of the template to be operated to perform the next test operation.
When the template of the target interface is obtained, the attribute information of the template is automatically obtained, wherein the attribute information comprises one or more items 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 test step, and guiding a stylus of the manipulator to perform the next test operation by using the coordinates in the attribute information of the template to be operated as a preset reference position. The coordinates can be the central 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 testing operation are taken as reference coordinates.
Or in the process of comparing the similarity between the actual interface and the target interface, using the acquired actual interface with the highest similarity with the target interface template, and using the coordinates of the control or the characteristic element as a preset reference position for guiding the next testing operation. Similarly, the coordinates of the control or the feature element in the actual interface with the highest similarity may be the center position of the control or the feature element, 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 the embodiment, a target interface is obtained in advance according to a test requirement before testing, template information is intercepted from the target interface, whether the actual interface passes the test relative to the target interface is judged by using the template information during testing, if the test passes, a preset reference position of the template is used for guiding the next testing operation, the template of the target interface is compared with the characteristic elements and/or controls of the actual interface to judge whether the test passes, and then the next testing operation is guided.
Specifically, the step of obtaining the target interface of each test step in advance includes:
carrying out gray measurement on the pictures acquired by the image acquisition equipment according to the test requirements, and automatically framing out a screen area as a target interface;
or when the collected picture is not enough to support automatic frame selection, modifying frame selection parameters based on the operation instruction or adjusting the collection environment and then collecting the picture again for frame selection to select a screen area as a target interface.
Firstly, obtaining a picture of an integral rack corresponding to a specific test step acquired by a high frame rate and high definition machine vision industrial camera, then automatically framing a target interface required by the specific test step, namely a screen area picture of equipment to be tested, on the picture of the integral rack according to preset parameters by a gray scale measurement method, or manually modifying framing parameters or adjusting an acquisition environment and then re-acquiring the picture for framing when the acquired picture is insufficient to support automatic framing. Or adjusting camera parameters to enable the camera to shoot the screen area, and directly taking pictures acquired by the camera as a target interface. And storing the frame selection parameters which cannot be automatically selected, the acquisition environment variables, the high frame rate and high definition machine vision industrial camera parameters and the like into an abnormal log so as to adjust in the later period and facilitate maintenance.
The operation interface for framing the target interface is shown in fig. 3, in which four values represent the coordinate positions of the upper left and lower right, or upper right and lower left, of the framing area. Checking an 'automatic' check box to indicate that automatic box selection is carried out, and obtaining coordinate values through gray measurement according to the acquired picture information and automatically filling the coordinate values; when the collected picture is not enough 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 rack picture, and taking the frame selection screen area as a target interface; if the effect of the screen picture area selected by the manual frame is not satisfactory, the picture can be acquired again after the acquisition environment is adjusted, and then automatic or manual frame selection is carried out.
The screen area is automatically framed and selected as the target interface by using the pictures acquired by the picture acquisition equipment through a gray level measurement method, so that the trouble of manually confirming the screen area is saved, the efficiency is improved through automatic framing, and the human errors are reduced.
Further, the step of acquiring the template information in the target interface includes:
one or more interface elements used for identifying the target interface are intercepted on the target interface and serve as templates of the target interface, and template information of the templates used for describing the target interface is obtained.
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 used as the target interface refers to a control or a feature element which can represent the target interface most, and the target interface is identified most easily and prominently and is used for describing the target interface. As shown in fig. 5, after the target interface of the station is obtained, when the template of the station is obtained, the "FM, AM" image is manually captured as the template, or the play/pause, previous, next, fast forward key image is manually captured as the template, or both images are used as the template together, or more or less controls or feature elements are captured as the template alone or in combination, that is, the interface element is used as the template of the target interface.
One or more interface elements are intercepted on the target interface and used as templates of the target interface, and flexible and changeable template confirmation modes are used, so that application scenes of the embodiment of the invention are increased, and more requirements can be covered.
Specifically, after the template of the target interface is intercepted, the attribute information of the template is automatically acquired, including one or more items of the size, the shape, the coordinates, the gray value and the position relation among the templates. As shown in fig. 5, in an embodiment of the present invention, the "FM, AM" image is captured as a template, and the size of the "FM, AM" image is captured as the size of the template; the lines of each straight line or curve of the cut FM and AM images are taken as the shape of the template; taking the center coordinates of the intercepted 'FM and AM' images as template coordinates, or taking the center coordinates of the 'FM' images as the template coordinates if the next operation is clicking the 'FM' key; taking the gray values of the intercepted 'FM and AM' images as the gray values of the template; if the templates are also intercepted on the radio interface, the position relationship between the coordinates of the intercepted images of the FM and AM and the coordinates of the existing templates, including the distance, the direction and the like, is taken as the position relationship between the templates. And judging whether the actual interface passes the test relative to the target interface or not according to the template information during the test.
Specifically, the step of judging whether the actual interface passes the test relative to the target interface according to the template information includes:
comparing the 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 contrast threshold, judging that the test is passed;
and if the similarity is less than or equal to the comparison threshold, judging that the test is not passed.
And distributing weight coefficients to the template information, namely the size, the shape, the coordinates and the gray value of the template and the position relation among the templates. The comparison is performed by using a preset weight coefficient, for example, a weight coefficient of 1:1:2:3:1, the comparison matching score of each item of template information is assigned in proportion to the weight coefficient, that is, the template size comparison matching score is multiplied by 1/8, the template shape comparison matching score is multiplied by 1/8, the template coordinate comparison matching score is multiplied by 2/8, the template gray value comparison matching score is multiplied by 3/8, the position relation between the templates is multiplied by 1/8, and the final score represents the similarity of the comparison. Or adjusting the weight coefficient of each template information according to the comparison effect and/or the test requirement so as to achieve the optimal comparison effect. Or directly using the matching score of each item of template information to directly add up to obtain a score representing the similarity, or using a certain combination of several items as a comparison item, for example, using the size and the shape as the same comparison item, considering the size and the shape of the actual interface element during comparison, and multiplying the matching score by the weight assigned after combination. The more matching and matching with the template information, the higher the final score, and the higher the similarity between the actual interface and the target interface. And if the similarity is greater than the contrast threshold, judging that the test is passed.
Comparing the 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. If the similarity is greater than the contrast threshold, the test is judged to be passed, so that the test method of the embodiment can automatically detect the conforming actual interface, and the automatic test is realized. Whether the actual interface meets the test requirements or not is judged by comparing the actual interface with the target interface, and more accurate similarity comparison can be performed on different test items, different test scenes and different test interfaces by using different similarity comparison scoring methods, so that the automatic test method of the embodiment can be used for more different test items.
Further, if the similarity is greater than the contrast threshold, the step of determining that the test is passed further includes:
if the similarity is larger than the contrast 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 less than the preset maximum response time, judging that the test is passed;
and if the response time is greater than or equal to the preset maximum response time, judging that the test is not passed.
And if the similarity of the interface elements of the actual interface and the template of the target interface is greater than the contrast threshold value during the contrast of the similarity, acquiring and judging the response time of the actual interface. As shown in fig. 4, the actual interface of the embodiment of the present invention includes 8 buttons of "navigation", "music", "radio station", "telephone", "air conditioner", "setup", "personal center", and "360 panorama", where "radio station" is used as the template of the target interface, and "radio station" is clicked as the test step. The time when the actual interface is started is the time when the 'station' key is clicked and triggered, and the click 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. As for the radio interface shown in fig. 5, the collected first image collecting time of the radio interface passing through the similarity comparison is used as the end time for calculating the actual interface response time, that is, the first image collecting time of the radio interface passing through the similarity comparison collected by the image collecting device is used as the end time, that is, the actual interface display time. And characterizing the fluency through the response time so as to perform subsequent update optimization on the software. After calculating the response time for opening the actual interface, judging whether the response time is in a reasonable range, comparing the response time with the preset maximum response time, if the response time is less than the preset maximum response time, indicating the fluency meeting the test requirement, and judging that the test is passed; if the response time is larger than or equal to the preset maximum response time, the abnormality of one or more of software jamming, system error, template selection problem, acquisition environment or camera parameter problem and the like is indicated, further checking and correction are needed, and the condition that the test is not passed is judged. The maximum response time can be adjusted according to the test requirement and the test effect, for example, the simple flickering of some kind of icons such as vehicle machine fault lamps, the test requirement is to detect whether the fault lamps flicker, the strict degree of the test on the response fluency can be properly relaxed, and the maximum response time can be properly increased only by testing whether the fault lamps pass the contrast test. For example, the clicking operation of certain software of the mobile phone not only needs the similarity comparison of the target interface, but also has very important fluency, and can properly reduce the maximum response time and continuously optimize the software.
After the similarity is compared, 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 software is represented, so that the data acquisition of the automatic test method of 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 of the embodiment is more reliable and accurate.
Specifically, the step of obtaining the contrast threshold includes:
and using a preset contrast threshold value, or adjusting the contrast threshold value according to the resolution of the screen of the device to be tested and the test environment.
In the process of comparing the similarity of the actual interface and the target interface, the comparison threshold value uses a preset comparison threshold value, or uses a comparison threshold value which is modified and adjusted according to the screen resolution of the device to be tested, or uses a comparison threshold value which is modified and adjusted according to the test environment, or uses a comparison threshold value which is modified and adjusted according to the screen resolution of the device to be tested and the test environment together, or uses the comparison information in the abnormal log to modify and adjust the comparison threshold value.
Specifically, if the comparison fails, the comparison information which fails to pass the comparison is stored in the abnormal log, and the parameters related to the comparison are adjusted according to the abnormal log in the later period.
In the later adjustment, one or more of the setting parameters, the polishing parameters, the positions between the rack and the image acquisition equipment, the positions between the image acquisition equipment and the tested equipment, the similarity contrast threshold value, the similarity contrast weight coefficient, the maximum contrast time, the size of the intercepted area, the target interface and the template are selected and adjusted according to the abnormal log so as to obtain the optimal automatic test effect.
In addition, an embodiment of the present invention further provides a software automation test device, where the software automation test device includes: the software automation test system comprises a memory, a processor and a software automation test program which is stored on the memory and can run on the processor, wherein the steps of the software automation test method are realized when the software automation test program is executed by the processor.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a software automation test program is stored on the computer-readable storage medium, and when the software automation test program is executed by a processor, the steps of the embodiments of the software automation test method are implemented.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A software automation test method is characterized by comprising the following steps:
the method comprises the steps of obtaining a target interface of each testing step in advance according to testing requirements before testing, and obtaining template information in the target interface;
acquiring an actual interface during testing, and judging whether the actual interface passes the testing relative to a target interface or not according to the template information;
and if the test is passed, acquiring a preset reference position of the template to be operated to guide the next test operation.
2. The software automation test method of claim 1 wherein the step of pre-fetching the target interface for each test step comprises:
carrying out gray measurement on the pictures acquired by the image acquisition equipment according to the test requirements, and automatically framing out a screen area as a target interface;
or when the collected picture is not enough to support automatic frame selection, modifying frame selection parameters based on the operation instruction or adjusting the collection environment and then collecting the picture again for frame selection to select a screen area as a target interface.
3. The software automation test method of claim 1 wherein the step of obtaining template information in the target interface comprises:
one or more interface elements used for identifying the target interface are intercepted on the target interface and serve as templates of the target interface, and template information of the templates used for describing the target interface is obtained.
4. The software automation test method of claim 1, the template information comprising:
one or more of the size, shape, coordinates, gradation values of the templates, and positional relationships between the respective templates.
5. The software automation test method of claim 1, wherein the step of determining whether the actual interface passes the test relative to the target interface according to the template information comprises:
comparing the 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 contrast threshold, judging that the test is passed;
and if the similarity is less than or equal to the comparison threshold, judging that the test is not passed.
6. The automated software testing method of claim 5, wherein the step of determining that the test passes if the similarity is greater than the contrast threshold further comprises:
if the similarity is larger than the contrast 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 less than the preset maximum response time, judging that the test is passed;
and if the response time is greater than or equal to the preset maximum response time, judging that the test is not passed.
7. The software automation test method of claim 5 wherein the step of obtaining the contrast threshold comprises:
and using a preset contrast threshold value, or adjusting the contrast threshold value according to the resolution of the screen of the device to be tested and the test environment.
8. The software automation test method of claim 1, wherein the step of determining whether the actual interface passes the test relative to the target interface according to the template information further comprises:
if the comparison is not passed, storing comparison information which is not passed in comparison in an abnormal log, and adjusting parameters related to the comparison according to the abnormal log in the later period.
9. A test apparatus, characterized in that the test apparatus comprises: memory, a processor and a software automation test program stored on the memory and executable on the processor, the software automation test program when executed by the processor implementing the steps of the software automation test method according to any one of claims 1 to 8.
10. A computer-readable storage medium, having stored thereon a software automation test program which, when executed by a processor, implements the steps of the software automation test method of any one of claims 1 to 8.
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 true CN113553261A (en) 2021-10-26
CN113553261B 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)

Cited By (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 (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130343470A1 (en) * 2011-03-09 2013-12-26 Nippon Telegraph And Telephone Corporation Image processing method, image processing apparatus, video encoding/decoding methods, video encoding/decoding apparatuses, and programs therefor
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
US20200249964A1 (en) * 2019-02-06 2020-08-06 Sap Se Automatic detection of user interface elements
CN111767224A (en) * 2020-06-29 2020-10-13 浙江中控技术股份有限公司 Method, device and equipment for automatic testing and computer storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130343470A1 (en) * 2011-03-09 2013-12-26 Nippon Telegraph And Telephone Corporation Image processing method, image processing apparatus, video encoding/decoding methods, video encoding/decoding apparatuses, and programs therefor
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
US20200249964A1 (en) * 2019-02-06 2020-08-06 Sap Se Automatic detection of user interface elements
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 (4)

* Cited by examiner, † Cited by third party
Title
LAURA A. ZAGER 等: "Graph similarity scoring and matching", 《APPLIED MATHEMATICS LETTERS》, vol. 21, no. 1, pages 101 - 102 *
化云龙: "Web应用测试用例自动生成技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, pages 139 - 103 *
周子闻: "自动化测试中GUI目标的模式识别方法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 June 2021 (2021-06-15), pages 138 - 133 *
藤田一弥 等著: "《MATLAB计算机视觉与机器认知》", 北京航空航天大学出版社, pages: 101 - 102 *

Cited By (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

Also Published As

Publication number Publication date
CN113553261B (en) 2023-09-15

Similar Documents

Publication Publication Date Title
US8848088B2 (en) Product identification using mobile device
US20220180621A1 (en) Article identification method and device, and computer readable storage medium
CN113553261B (en) Software automated testing method, device and computer readable storage medium
CN112100431B (en) Evaluation method, device and equipment of OCR system and readable storage medium
CN111353458B (en) Text box labeling method, device and storage medium
CN109885490B (en) Picture comparison method and device
US11675178B2 (en) Virtual slide stage (VSS) method for viewing whole slide images
CN105474303A (en) Information processing device, information processing method, and program
CN110908627A (en) Screen projection method and first electronic device
CN111914693A (en) Face posture adjusting method, system, device, equipment and medium
CN109947988B (en) Information processing method and device, terminal equipment and server
CN109859216B (en) Distance measurement method, device and equipment based on deep learning and storage medium
CN110673717A (en) Method and apparatus for controlling output device
CN111652942A (en) Calibration method of camera module, first electronic device and second electronic device
CN111723843A (en) Sign-in method, device, electronic equipment and storage medium
CN111739093B (en) Steam pipeline displacement monitoring method and device and electronic equipment
CN109871324B (en) Control operation method and device
CN109684006B (en) Terminal control method and device
CN107734049B (en) Network resource downloading method and device and mobile terminal
CN111147750B (en) Object display method, electronic device, and medium
CN108763088A (en) Inspection method, device, mobile terminal and the storage medium of Application Program Interface
CN115017340A (en) Multimedia resource generation method and device, electronic equipment and storage medium
CN111339196B (en) Data processing method and system based on block chain and computer readable storage medium
CN113076201B (en) Mutual exclusion checking method for task instruction and electronic equipment
CN109783379B (en) Script execution exception determining method and device

Legal Events

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