CN114064456A - Method and system for checking user interface style of mobile terminal - Google Patents
Method and system for checking user interface style of mobile terminal Download PDFInfo
- Publication number
- CN114064456A CN114064456A CN202111233503.XA CN202111233503A CN114064456A CN 114064456 A CN114064456 A CN 114064456A CN 202111233503 A CN202111233503 A CN 202111233503A CN 114064456 A CN114064456 A CN 114064456A
- Authority
- CN
- China
- Prior art keywords
- coordinate
- mobile terminal
- user interface
- check
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
Abstract
The embodiment of the invention provides a method and a system for checking a user interface style of a mobile terminal, which comprises the following steps: selecting at least one static element from a mobile terminal user interface as a check element; designating at least one point on the check element as a check point; measuring coordinates of check points in the standard image and calculating a coordinate coefficient according to the coordinates to serve as an expected coordinate coefficient; acquiring a test image through a user interface of the mobile terminal; measuring the coordinates of the check points in the test image and calculating the coordinate coefficients of the check points in the test image according to the coordinates to serve as actual measurement coordinate coefficients; and if the difference value between the actual measurement coordinate coefficient and the expected coordinate coefficient is smaller than the preset difference value, judging that the current test image is successfully verified. By the method, the user interface styles of the mobile terminals of different brands and models can be checked only after one standard image is sampled, and the mobile terminals of various models do not need to be respectively captured and sampled in advance like the prior art, so that the working efficiency is greatly improved.
Description
Technical Field
The invention relates to the technical field of mobile terminal testing, in particular to a method and a system for checking a user interface style of a mobile terminal.
Background
A mobile terminal User Interface (UI) style check is used to verify whether user interface elements are all displayed and whether the displayed positions of the elements are correct. The user interface is composed of a plurality of element objects, wherein the element objects are called dynamic elements with unfixed element contents and certain regular relative positions, and the element objects are called static elements with fixed element contents.
The method for verifying the user interface style of the mobile terminal in the prior art comprises the following steps: picture contrast is used, which is a pattern checking scheme at the pixel level. Storing and reserving the screenshot A of a correct rendering result before checking, intercepting the current rendering result B during checking, comparing the two pictures A and B one by one, and obtaining a conclusion that the style rendering is correct (namely the check is qualified) if all the pixel values are equal, or else obtaining a conclusion that the style rendering is wrong.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
the existing UI style verification method has equipment limitation, picture pixel values rendered by mobile terminals of different brands and models are slightly different, and an expected result cannot be universal across brands and models; each mobile terminal needs to intercept an expected result picture in advance before actual verification and test in sequence and serves as a comparison reference of subsequent test, so that the work is complicated, and the work efficiency is low. Therefore, how to improve the work efficiency of UI style verification is a problem to be solved.
Disclosure of Invention
The embodiment of the invention provides a method and a system for checking a user interface style of a mobile terminal, which are used for solving the problem of low working efficiency caused by the fact that standard image sampling is required before the style checking of mobile terminals of different types is carried out in the prior art.
To achieve the above object, in one aspect, an embodiment of the present invention provides a method for checking a user interface style of a mobile terminal, including:
selecting at least one static element from a mobile terminal user interface as a check element;
designating at least one point on the check element as a check point;
measuring coordinates of check points in a standard image, wherein the standard image refers to a prestored image correctly rendered by a user interface of the mobile terminal;
calculating a coordinate coefficient of the check point in the standard image according to the coordinate of the check point in the standard image to serve as an expected coordinate coefficient, wherein the coordinate coefficient is a ratio of the coordinate of the check point to the maximum coordinate of the whole image;
acquiring a test image through a user interface of the mobile terminal;
determining coordinates of a check point in the test image;
calculating a coordinate coefficient of the check point in the test image according to the coordinate of the check point in the test image, and taking the coordinate coefficient as an actual measurement coordinate coefficient;
and if the difference value between the actually measured coordinate coefficient and the expected coordinate coefficient of each check point is smaller than the allowable difference value, judging that the current mobile terminal user interface pattern is qualified for verification.
In another aspect, an embodiment of the present invention provides a system for checking a user interface style of a mobile terminal, where the system includes:
the mobile terminal comprises a preprocessing unit, a verification unit and a verification unit, wherein the preprocessing unit is used for selecting at least one static element from a user interface of the mobile terminal as a verification element; designating at least one point on the check element as a check point;
the sampling unit is used for measuring the coordinates of the check points in a standard image, wherein the standard image refers to a prestored image correctly rendered by a user interface of the mobile terminal; calculating a coordinate coefficient of the check point in the standard image according to the coordinate of the check point in the standard image to serve as an expected coordinate coefficient, wherein the coordinate coefficient is a ratio of the coordinate of the check point to the maximum coordinate of the whole image;
the test image generating unit is used for acquiring a test image through a user interface of the mobile terminal;
the checking unit is used for determining the coordinates of the checking points in the test image; calculating a coordinate coefficient of the check point in the test image according to the coordinate of the check point in the test image, and taking the coordinate coefficient as an actual measurement coordinate coefficient;
and the comparison unit is used for judging that the current mobile terminal user interface style is qualified for verification when the difference value between the actual measurement coordinate coefficient and the expected coordinate coefficient of each verification point is smaller than the allowable difference value.
The technical scheme has the following beneficial effects:
in the prior art, when checking the UI style of a mobile terminal, different models of mobile terminals need to be respectively captured and sampled, and then pixel-by-pixel comparison is performed according to the models to check the position abnormality and the size abnormality of elements in the UI style. According to the technical scheme, the mode is not adopted any more, the UI style of the mobile terminal is checked by comparing the coordinate coefficients of partial static elements in the image, even if the coordinate difference caused by different pixels of the mobile terminals of different models exists, the coordinate coefficient is unchanged, so that the mobile terminal of each model does not need to be sampled, the equipment limitation is broken through in the aspect of UI style checking, only one standard image needs to be prepared and sampled, the checking work can be completed quickly and accurately, and the working efficiency is greatly improved.
In addition, the invention also has the following characteristics:
in the prior art, when a mobile terminal UI (user interface) style test is carried out, only the image-text style can be verified, but the rendering result is continuously changed in the video playing process, and an expected result picture cannot be captured before the test, so that the video style cannot be verified; the method of the technical scheme can be applied to static interfaces and dynamic interfaces of video types, has strong universality, and improves the development and maintenance efficiency in a breakthrough manner.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a method for checking a user interface style of a mobile terminal according to an embodiment of the present invention;
FIG. 2 is a block diagram of a system for checking a user interface style of a mobile terminal according to an embodiment of the present invention;
FIG. 3 is an example of a standard image in an embodiment of the present invention;
fig. 4 is an example of a test image in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a method for checking a user interface style of a mobile terminal, including:
s101, selecting at least one static element from a user interface of the mobile terminal as a check element;
s102, at least one point on a verification element is designated as a verification point;
s103, determining coordinates of check points in a standard image, wherein the standard image is a pre-stored image correctly rendered by a user interface of the mobile terminal;
s104, calculating a coordinate coefficient of the check point in the standard image according to the coordinate of the check point in the standard image to serve as an expected coordinate coefficient, wherein the coordinate coefficient is a ratio of the coordinate of the check point to the maximum coordinate of the whole image;
s105, acquiring a test image through a user interface of the mobile terminal;
s106, determining coordinates of the check points in the test image;
s107, calculating a coordinate coefficient of the check point in the test image according to the coordinate of the check point in the test image, and taking the coordinate coefficient as an actual measurement coordinate coefficient;
and S108, if the difference value between the actually measured coordinate coefficient and the expected coordinate coefficient of each check point is smaller than the allowable difference value, judging that the current mobile terminal user interface pattern is qualified in verification.
The reason why the prior art has the problem of low efficiency is that picture pixel values rendered by mobile terminals of different brands and models are slightly different, if a fixed picture is selected for sampling as a reference, different display effects exist on different mobile terminals during testing, and the pixel values are different, so that the sampled picture cannot be completely consistent with actual display images of the mobile terminals of all models, and a sampled picture must be prepared for each model of mobile terminal. In order to solve the problem, in the present application, a pixel comparison manner is no longer adopted, but a position comparison manner of a specific element in an image is adopted, that is, positions of the same element are respectively compared in a sampling image and an actual test image, so as to determine whether the currently actually measured style rendering is correct.
However, when the image pixels displayed on different mobile terminals are different, the coordinates of the specific elements for comparison in the image are also different, so that the coordinate comparison cannot be directly performed, and for this reason, the coordinate coefficients are used in the present application to perform the position comparison between the specific elements in the sample picture and the test image. Although different mobile terminal pixels are different, the sizes of elements in the user interface are proportional, so that the size proportion of each check point relative to the whole image is fixed, namely a coordinate coefficient is fixed. After the coordinate coefficient is adopted, only one standard image needs to be determined in the sampling stage, the coordinate coefficient is obtained for the check point in the standard image, and then when the test is carried out in the checking stage, the user interface screen capture images of the mobile terminals of any type can be determined whether the current checked image is qualified or not by calculating the coordinate coefficient and comparing the coordinate coefficients obtained in the two stages.
Furthermore, the number of the check points is multiple; the check points comprise upper left corner points of the check elements and lower right corner points of the check elements.
In order to make the checking result more accurate, each checking element should be provided with a plurality of checking points. In the present application, the upper left corner point and the lower right corner point are preferably selected as the check points.
Further, the coordinates include an abscissa and an ordinate;
the coordinate coefficients comprise abscissa coefficients and ordinate coefficients;
the abscissa coefficient refers to the ratio of the abscissa of the check point to the maximum width coordinate of the image;
the ordinate coefficient refers to the ratio of the ordinate of the check point to the maximum height coordinate of the image.
In order to improve the accuracy, the transverse direction and the longitudinal direction can be compared, the transverse coordinate and the longitudinal coordinate of each inspection point are measured, and then the transverse coordinate coefficient and the longitudinal coordinate coefficient are respectively calculated according to the measurement result.
Further, the check element is multiple.
In order to improve the accuracy, a plurality of inspection elements are selected for comparison.
Further, the step S105 specifically includes:
s1051, intercepting the current image from the user interface of the mobile terminal to be tested as a test image.
During testing, the display image of the current user interface is directly intercepted from the mobile terminal and is used as a test image. By adopting the method, the static interface can be verified, and the screenshot can be obtained from the dynamic interface of the video class as a test image, so that the video can be verified.
As shown in fig. 2, an embodiment of the present invention provides a system for checking a user interface style of a mobile terminal, including:
the preprocessing unit 21 is configured to select at least one static element from a mobile terminal user interface as a check element; designating at least one point on the check element as a check point;
the sampling unit 22 is configured to determine coordinates of a check point in a standard image, where the standard image is a pre-stored image rendered correctly by a user interface of the mobile terminal; calculating a coordinate coefficient of the check point in the standard image according to the coordinate of the check point in the standard image to serve as an expected coordinate coefficient, wherein the coordinate coefficient is a ratio of the coordinate of the check point to the maximum coordinate of the whole image;
a test image generating unit 23, configured to obtain a test image through a mobile terminal user interface;
a verification unit 24 for determining coordinates of a verification point in the test image; calculating a coordinate coefficient of the check point in the test image according to the coordinate of the check point in the test image, and taking the coordinate coefficient as an actual measurement coordinate coefficient;
and the comparison unit 25 is configured to determine that the current mobile terminal user interface style is qualified for verification when the difference between the actual measurement coordinate coefficient and the expected coordinate coefficient of each verification point is smaller than the allowable difference.
Furthermore, the number of the check points is multiple; the check points comprise upper left corner points of the check elements and lower right corner points of the check elements.
Further, the coordinates include an abscissa and an ordinate; the coordinate coefficients comprise abscissa coefficients and ordinate coefficients; the abscissa coefficient refers to the ratio of the abscissa of the check point to the maximum width coordinate of the image; the ordinate coefficient refers to the ratio of the ordinate of the check point to the maximum height coordinate of the image.
Further, the check element is multiple.
Further, the test image generating unit 23 is specifically configured to intercept a current image from a user interface of the mobile terminal to be tested, as a test image.
The above technical solution of the embodiment of the present invention is described in detail with reference to a specific application example as follows:
in this specific example, the mobile terminal user interface verification includes two stages: expected result sampling and pattern checking.
The steps for the first stage anticipating the sampling of the result are as follows:
step 1: selecting a picture which is rendered correctly as a standard image, such as the image shown in FIG. 3, and selecting a 'search button' of which the check element is the upper right corner of the picture and is shaped like a magnifying glass; then positioning the search button to obtain the horizontal and vertical coordinates of the upper left corner and the lower right corner of the search button;
step 2: and (3) dividing the horizontal and vertical coordinates by the width and the height of the screen to obtain corresponding coordinate coefficients by using the coordinate information obtained in the previous step, wherein the horizontal coordinate coefficient of the upper left corner is 0.8853, the vertical coordinate coefficient of the upper left corner is 0.0628, the horizontal coordinate coefficient of the lower right corner is 0.9653, and the vertical coordinate coefficient of the lower right corner is 0.0997, and the device is ready to be used in the next stage.
And the second stage of pattern verification comprises the following steps:
step 1: a test image such as that shown in fig. 4 is obtained from a screenshot in a user interface of a mobile terminal to be tested. Then, positioning a check element (namely, a search button) in the graph in FIG. 4, and obtaining a horizontal ordinate of the upper left corner and a horizontal ordinate of the lower right corner of the button;
step 2: and dividing the horizontal and vertical coordinates by the width and the height of the screen to obtain corresponding coordinate coefficients by using the coordinate information obtained in the previous step, wherein the horizontal coordinate coefficient of the upper left corner is 0.8853, the vertical coordinate coefficient of the upper left corner is 0.0628, the horizontal coordinate coefficient of the lower right corner is 0.9653, and the vertical coordinate coefficient of the lower right corner is 0.0997.
And step 3: comparing the results, respectively subtracting the coordinate coefficients obtained in the previous step from the coordinate coefficients obtained in the expected result sampling stage, and taking an absolute value, if all the obtained results are not more than a preset difference value (for example, 0.01), the UI style of the button is verified to be passed, otherwise, if the positioning in the step 2 is failed or any one of the results is more than 0.01, the UI style of the button is abnormal;
in order to complete the checking work more accurately, besides the search button, a plurality of checking elements can be reasonably selected from the image and compared respectively.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. To those skilled in the art; various modifications to these embodiments will be readily apparent, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (10)
1. A method for checking the style of a user interface of a mobile terminal is characterized by comprising the following steps:
selecting at least one static element from a mobile terminal user interface as a check element; designating at least one point on the check element as a check point;
measuring coordinates of check points in a standard image, wherein the standard image refers to a prestored image correctly rendered by a user interface of the mobile terminal; calculating a coordinate coefficient of the check point in the standard image according to the coordinate of the check point in the standard image to serve as an expected coordinate coefficient, wherein the coordinate coefficient is a ratio of the coordinate of the check point to the maximum coordinate of the whole image;
acquiring a test image through a user interface of the mobile terminal;
determining coordinates of a check point in the test image; calculating a coordinate coefficient of the check point in the test image according to the coordinate of the check point in the test image, and taking the coordinate coefficient as an actual measurement coordinate coefficient;
and if the difference value between the actually measured coordinate coefficient and the expected coordinate coefficient of each check point is smaller than the allowable difference value, judging that the current mobile terminal user interface style is qualified for verification.
2. The mobile terminal user interface style verification method of claim 1, wherein the verification point is plural;
the check points comprise upper left corner points of the check elements and lower right corner points of the check elements.
3. The mobile terminal user interface style verification method of claim 1,
the coordinates comprise an abscissa and an ordinate;
the coordinate coefficients comprise abscissa coefficients and ordinate coefficients;
the abscissa coefficient refers to the ratio of the abscissa of the check point to the maximum width coordinate of the image;
the ordinate coefficient refers to the ratio of the ordinate of the check point to the maximum height coordinate of the image.
4. The mobile terminal user interface style verification method of claim 1, wherein the verification element is plural.
5. The method for verifying the style of the user interface of the mobile terminal according to claim 1, wherein the obtaining of the test image through the user interface of the mobile terminal specifically comprises:
and intercepting the current image from the user interface of the mobile terminal to be tested as a test image.
6. A mobile terminal user interface style verification system, comprising:
the mobile terminal comprises a preprocessing unit, a verification unit and a verification unit, wherein the preprocessing unit is used for selecting at least one static element from a user interface of the mobile terminal as a verification element; designating at least one point on the check element as a check point;
the sampling unit is used for measuring the coordinates of the check points in a standard image, wherein the standard image refers to a prestored image correctly rendered by a user interface of the mobile terminal; calculating a coordinate coefficient of the check point in the standard image according to the coordinate of the check point in the standard image to serve as an expected coordinate coefficient, wherein the coordinate coefficient is a ratio of the coordinate of the check point to the maximum coordinate of the whole image;
the test image generating unit is used for acquiring a test image through a user interface of the mobile terminal;
the checking unit is used for determining the coordinates of the checking points in the test image; calculating a coordinate coefficient of the check point in the test image according to the coordinate of the check point in the test image, and taking the coordinate coefficient as an actual measurement coordinate coefficient;
and the comparison unit is used for judging that the current mobile terminal user interface style is qualified for verification when the difference value between the actual measurement coordinate coefficient and the expected coordinate coefficient of each verification point is smaller than the allowable difference value.
7. The mobile terminal user interface style verification system of claim 6, wherein the verification point is plural; the check points comprise upper left corner points of the check elements and lower right corner points of the check elements.
8. The mobile terminal user interface style verification system of claim 6, wherein the coordinates comprise an abscissa and an ordinate; the coordinate coefficients comprise abscissa coefficients and ordinate coefficients; the abscissa coefficient refers to the ratio of the abscissa of the check point to the maximum width coordinate of the image; the ordinate coefficient refers to the ratio of the ordinate of the check point to the maximum height coordinate of the image.
9. The mobile terminal user interface style verification system of claim 6, wherein the verification element is plural.
10. The mobile terminal user interface pattern verification system of claim 6, wherein the test image generation unit is specifically configured to intercept a current image from the mobile terminal user interface to be tested as the test image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111233503.XA CN114064456A (en) | 2021-10-22 | 2021-10-22 | Method and system for checking user interface style of mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111233503.XA CN114064456A (en) | 2021-10-22 | 2021-10-22 | Method and system for checking user interface style of mobile terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114064456A true CN114064456A (en) | 2022-02-18 |
Family
ID=80235341
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111233503.XA Pending CN114064456A (en) | 2021-10-22 | 2021-10-22 | Method and system for checking user interface style of mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114064456A (en) |
-
2021
- 2021-10-22 CN CN202111233503.XA patent/CN114064456A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102170545B (en) | Correction information calculating device, image processing apparatus, image display system, and image correcting method | |
CN106254860A (en) | The calibration steps of the calibrating installation of photographing unit, camera arrangement and photographing unit | |
CN111896232B (en) | Optical machine module testing method, equipment, system and computer readable storage medium | |
CN109801342B (en) | Method and device for dynamically identifying mapping fit degree in running process on mobile equipment | |
JP2009071271A (en) | Pattern figure evaluating method, pattern figure evaluating device, pattern figure evaluating data generating device, and semiconductor figure evaluating system employing them | |
CN108055532A (en) | Automate the method and apparatus of matching test card | |
CN112102387B (en) | Test method and test system based on depth estimation performance of depth camera | |
KR101132779B1 (en) | Inspection method | |
CN113412500A (en) | Simulation device, simulation method, and simulation program | |
CN115063342A (en) | Lens dead pixel detection method and device, electronic equipment and storage medium | |
CN111651368B (en) | User graphical interface testing method and computer readable storage medium | |
CN113407461A (en) | Interface test method and device, electronic equipment and storage medium | |
CN114064456A (en) | Method and system for checking user interface style of mobile terminal | |
CN105427315B (en) | Digital instrument image position testing method and device | |
CN105486227A (en) | Font size test method and device for digital instrument | |
CN111028287B (en) | Method and device for determining a transformation matrix of radar coordinates and camera coordinates | |
WO2001022070A1 (en) | Method and system of lcd inspection by pattern comparison | |
CN113933309A (en) | Method for retesting defects in blind hole by AOI machine | |
CN112233171A (en) | Target labeling quality inspection method and device, computer equipment and storage medium | |
CN112053340A (en) | Performance test method, device, storage medium and device of automobile display equipment | |
CN113034585B (en) | Offset state test method, test device and storage medium | |
US9449251B2 (en) | Image processing apparatus, image processing method, and medium | |
Zhu et al. | Image quality evaluation method for surface crack detection based on standard test chart | |
TWI777791B (en) | Dynamic virtual image display distance verification method and system for human-machine interface | |
WO2024095721A1 (en) | Image processing device and image processing method |
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 |