CN108108299B - User interface testing method and device - Google Patents

User interface testing method and device Download PDF

Info

Publication number
CN108108299B
CN108108299B CN201711229070.4A CN201711229070A CN108108299B CN 108108299 B CN108108299 B CN 108108299B CN 201711229070 A CN201711229070 A CN 201711229070A CN 108108299 B CN108108299 B CN 108108299B
Authority
CN
China
Prior art keywords
tested
pages
color matching
page
rgb
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
CN201711229070.4A
Other languages
Chinese (zh)
Other versions
CN108108299A (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.)
Xiamen Jiwei Technology Co ltd
Original Assignee
Xiamen Jiwei Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Jiwei Technology Co ltd filed Critical Xiamen Jiwei Technology Co ltd
Priority to CN201711229070.4A priority Critical patent/CN108108299B/en
Publication of CN108108299A publication Critical patent/CN108108299A/en
Application granted granted Critical
Publication of CN108108299B publication Critical patent/CN108108299B/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

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 embodiment of the invention provides a user interface testing method and device. The method comprises the following steps: acquiring a home page address of a WEB system to be tested, and retrieving according to the home page address to obtain all pages to be tested in a user interface of the WEB system; extracting RGB values of all pages to be tested, and determining theme color matching according to the RGB values of all pages to be tested; and if the first difference degree of the RGB value of the page to be tested and the RGB value of the theme color matching is judged to be larger than the first threshold value, the page to be tested is an abnormal page. The apparatus is configured to perform the method. According to the embodiment of the invention, the RGB values of all the acquired pages to be tested are extracted, the theme color matching is determined, and if the first difference degree between the RGB values of the pages to be tested and the RGB values of the theme color matching is judged to be larger than the first threshold value, the pages to be tested are indicated to be abnormal pages, so that the efficiency and the quality of the user interface test of the WEB system are improved.

Description

