CN111858289B - Method and device for testing graphical user interface and computer readable storage medium - Google Patents

Method and device for testing graphical user interface and computer readable storage medium Download PDF

Info

Publication number
CN111858289B
CN111858289B CN201910357829.XA CN201910357829A CN111858289B CN 111858289 B CN111858289 B CN 111858289B CN 201910357829 A CN201910357829 A CN 201910357829A CN 111858289 B CN111858289 B CN 111858289B
Authority
CN
China
Prior art keywords
page
tested
page element
user interface
graphical user
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
CN201910357829.XA
Other languages
Chinese (zh)
Other versions
CN111858289A (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.)
Shenzhen Sinosun Technology Co ltd
Original Assignee
Shenzhen Sinosun 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 Shenzhen Sinosun Technology Co ltd filed Critical Shenzhen Sinosun Technology Co ltd
Priority to CN201910357829.XA priority Critical patent/CN111858289B/en
Publication of CN111858289A publication Critical patent/CN111858289A/en
Application granted granted Critical
Publication of CN111858289B publication Critical patent/CN111858289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 testing method of a graphical user interface, which comprises the following steps: when receiving a page element ID to be tested, acquiring a page element to be tested corresponding to the page element ID to be tested in a page; when the page elements to be tested are not acquired, acquiring each page element in the page; calculating the similarity between the ID of each page element and the ID of the page element to be tested; and taking the page elements with the similarity meeting a preset condition as the page elements to be tested, and testing the page elements to be tested. The invention also discloses a testing device and a storage medium of the graphical user interface. Because the element with smaller change of the ID of the element can still be acquired and tested when the version of the graphical user interface is updated, the probability of failure of automatic test after the version of the graphical user interface is updated is reduced.

Description