User interface testing method and device
Technical Field
The embodiment of the invention relates to the technical field of computer testing, in particular to a user interface testing method and device.
Background
With the popularization of automated testing technology, the testing of application program interfaces gradually changes from manual testing to User Interface (UI) automated testing. And UI automatic test, namely, the equipment executes a preset test script through a test tool and simulates the operation of a user aiming at the UI of the application to be tested, so that the function and the performance of the application to be tested are automatically tested.
When the UI test of the WEB system is carried out currently, different opinions are often given because of the incongruity of the aesthetic sense of each person. One person who might test feels one match looks nice but the development looks nice as another color, but the result might be that the product manager does not look nice. The UI of such a system, with constant changes, or changing a large number of color schemes, ultimately fails to give a large number of users the perception of having an aesthetically pleasing UI and wastes a great deal of time. In addition, each page of the WEB system needs to be tested and compared during testing, so that the uniformity of the UI aesthetic feeling of the system is ensured, but the general WEB systems are large, the number of pages is very large, part of the pages are easy to forget, and the UI of the system cannot be ensured to be strictly tested.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a user interface testing method and device.
In a first aspect, an embodiment of the present invention provides a user interface testing method, including:
acquiring a home page address of a WEB system to be tested, and retrieving according to the home page address to acquire all pages to be tested in a user interface of the WEB system;
extracting RGB values of all the pages to be tested, and determining theme color matching according to the RGB values of all the pages to be tested;
and if the first difference degree between the RGB value of the page to be tested and the RGB value of the theme color matching is judged and obtained to be larger than a first threshold value, the page to be tested is an abnormal page.
Further, the extracting RGB values of all the pages to be tested, and determining theme color matching according to the RGB values of all the pages to be tested includes:
and if the number of the pages to be tested in the approximate page set in the WEB system is judged to be larger than a second threshold value, calculating an RGB mean value corresponding to the pages to be tested in the approximate page set, taking a color corresponding to the RGB mean value as the theme color matching, wherein the approximate page set is a set in which the second difference degree between the RGB values of any two pages to be tested is smaller than a third threshold value.
Further, the method further comprises:
and calculating a third difference according to the RGB value of the theme color matching corresponding to the WEB system and the RGB value of the theme color matching corresponding to the historical system, and returning the third difference to the user terminal if the third difference is judged to be larger than a fourth threshold.
Further, the method further comprises:
and generating an HTML document according to a test result, and returning the HTML document to the user terminal, wherein the test result comprises the abnormal page and the third difference.
Further, if it is determined that the first difference between the RGB value of the page to be tested and the RGB value of the theme color matching is greater than the first threshold, the page to be tested is an abnormal page, including:
calculating the average value of the RGB value of the page to be tested and the RGB value of the theme color matching to obtain the first difference degree;
and if the first difference degree is judged and obtained to be larger than the first threshold value, the page to be tested is the abnormal page.
Further, the method further comprises:
and a system color matching database is constructed in advance, and the system color matching database comprises theme color matching corresponding to the historical system.
In a second aspect, an embodiment of the present invention provides a method and an apparatus for testing a user interface, where the method includes:
the acquisition module is used for acquiring a home page address of a WEB system to be tested, retrieving according to the home page address and acquiring all pages to be tested in a user interface of the WEB system;
the extraction module is used for extracting RGB values of all the pages to be tested and determining theme color matching according to the RGB values of all the pages to be tested;
the first judging module is used for judging that the to-be-tested page is an abnormal page if the first difference degree between the RGB value of the to-be-tested page and the RGB value of the theme color matching is larger than a first threshold value.
Further, the apparatus further comprises:
and the second judgment module is used for calculating a second difference according to the RGB value of the theme color matching corresponding to the WEB system and the RGB value of the theme color matching corresponding to the historical system, and returning the second difference to the user terminal if the second difference is judged to be larger than a fourth threshold.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus, wherein,
the processor and the memory are communicated with each other through the bus;
the memory stores program instructions executable by the processor, the processor being capable of performing the method steps of the first aspect when invoked by the program instructions.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, including:
the non-transitory computer readable storage medium stores computer instructions that cause the computer to perform the method steps of the first aspect.
According to the user interface testing method and device provided by the embodiment of the invention, the RGB values of all the obtained pages to be tested are extracted, the theme color matching is determined, and if the first difference degree between the RGB values of the pages to be tested and the RGB values of the theme color matching is judged and obtained to be greater than the first threshold value, the pages to be tested are indicated to be abnormal pages, so that the efficiency and the quality of the user interface testing of the WEB system are improved.
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, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a user interface testing method according to an embodiment of the present invention;
FIG. 2 is a schematic overall flowchart of a user interface testing method according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a user interface testing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flow chart of a user interface testing method provided in an embodiment of the present invention, as shown in fig. 1, the method includes:
step 101: acquiring a home page address of a WEB system to be tested, and retrieving according to the home page address to acquire all pages to be tested in a user interface of the WEB system;
specifically, a user inputs a home page address of a WEB system to be tested into a testing device, the testing device obtains the home page address of the WEB system to be tested, which is input by the user, and searches according to the home page address to obtain all pages to be tested in a user interface of the WEB system, and each page to be tested is subjected to screenshot, and at this time, the page to be tested exists in a picture form.
Step 102: extracting RGB values of all the pages to be tested, and determining theme color matching according to the RGB values of all the pages to be tested;
specifically, the RGB values of each of the pages to be tested after screenshot are extracted, so that RGB values corresponding to all the pages to be tested can be obtained, and the theme color matching of the WEB system is determined according to the RGB values corresponding to all the pages to be tested, because general software ensures uniformity and most of the color matching is consistent. It can be understood that when the RGB values of more than 60% of the pages to be tested are close to each other in all the pages to be tested, the theme color matching of the WEB system can be determined according to the RGB values corresponding to the 60% of the pages to be tested.
Step 103: and if the first difference degree between the RGB value of the page to be tested and the RGB value of the theme color matching is judged and obtained to be larger than a first threshold value, the page to be tested is an abnormal page.
Specifically, first difference degrees between the RGB value of each page to be tested and the RGB value of the theme color matching are respectively calculated, if the first difference degree between the RGB value of one page to be tested in all the pages to be tested and the RGB value of the theme color matching is larger than a first threshold value, it is indicated that the difference between the color matching of the page to be tested and the theme color matching is large, and most of the color matching is consistent due to the fact that general software guarantees uniformity, and therefore the page to be tested is taken as an abnormal page. It should be noted that the first threshold is preset and may be adjusted according to actual situations, and this is not specifically limited in the embodiment of the present invention.
According to the embodiment of the invention, the RGB values of all the acquired pages to be tested are extracted, the theme color matching is determined, and if the first difference degree between the RGB values of the pages to be tested and the RGB values of the theme color matching is judged to be larger than the first threshold value, the pages to be tested are indicated to be abnormal pages, so that the efficiency and the quality of the user interface test of the WEB system are improved.
On the basis of the above embodiment, the performing RGB value extraction on all the pages to be tested and determining theme color matching according to the RGB values of all the pages to be tested includes:
and if the number of the pages to be tested in the approximate page set in the WEB system is judged to be larger than a second threshold value, calculating an RGB mean value corresponding to the pages to be tested in the approximate page set, taking a color corresponding to the RGB mean value as the theme color matching, wherein the approximate page set is a set in which the second difference degree between the RGB values of any two pages to be tested is smaller than a third threshold value.
Specifically, an approximate page set is obtained from all pages to be tested of the WEB system, wherein the approximate page set comprises a plurality of pages to be tested, and RGB values of the plurality of pages to be tested in the approximate page set are relatively close, i.e., a second difference between RGB values of any two of the plurality of pages to be tested is smaller than a third threshold value. And if the number of the pages to be tested in the approximate page set is larger than a second threshold value, calculating RGB mean values corresponding to a plurality of pages to be tested in the approximate page set, and taking the color corresponding to the RGB mean values as the theme color matching of the WEB system. It should be noted that the second threshold and the third threshold may be set according to actual situations, and this is not specifically limited in the embodiment of the present invention.
According to the embodiment of the invention, the theme color matching of the WEB system is determined according to the RGB values of all the pages to be tested, and then the page to be tested is judged to have larger color matching difference with the theme color matching according to the theme color matching, so that all the pages to be tested in the WEB system can be tested, the condition of page missing test can not be caused, and the quality of UI test is improved.
On the basis of the above embodiment, the method further includes:
and calculating a third difference according to the RGB value of the theme color matching corresponding to the WEB system and the RGB value of the theme color matching corresponding to the historical system, and returning the third difference to the user terminal if the third difference is judged to be larger than a fourth threshold.
Specifically, besides judging whether color matching between pages inside the WEB system is uniform or not, the RGB value of the theme color matching of the WEB system can be compared with the RGB value of the theme color matching of the history system, and the third difference degree of the two color matching is calculated.
According to the embodiment of the invention, the theme color matching of the WEB system is compared with the theme color matching of the historical system, and if the theme color matching difference between the WEB system and the historical system is large, the third difference degree is returned to the user terminal, so that not only is a single page in the WEB system tested, but also the theme color matching of the whole WEB system is tested.
On the basis of the above embodiment, the method further includes:
and generating an HTML document according to a test result, and returning the HTML document to the user terminal, wherein the test result comprises the abnormal page and the third difference.
Specifically, after all pages to be tested in the WEB system are tested, and after the theme color matching test of the WEB system is completed, an HTML document is generated by the abnormal page and the third difference degree, and the generated HTML document is returned to the user terminal, so that research and development personnel can visually feel the difference according to the abnormal page, determine whether the color matching is in problem, and adjust according to the information in the HTML document. The HTML document may also be stored in a database.
According to the embodiment of the invention, the RGB values of all the acquired pages to be tested are extracted, the theme color matching is determined, and if the first difference degree between the RGB values of the pages to be tested and the RGB values of the theme color matching is judged to be larger than the first threshold value, the pages to be tested are indicated to be abnormal pages, so that the efficiency and the quality of the user interface test of the WEB system are improved.
On the basis of the above embodiment, if it is determined that the first difference between the RGB value of the page to be tested and the RGB value of the theme color matching is greater than the first threshold, the page to be tested is an abnormal page, including:
calculating the average value of the RGB value of the page to be tested and the RGB value of the theme color matching to obtain the first difference degree;
and if the first difference degree is judged and obtained to be larger than the first threshold value, the page to be tested is the abnormal page.
Specifically, a page to be tested is composed of a plurality of pixel points, each pixel point corresponds to an RGB value, therefore, the RGB value of one page to be tested is a matrix, the RGB value of each pixel point has three digital representations, namely an R value, a G value and a B value, similarly, the RGB value of main body color matching also has the three values, the weights corresponding to the R value, the G value and the B value are all 1, the difference values between the R value, the G value and the B value of each pixel point and the R value, the G value and the B value of subject color matching are respectively calculated, the difference values are added and averaged to obtain the difference value between the RGB value of each pixel point and the RGB value of subject color matching in the page to be tested, and the average value of the difference values between the RGB values of all pixel points and the RGB value of subject color matching is calculated to obtain a first difference degree. If the calculated first difference is larger than the first threshold value, the difference between the color matching of the page to be tested and the color matching of the theme is larger, and the page to be tested is taken as an abnormal page at the moment. It should be noted that the calculation methods of the second difference and the third difference are similar to those described above, and are not described herein again.
According to the embodiment of the invention, the theme color matching of the WEB system is determined according to the RGB values of all the pages to be tested, and then the page to be tested is judged to have larger color matching difference with the theme color matching according to the theme color matching, so that all the pages to be tested in the WEB system can be tested, the condition of page missing test can not be caused, and the quality of UI test is improved.
On the basis of the above embodiments, the method further includes:
and a system color matching database is constructed in advance, and the system color matching database comprises theme color matching corresponding to the historical system.
Specifically, a system color matching database is constructed in advance, wherein color matching information of a historical system, namely RGB values of the historical system, is stored in the system color matching database, wherein the historical system can be one or more, and the historical system is approved by research and development personnel in advance.
According to the embodiment of the invention, the RGB values of all the acquired pages to be tested are extracted, the theme color matching is determined, and if the first difference degree between the RGB values of the pages to be tested and the RGB values of the theme color matching is judged to be larger than the first threshold value, the pages to be tested are indicated to be abnormal pages, so that the efficiency and the quality of the user interface test of the WEB system are improved.
Fig. 2 is a schematic overall flow chart of a user interface testing method according to an embodiment of the present invention, as shown in fig. 2, the method includes:
step 201: inputting a WEB system address; a research and development staff inputs a home page address of a WEB system to be tested to the testing device through a user terminal;
step 202: retrieving each page of the WEB system and screenshot; the test device searches according to the received home page address of the WEB system to obtain all pages to be tested corresponding to the WEB system, and performs screenshot processing on each page to be tested;
step 203: obtaining theme color matching of a WEB system, and testing a page to be tested according to the theme color matching; and obtaining the theme color matching of the WEB system according to the RGB values of all the pages to be tested, wherein the specific method for theme color matching is consistent with that in the embodiment, and details are not repeated here. And calculating a first difference degree between the RGB value of each page to be tested and the RGB value of the theme color matching, wherein if the first difference degree is greater than a first threshold value, the test result of the page to be tested is an abnormal page. Preferably, the first difference degree between the RGB value of the page to be tested except the approximate page set in the WEB system and the RGB value of the theme color matching can be obtained.
Step 204: comparing the theme coloring of the WEB system with the theme coloring of the historical system; and acquiring a historical system from the system color matching database, calculating a third difference according to the RGB value of the topic color matching of the WEB system and the RGB value of the topic color matching of the historical system, and if the third difference is greater than a fourth threshold value, indicating that the topic color matching of the WEB system is abnormal.
Step 205: returning the detection result to the user terminal; and generating an HTML file by the page to be tested with the test result of the abnormal page and the corresponding first difference and the third difference between the WEB system and the historical system, storing the HTML file in the system color matching database and returning the HTML file to the user terminal.
According to the embodiment of the invention, the RGB values of all the acquired pages to be tested are extracted, the theme color matching is determined, and if the first difference degree between the RGB values of the pages to be tested and the RGB values of the theme color matching is judged to be larger than the first threshold value, the pages to be tested are indicated to be abnormal pages, so that the efficiency and the quality of the user interface test of the WEB system are improved.
Fig. 3 is a schematic structural diagram of a user interface testing apparatus according to an embodiment of the present invention, as shown in fig. 3, the apparatus includes: an obtaining module 301, an extracting module 302 and a first judging module 303, wherein:
the acquiring module 301 is configured to acquire a home page address of a to-be-tested WEB system, perform retrieval according to the home page address, and acquire all to-be-tested pages in a user interface of the WEB system; the extraction module 302 is configured to perform RGB value extraction on all the pages to be tested, and determine theme color matching according to the RGB values of all the pages to be tested; the first determining module 303 is configured to determine that the page to be tested is an abnormal page if it is determined that the first difference between the RGB value of the page to be tested and the RGB value of the theme color matching is greater than a first threshold.
Specifically, a user inputs a home page address of a WEB system to be tested into the testing apparatus, the obtaining module 301 obtains the home page address of the WEB system to be tested, which is input by the user, and searches according to the home page address to obtain all pages to be tested in a user interface of the WEB system, and captures each page to be tested, where the page to be tested exists in a picture form. The extracting module 302 extracts the RGB values of each of the pages to be tested after being captured, so that RGB values corresponding to all the pages to be tested can be obtained, and the theme color matching of the WEB system is determined according to the RGB values corresponding to all the pages to be tested, because the general software ensures uniformity and most of the color matching is consistent. It can be understood that when the RGB values of more than 60% of the pages to be tested are close to each other in all the pages to be tested, the theme color matching of the WEB system can be determined according to the RGB values corresponding to the 60% of the pages to be tested. The first judging module 303 calculates a first difference between the RGB value of each page to be tested and the RGB value of the theme color matching, and if the first difference between the RGB value of one page to be tested and the RGB value of the theme color matching in all the pages to be tested is greater than a first threshold, it indicates that the difference between the color matching of the page to be tested and the theme color matching is large. It should be noted that the first threshold is preset and may be adjusted according to actual situations, and this is not specifically limited in the embodiment of the present invention.
The embodiment of the apparatus provided in the present invention may be specifically configured to execute the processing flows of the above method embodiments, and the functions of the apparatus are not described herein again, and refer to the detailed description of the above method embodiments.
According to the embodiment of the invention, the RGB values of all the acquired pages to be tested are extracted, the theme color matching is determined, and if the first difference degree between the RGB values of the pages to be tested and the RGB values of the theme color matching is judged to be larger than the first threshold value, the pages to be tested are indicated to be abnormal pages, so that the efficiency and the quality of the user interface test of the WEB system are improved.
On the basis of the above embodiment, the apparatus further includes:
and the second judgment module is used for calculating a second difference according to the RGB value of the theme color matching corresponding to the WEB system and the RGB value of the theme color matching corresponding to the historical system, and returning the second difference to the user terminal if the second difference is judged to be larger than a fourth threshold.
Specifically, besides judging whether color matching between pages inside the WEB system is uniform or not, the RGB value of the theme color matching of the WEB system can be compared with the RGB value of the theme color matching of the history system through the second judging module, and the third difference degree of the two color matching is calculated.
According to the embodiment of the invention, the theme color matching of the WEB system is compared with the theme color matching of the historical system, and if the theme color matching difference between the WEB system and the historical system is large, the third difference degree is returned to the user terminal, so that not only is a single page in the WEB system tested, but also the theme color matching of the whole WEB system is tested.
On the basis of the foregoing embodiment, the extraction module is specifically configured to:
and if the number of the pages to be tested in the approximate page set in the WEB system is judged to be larger than a second threshold value, calculating an RGB mean value corresponding to the pages to be tested in the approximate page set, taking a color corresponding to the RGB mean value as the theme color matching, wherein the approximate page set is a set in which the second difference degree between the RGB values of any two pages to be tested is smaller than a third threshold value.
On the basis of the above embodiment, the apparatus further includes:
and the generating module is used for generating an HTML document according to the test result and returning the HTML document to the user terminal, wherein the test result comprises the abnormal page and the third difference.
On the basis of the foregoing embodiment, the first determining module is specifically configured to:
calculating the average value of the RGB value of the page to be tested and the RGB value of the theme color matching to obtain the first difference degree;
and if the first difference degree is judged and obtained to be larger than the first threshold value, the page to be tested is the abnormal page.
On the basis of the above embodiments, the apparatus further includes:
and the construction module is used for constructing a system color matching database in advance, wherein the system color matching database comprises theme color matching corresponding to the historical system.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 4, the apparatus includes: a processor (processor)401, a memory (memory)402, and a bus 403; wherein the content of the first and second substances,
the processor 401 and the memory 402 complete communication with each other through the bus 403;
the processor 401 is configured to call the program instructions in the memory 402 to execute the methods provided by the above-mentioned method embodiments, for example, including: acquiring a home page address of a WEB system to be tested, and retrieving according to the home page address to acquire all pages to be tested in a user interface of the WEB system; extracting RGB values of all the pages to be tested, and determining theme color matching according to the RGB values of all the pages to be tested; and if the first difference degree between the RGB value of the page to be tested and the RGB value of the theme color matching is judged and obtained to be larger than a first threshold value, the page to be tested is an abnormal page.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: acquiring a home page address of a WEB system to be tested, and retrieving according to the home page address to acquire all pages to be tested in a user interface of the WEB system; extracting RGB values of all the pages to be tested, and determining theme color matching according to the RGB values of all the pages to be tested; and if the first difference degree between the RGB value of the page to be tested and the RGB value of the theme color matching is judged and obtained to be larger than a first threshold value, the page to be tested is an abnormal page.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the above method embodiments, for example, including: acquiring a home page address of a WEB system to be tested, and retrieving according to the home page address to acquire all pages to be tested in a user interface of the WEB system; extracting RGB values of all the pages to be tested, and determining theme color matching according to the RGB values of all the pages to be tested; and if the first difference degree between the RGB value of the page to be tested and the RGB value of the theme color matching is judged and obtained to be larger than a first threshold value, the page to be tested is an abnormal page.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the apparatuses and the like are merely illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A user interface testing method, comprising:
acquiring a home page address of a WEB system to be tested, and retrieving according to the home page address to acquire all pages to be tested in a user interface of the WEB system;
extracting RGB values of all the pages to be tested, and determining theme color matching according to the RGB values of all the pages to be tested;
if the first difference degree between the RGB value of the page to be tested and the RGB value of the theme color matching is judged and obtained to be larger than a first threshold value, the page to be tested is an abnormal page;
the RGB value extraction is carried out on all the pages to be tested, and theme color matching is determined according to the RGB values of all the pages to be tested, and the method comprises the following steps:
and if the number of the pages to be tested in the approximate page set in the WEB system is judged to be larger than a second threshold value, calculating an RGB mean value corresponding to the pages to be tested in the approximate page set, taking a color corresponding to the RGB mean value as the theme color matching, wherein the approximate page set is a set in which the second difference degree between the RGB values of any two pages to be tested is smaller than a third threshold value.
2. The method of claim 1, further comprising:
and calculating a third difference according to the RGB value of the theme color matching corresponding to the WEB system and the RGB value of the theme color matching corresponding to the historical system, and returning the third difference to the user terminal if the third difference is judged to be larger than a fourth threshold.
3. The method of claim 2, further comprising:
and generating an HTML document according to a test result, and returning the HTML document to the user terminal, wherein the test result comprises the abnormal page and the third difference.
4. The method of claim 1, wherein if it is determined that the first difference between the RGB values of the page to be tested and the RGB values of the theme color matching is greater than the first threshold, the page to be tested is an abnormal page, including:
calculating the average value of the RGB value of the page to be tested and the RGB value of the theme color matching to obtain the first difference degree;
and if the first difference degree is judged and obtained to be larger than the first threshold value, the page to be tested is the abnormal page.
5. The method of claim 2 or 3, further comprising:
and a system color matching database is constructed in advance, and the system color matching database comprises theme color matching corresponding to the historical system.
6. A user interface testing apparatus, comprising:
the acquisition module is used for acquiring a home page address of a WEB system to be tested, retrieving according to the home page address and acquiring all pages to be tested in a user interface of the WEB system;
the extraction module is used for extracting RGB values of all the pages to be tested and determining theme color matching according to the RGB values of all the pages to be tested;
the first judging module is used for judging whether the RGB value of the page to be tested and the RGB value of the theme color matching are different or not;
the extraction module is specifically configured to:
and if the number of the pages to be tested in the approximate page set in the WEB system is judged to be larger than a second threshold value, calculating an RGB mean value corresponding to the pages to be tested in the approximate page set, taking a color corresponding to the RGB mean value as the theme color matching, wherein the approximate page set is a set in which the second difference degree between the RGB values of any two pages to be tested is smaller than a third threshold value.
7. The apparatus of claim 6, further comprising:
and the second judgment module is used for calculating a second difference according to the RGB value of the theme color matching corresponding to the WEB system and the RGB value of the theme color matching corresponding to the historical system, and returning the second difference to the user terminal if the second difference is judged to be larger than a fourth threshold.
8. An electronic device, comprising: a processor, a memory, and a bus, wherein,
the processor and the memory are communicated with each other through the bus;
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any one of claims 1-5.
9. A non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the method of any one of claims 1-5.
CN201711229070.4A 2017-11-29 2017-11-29 User interface testing method and device Active CN108108299B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711229070.4A CN108108299B (en) 2017-11-29 2017-11-29 User interface testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711229070.4A CN108108299B (en) 2017-11-29 2017-11-29 User interface testing method and device