Method and device for testing graphical user interface and computer readable storage medium
Technical Field
The present invention relates to the field of software testing, and in particular, to a method and apparatus for testing a graphical user interface, and a computer readable storage medium.
Background
A graphical user interface (Graphical User Interface, GUI) is the primary way computer software interacts with users, and in order to ensure that a developed GUI can function properly, it needs to be tested during GUI development.
At present, the automatic test of the GUI generally tests elements in a GUI page through test cases, but in the GUI development process, when the version of the GUI is updated, the IDs of the elements in the GUI page may be changed, and at this time, the changed elements sent by the IDs in the GUI page after the version update cannot be obtained any more by using the same test cases, so that the automatic test after the GUI version update may fail.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a testing method, a testing device and a computer readable storage medium of a graphical user interface, and aims to solve the problem that in the current automatic testing of the graphical user interface, when a graphical user interface version is updated, elements with changed IDs cannot be obtained, so that the testing fails.
In order to achieve the above object, the present invention provides a method for testing a graphical user interface, the method for testing a graphical user interface comprising the steps of:
when receiving a page element ID to be tested, acquiring a page element to be tested corresponding to the page element ID to be tested in a page;
when the page elements to be tested are not acquired, acquiring each page element in the page;
calculating the similarity between the ID of each page element and the ID of the page element to be tested;
and taking the page elements with the similarity meeting a preset condition as the page elements to be tested, and testing the page elements to be tested.
Preferably, after the step of calculating the similarity between the ID of each of the page elements and the ID of the page element to be tested, the method further includes:
judging whether each similarity is larger than a preset threshold value or not;
when at least one similarity is larger than the preset threshold, acquiring the maximum similarity in the similarities, and taking the page element corresponding to the maximum similarity as the page element meeting the preset condition.
Preferably, when the page element to be tested is not acquired, after the step of acquiring each page element in the page, the method further includes:
closing the page when the page element is not acquired in the page, and recording the closing times;
opening the page again, and executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page;
and when the closing times are greater than the preset times, judging that the test fails.
Preferably, after the step of determining whether each similarity is greater than a preset threshold, the method further includes:
when the similarity is smaller than or equal to the preset threshold value, closing the page, and recording the closing times of the page;
opening the page again, and executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page;
and when the closing times are greater than the preset times, judging that the test fails.
Preferably, after the step of determining that the test fails, the method further includes:
and outputting prompt information of test failure.
Preferably, the calculating method of the similarity includes a cosine similarity calculating method.
Preferably, after the step of obtaining the page element to be tested corresponding to the page element ID to be tested in the page, the method further includes:
and when the page element to be tested is obtained, testing the page element to be tested.
Preferably, after the step of testing the page element to be tested, the method further includes:
and outputting the source of the page element to be tested after the test is completed, wherein when the page element to be tested is the page element corresponding to the page element ID to be tested, the source of the page element to be tested is direct hit, and when the page element to be tested is the page element with the similarity meeting the preset condition, the source of the page element to be tested is similarity matching.
In addition, in order to achieve the above object, the present invention also provides a testing device for a graphical user interface, the testing device for a graphical user interface comprising: memory, a processor and a test program of a graphical user interface stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the method of testing a graphical user interface as described in any of the above.
In addition, in order to achieve the above object, the present invention also provides a computer storage medium having stored thereon a test program of a graphical user interface, which when executed by a processor, implements the steps of the test method of a graphical user interface as set forth in any one of the above.
The embodiment of the invention provides a method, a device and a computer readable storage medium for testing a graphical user interface, wherein when a page element ID to be tested is received, a page element to be tested corresponding to the page element ID to be tested is obtained in a page; when the page elements to be tested are not acquired, acquiring each page element in the page; calculating the similarity between the ID of each page element and the ID of the page element to be tested; and taking the page elements with the similarity meeting a preset condition as the page elements to be tested, and testing the page elements to be tested. Because the element with smaller change of the ID of the element can still be acquired and tested when the version of the graphical user interface is updated, the probability of failure of automatic test after the version of the graphical user interface is updated is reduced.
Drawings
FIG. 1 is a schematic diagram of a terminal structure of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flow chart of an embodiment of a testing method of the GUI of the present invention;
fig. 3 is a schematic diagram of a refinement flow of step S40 in fig. 2.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The main solutions of the embodiments of the present invention are:
when receiving a page element ID to be tested, acquiring a page element to be tested corresponding to the page element ID to be tested in a page;
when the page elements to be tested are not acquired, acquiring each page element in the page;
calculating the similarity between the ID of each page element and the ID of the page element to be tested;
and taking the page elements with the similarity meeting a preset condition as the page elements to be tested, and testing the page elements to be tested.
In the automatic test of the graphical user interface in the prior art, when the version of the graphical user interface is updated, the element with changed ID cannot be obtained, so that the test fails.
The invention provides a solution, which ensures that the element with smaller change of the ID of the element can still be obtained and tested when the version of the graphical user interface is updated, thereby reducing the probability of failure of automatic test after the version of the graphical user interface is updated.
As shown in fig. 1, fig. 1 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the terminal structure shown in fig. 1 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a test program of a graphic user interface.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be used to call a test program of the graphical user interface stored in the memory 1005 and perform the following operations:
when receiving a page element ID to be tested, acquiring a page element to be tested corresponding to the page element ID to be tested in a page;
when the page elements to be tested are not acquired, acquiring each page element in the page;
calculating the similarity between the ID of each page element and the ID of the page element to be tested;
and taking the page elements with the similarity meeting a preset condition as the page elements to be tested, and testing the page elements to be tested.
Further, the processor 1001 may call a test program of the graphical user interface stored in the memory 1005, and further perform the following operations:
judging whether each similarity is larger than a preset threshold value or not;
when at least one similarity is larger than the preset threshold, acquiring the maximum similarity in the similarities, and taking the page element corresponding to the maximum similarity as the page element meeting the preset condition.
Further, the processor 1001 may call a test program of the graphical user interface stored in the memory 1005, and further perform the following operations:
closing the page when the page element is not acquired in the page, and recording the closing times;
opening the page again, and executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page;
and when the closing times are greater than the preset times, judging that the test fails.
Further, the processor 1001 may call a test program of the graphical user interface stored in the memory 1005, and further perform the following operations:
when the similarity is smaller than or equal to the preset threshold value, closing the page, and recording the closing times of the page;
opening the page again, and executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page;
and when the closing times are greater than the preset times, judging that the test fails.
Further, the processor 1001 may call a test program of the graphical user interface stored in the memory 1005, and further perform the following operations:
and outputting prompt information of test failure.
Further, the processor 1001 may call a test program of the graphical user interface stored in the memory 1005, and further perform the following operations:
the calculation mode of the similarity comprises a cosine similarity calculation method.
Further, the processor 1001 may call a test program of the graphical user interface stored in the memory 1005, and further perform the following operations:
and when the page element to be tested is obtained, testing the page element to be tested.
Further, the processor 1001 may call a test program of the graphical user interface stored in the memory 1005, and further perform the following operations:
and outputting the source of the page element to be tested after the test is completed, wherein when the page element to be tested is the page element to be tested corresponding to the page element ID to be tested, the source of the page element to be tested is direct hit, and when the page element to be tested is the page element with the similarity meeting the preset condition, the source of the page element to be tested is similarity matching.
According to the scheme, when the server receives the page element ID to be tested, acquiring the page element to be tested corresponding to the page element ID to be tested from the page; when the page elements to be tested are not acquired, acquiring each page element in the page; calculating the similarity between the ID of each page element and the ID of the page element to be tested; and taking the page elements with the similarity meeting a preset condition as the page elements to be tested, and testing the page elements to be tested. Therefore, when the version of the graphical user interface is updated, the element with smaller change of the ID of the element can still be acquired and tested, and the probability of failure of automatic test after the version of the graphical user interface is updated is reduced.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of a testing method of a gui according to the present invention, where the testing method of a gui includes:
step S10, when a page element ID to be tested is received, acquiring a page element to be tested corresponding to the page element ID to be tested from a page;
in the embodiment of the invention, the server stores the test cases and the page element IDs of all page elements in the GUI page, the test cases correspond to the page element IDs, when the GUI page test is required, the server acquires the page element IDs to be tested of the page to be tested, opens the page to be tested, and matches the page elements to be tested in the page to be tested by using the page element IDs to be tested. Specifically, when the server receives the page element ID to be tested, acquiring the page element to be tested corresponding to the page element ID to be tested in the page to be tested, namely searching the page element with the same ID as the page element ID to be tested in the page to be tested.
Step S20, when the page element to be tested is not obtained, obtaining each page element in the page;
when the page has the page element with the same ID as the page element ID to be tested, the server directly acquires the page element to be tested according to the page element ID, and the server tests the page element to be tested directly acquired through the page element ID to be tested. When the version of the GUI page is updated and the like, the ID of the page element in the page is changed, and at the moment, the page has no page element with the same ID as the page element to be tested, and the server cannot directly acquire the page element to be tested through the page element ID to be tested; the server detects the page and acquires all page elements in the page.
Step S30, calculating the similarity between the ID of each page element and the ID of the page element to be tested;
the server calculates the obtained similarity between the ID of each page element and the ID of the page element to be tested, and it is understood that the method for calculating the ID similarity may be any conventional method for calculating the similarity between a character string and a text, which is not particularly limited herein. For example, the similarity calculation method includes a cosine similarity calculation method, which is defined in a Vector Space Model (VSM). The definition is as follows:
wherein A and B are two vectors in the middle of the vectors. When using it to make string similarity measures, the string needs to be vectorized first, usually using the bag of words model (BOW). For example: string 1= "apple", string 2= "app", the word packet is { 'a', 'e', 'l', 'p','m', if 0,1 is used to determine whether the element is in the word packet, the character strings 1, 2 may be converted into: string similarity can be calculated from cosine formula as string= [1111], string = [1001 ]: 0.707; the cosine similarity is valued between [ -1,1 ].
And S40, taking the page elements with the similarity meeting the preset conditions as the page elements to be tested, and testing the page elements to be tested.
Since the page element ID in the page changes when the GUI page is updated, the version number is increased based on the original ID, for example, the original ID of the button in the web interface is 'button_logic', and the ID of the button is changed to 'button_logic_01' after version update, and the button has higher similarity with the original ID. Therefore, in the embodiment of the present invention, similar preset conditions may be set, after the similarity between the ID of each page element and the ID of the page element to be tested is calculated, the page element whose similarity meets the preset conditions is used as the page element to be tested, and it is understood that the preset conditions may be set by themselves according to actual situations, and no specific limitation is made herein.
Further, referring to fig. 3, fig. 3 is a detailed flow chart of step S40 in the present embodiment, where the step S40 includes:
step S41, judging whether each similarity is larger than a preset threshold value;
step S42, when at least one similarity is larger than the preset threshold, obtaining the maximum similarity in the similarities, and taking the page element corresponding to the maximum similarity as the page element meeting the preset condition.
In this embodiment, a preset threshold of similarity is stored in the server, and only when the similarity is greater than the preset threshold, two IDs corresponding to the similarity are considered to have similarity, where the preset threshold may be set by itself according to practical situations, and is not specifically limited herein, for example, when the similarity is calculated in a cosine similarity calculation method, only when the calculated similarity is greater than 0, the two IDs can be considered to have similarity, so that the preset threshold may be set to 0. After the server calculates and calculates the similarity between the IDs of the page elements and the IDs of the page elements to be tested, judging whether the similarity is larger than the preset threshold value, and judging that the IDs of at least one page element have similarity with the IDs of the page elements to be tested when at least one similarity is larger than the preset threshold value. And then, the server acquires the maximum similarity in the similarities, and takes the page element corresponding to the maximum similarity as the page element meeting the preset condition, namely, the page element with the highest similarity between the ID of the page element and the ID of the page element to be tested as the element to be tested.
After obtaining the page element to be tested, the server uses the test case corresponding to the page element ID to test the page element to be tested, and the method for testing the obtained page element to be tested by using the test case may be any conventional test method, which is not limited herein. After the test is completed, the server outputs a test result and can output the source of the page element to be tested, wherein when the page element to be tested is the page element corresponding to the page element ID to be tested (namely, the page element to be tested is directly matched according to the page element ID to be tested), the source of the page element to be tested is direct hit, and when the page element to be tested is the page element with the similarity meeting the preset condition, the source of the page element to be tested is similarity matching.
According to the technical scheme provided by the embodiment, when the server receives the page element ID to be tested, the page element to be tested corresponding to the page element ID to be tested is obtained from a page; when the page elements to be tested are not acquired, acquiring each page element in the page; calculating the similarity between the ID of each page element and the ID of the page element to be tested; and taking the page elements with the similarity meeting a preset condition as the page elements to be tested, and testing the page elements to be tested. Because the element with smaller change of the ID of the element can still be obtained and tested in a mode of calculating the similarity of the ID when the version of the graphical user interface is updated, the probability of failure of automatic test after the version of the graphical user interface is updated is reduced.
Further, on the basis of the embodiment shown in fig. 2 or fig. 3, after the step S20, the method further includes:
closing the page when the page element is not acquired in the page, and recording the closing times;
opening the page again, and executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page;
and when the closing times are greater than the preset times, judging that the test fails.
In the actual situation, the situation that pages such as advertisement pages are automatically popped up to cover the opened pages often occurs, and when the GUI pages are tested, the situation that popup windows such as advertisements cover the pages to be tested often occurs, at this time, because the pages to be tested are covered by the advertisement pages, when the server acquires page elements in the pages, the server cannot acquire the page elements. In this embodiment, when the server does not acquire the page element in the page, there may be an advertisement popup window covering the page to be tested, and the server searches for a "close button" in the page to be tested, so as to close the page, and records the closing times. And then re-opening the page to be tested, executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page, and re-performing GUI test on the page to be tested according to the method in the embodiment. In order to prevent dead loops caused by the fact that page elements in a page cannot be obtained all the time, a preset number of times is stored in the server, and when the recorded time of closing the page is larger than the preset number of times, the server judges that the test fails, and the server quits the test and outputs prompt information of 'test failure'. It will be appreciated that the server may also output the cause of the test failure at the same time, e.g., output "page element is not acquired in the page".
According to the technical scheme provided by the embodiment, when the page element to be tested is not acquired, the server acquires each page element in the page, and when the page element is not acquired in the page, the server closes the page and records the closing times; opening the page again, and executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page; and when the closing times are greater than the preset times, judging that the test fails. When the server does not acquire the page element in the page, the server can reopen the page to test again, so that the failure rate of testing when the page to be tested is covered by the advertisement and other pages and the page element cannot be acquired is reduced.
Further, on the basis of any one of the above embodiments, after step S41, the method further includes:
when the similarity is smaller than or equal to the preset threshold value, closing the page, and recording the closing times of the page;
opening the page again, and executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page;
and when the closing times are greater than the preset times, judging that the test fails.
When the page to be detected is covered by the pop-up page such as the advertisement, the server may acquire the page element from the pop-up page such as the advertisement, and even if the page element is acquired, the page element needs to be excluded and re-detected. In this embodiment, after the server calculates and calculates the similarity between the ID of each page element and the ID of the page element to be tested, it determines whether each similarity is greater than the preset threshold, and when each similarity is less than or equal to the preset threshold, it indicates that the obtained ID of the page element is lower than the ID of the page element to be tested, and there is no similarity, and at this time, each obtained page element may come from a pop window such as an advertisement, and needs to be tested again. The server searches for a closing button in the page to be closed so as to close the page, and records the closing times. And then re-opening the page to be tested, executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page, and re-performing GUI test on the page to be tested according to the method in the embodiment. In order to prevent dead loops caused by the fact that page elements in a page cannot be obtained all the time, a preset number of times is stored in the server, and when the recorded time of closing the page is larger than the preset number of times, the server judges that the test fails, and the server quits the test and outputs prompt information of 'test failure'. It will be appreciated that the server may also output the cause of the test failure at the same time, e.g., output "page element is not acquired in the page". It should be understood that, in this embodiment, the recorded page closing times and the recorded page closing times in the scheme of recording the closing times may be recorded separately or may be recorded in an accumulated manner when the page element is not acquired in the page, which is not particularly limited herein.
According to the technical scheme provided by the embodiment, after the server calculates the similarity between the IDs of the page elements and the IDs of the page elements to be tested, judging whether the similarity is larger than the preset threshold, closing the page when the similarity is smaller than or equal to the preset threshold, recording the closing times of the page, opening the page again, and executing the step of acquiring the page elements to be tested corresponding to the IDs of the page elements to be tested in the page; when the closing times are greater than preset times, judging that the test fails; when the server does not acquire the ID of the page element with lower similarity with the ID of the page element to be tested, the server can reopen the page to test again, thereby reducing the test failure rate when the page such as advertisement covers the page to be tested and the acquired page element is the page element in the advertisement.
In addition, in order to achieve the above object, an embodiment of the present invention further provides a testing device for a graphical user interface, where the testing device for a graphical user interface includes: the system comprises a memory, a processor and a test program of a graphical user interface stored on the memory and capable of running on the processor, wherein the test program of the graphical user interface realizes the steps of the test method of the graphical user interface according to any embodiment when being executed by the processor.
In addition, in order to achieve the above object, an embodiment of the present invention further provides a computer storage medium, where a test program of a graphical user interface is stored, where the test program of the graphical user interface, when executed by a processor, implements the steps of the test method of the graphical user interface according to any one of the embodiments above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (8)

1. A method for testing a graphical user interface, the method comprising the steps of:
when receiving a page element ID to be tested, acquiring a page element to be tested corresponding to the page element ID to be tested in a page;
when the page elements to be tested are not acquired, acquiring each page element in the page;
calculating the similarity between the ID of each page element and the ID of the page element to be tested;
judging whether each similarity is larger than a preset threshold value or not; when at least one similarity is larger than the preset threshold, acquiring the maximum similarity in the similarities, taking a page element corresponding to the maximum similarity as the page element to be tested, and testing the page element to be tested;
and outputting the source of the page element to be tested after the test is completed, wherein when the page element to be tested is the page element corresponding to the page element ID to be tested, the source of the page element to be tested is direct hit, and when the page element to be tested is the page element with the similarity meeting the preset condition, the source of the page element to be tested is similarity matching.
2. The method for testing a graphical user interface according to claim 1, wherein when the page element to be tested is not acquired, after the step of acquiring each page element in the page, the method further comprises:
closing the page when the page element is not acquired in the page, and recording the closing times;
opening the page again, and executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page;
and when the closing times are greater than the preset times, judging that the test fails.
3. The method for testing a graphical user interface according to claim 1, wherein after the step of determining whether each of the similarities is greater than a preset threshold, further comprising:
when the similarity is smaller than or equal to the preset threshold value, closing the page, and recording the closing times of the page;
opening the page again, and executing the step of acquiring the page element to be tested corresponding to the page element ID to be tested in the page;
and when the closing times are greater than the preset times, judging that the test fails.
4. A method of testing a graphical user interface as claimed in claim 2 or 3, wherein after the step of determining that the test failed, further comprises:
and outputting prompt information of test failure.
5. A method of testing a graphical user interface according to any one of claims 1 to 3, wherein the similarity calculation means comprises a cosine similarity calculation method.
6. A method for testing a gui according to any one of claims 1 to 3, wherein after the step of obtaining the page element to be tested corresponding to the page element ID to be tested in the page, the method further comprises:
and when the page element to be tested is obtained, testing the page element to be tested.
7. A graphical user interface testing apparatus, the graphical user interface testing apparatus comprising: memory, a processor and a test program for a graphical user interface stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the method for testing a graphical user interface as claimed in any one of claims 1 to 6.
8. A computer storage medium, wherein a test program of a graphical user interface is stored on the computer storage medium, which when executed by a processor, implements the steps of the method of testing a graphical user interface as claimed in any one of claims 1 to 6.
CN201910357829.XA 2019-04-29 2019-04-29 Method and device for testing graphical user interface and computer readable storage medium Active CN111858289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910357829.XA CN111858289B (en) 2019-04-29 2019-04-29 Method and device for testing graphical user interface and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910357829.XA CN111858289B (en) 2019-04-29 2019-04-29 Method and device for testing graphical user interface and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111858289A CN111858289A (en) 2020-10-30
CN111858289B true CN111858289B (en) 2024-02-27

Family

ID=72965522

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910357829.XA Active CN111858289B (en) 2019-04-29 2019-04-29 Method and device for testing graphical user interface and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111858289B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988568B (en) * 2021-02-04 2024-05-28 上海硬通网络科技有限公司 Game testing method and device and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776301A (en) * 2016-12-01 2017-05-31 广州酷狗计算机科技有限公司 Daughter element method of testing and device
CN107239397A (en) * 2017-05-17 2017-10-10 北京微影时代科技有限公司 A kind of web automated testing methods and electronic equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106776301A (en) * 2016-12-01 2017-05-31 广州酷狗计算机科技有限公司 Daughter element method of testing and device
CN107239397A (en) * 2017-05-17 2017-10-10 北京微影时代科技有限公司 A kind of web automated testing methods and electronic equipment

Also Published As

Publication number Publication date
CN111858289A (en) 2020-10-30

Similar Documents

Publication Publication Date Title
WO2020232861A1 (en) Named entity recognition method, electronic device and storage medium
CN106874441B (en) Intelligent question-answering method and device
WO2017045443A1 (en) Image retrieval method and system
US6490560B1 (en) Method and system for non-intrusive speaker verification using behavior models
US9589560B1 (en) Estimating false rejection rate in a detection system
US8290968B2 (en) Hint services for feature/entity extraction and classification
US10621507B2 (en) System and method for generating an optimized result set using vector based relative importance measure
JP6464650B2 (en) Audio processing apparatus, audio processing method, and program
US9697819B2 (en) Method for building a speech feature library, and method, apparatus, device, and computer readable storage media for speech synthesis
US20030046072A1 (en) Method and system for non-intrusive speaker verification using behavior models
US20120136812A1 (en) Method and system for machine-learning based optimization and customization of document similarities calculation
US20110144986A1 (en) Confidence calibration in automatic speech recognition systems
US20090254344A1 (en) Active labeling for spoken language understanding
US9799325B1 (en) Methods and systems for identifying keywords in speech signal
KR102441063B1 (en) Apparatus for detecting adaptive end-point, system having the same and method thereof
CN109194689B (en) Abnormal behavior recognition method, device, server and storage medium
US9984678B2 (en) Factored transforms for separable adaptation of acoustic models
CN110990685A (en) Voice search method, voice search device, voice search storage medium and voice search device based on voiceprint
CN111444349A (en) Information extraction method and device, computer equipment and storage medium
US20220188220A1 (en) Method, apparatus and computer program product for predictive configuration management of a software testing system
KR102004831B1 (en) Method for sentence evaluation using similar of sentence, apparatus thereof and computer recordable medium storing the method
US20190213998A1 (en) Method and device for processing data visualization information
CN111858289B (en) Method and device for testing graphical user interface and computer readable storage medium
WO2023029397A1 (en) Training data acquisition method, abnormal behavior recognition network training method and apparatus, computer device, storage medium, computer program and computer program product
CN113436614B (en) Speech recognition method, device, equipment, system 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