Publications (2)

Publication Number Publication Date
CN108108299A CN108108299A (en) 2018-06-01
CN108108299B true CN108108299B (en) 2020-08-21

Family

ID=62208774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711229070.4A Active CN108108299B (en) 2017-11-29 2017-11-29 User interface testing method and device

Country Status (1)

Country Link
CN (1) CN108108299B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110879780A (en) * 2019-10-25 2020-03-13 北京奇艺世纪科技有限公司 Page abnormity detection method and device, electronic equipment and readable storage medium
CN113362400A (en) * 2021-06-30 2021-09-07 平安普惠企业管理有限公司 User interface color matching detection method, device, equipment and storage medium
CN117609104A (en) * 2024-01-24 2024-02-27 盛威时代科技股份有限公司 Page exception processing method, system and equipment in client test process

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102768625B (en) * 2011-05-06 2015-06-10 北京新媒传信科技有限公司 Resurfacing method and device of Windows user interface
CN104426967B (en) * 2013-08-30 2019-02-15 中国石油天然气股份有限公司 A kind of cross-platform and striding equipment mobile application development system
CN103927102A (en) * 2014-04-28 2014-07-16 深圳市中兴移动通信有限公司 Subject color matching method and mobile terminal
CN105260301A (en) * 2015-09-24 2016-01-20 努比亚技术有限公司 Visual effect comparison test device of user interfaces and realization method of visual effect comparison test device of user interfaces
US10013337B2 (en) * 2015-12-14 2018-07-03 Sap Se Feature switches for private cloud and on-premise application components
CN106598846B (en) * 2016-11-29 2018-03-16 上海壹账通金融科技有限公司 Application interface method of testing and device
CN106886491A (en) * 2017-01-17 2017-06-23 博彦科技股份有限公司 Webpage compatibility test method and device

Also Published As

Publication number Publication date
CN108108299A (en) 2018-06-01

Similar Documents

Publication Publication Date Title
US20200065471A1 (en) Security verification method and relevant device
CN108108299B (en) User interface testing method and device
CN111368089A (en) Service processing method and device based on knowledge graph
CN108696486B (en) Abnormal operation behavior detection processing method and device
CN108764369B (en) Figure identification method and device based on data fusion and computer storage medium
CN108920037B (en) Method and device for displaying virtual three-dimensional space of house
CN106789973B (en) Page security detection method and terminal equipment
CN110532485B (en) User behavior detection method and device based on multi-source data fusion
CN110569509A (en) risk group identification method and device
CN113780297A (en) Image processing method, device, equipment and storage medium
CN113538629A (en) Detection method and device
KR101473671B1 (en) Method and apparatus for detection of phishing site by image comparison
CN113297416A (en) Video data storage method and device, electronic equipment and readable storage medium
CN109328372A (en) Mutual noise for video is estimated
CN109471935B (en) Questionnaire survey object determining method and device, electronic equipment and storage medium
CN111291259B (en) Data screening method and device, electronic equipment and storage medium
CN115934179A (en) Service function control method and equipment
CN114222110A (en) Method and device for detecting video flicker degree
CN110765303A (en) Method and system for updating database
CN113344064A (en) Event processing method and device
CN112257450A (en) Data processing method, device, readable storage medium and equipment
CN111581487A (en) Information processing method and device
CN112711524B (en) Data testing method and device based on AB test and computer storage medium
CN112990304B (en) Semantic analysis method and system suitable for power scene
CN111144471B (en) Detection 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