Movatterモバイル変換


[0]ホーム

URL:


CN119645837B - Graphical user interface testing method, device, and electronic device - Google Patents

Graphical user interface testing method, device, and electronic device

Info

Publication number
CN119645837B
CN119645837BCN202411605187.8ACN202411605187ACN119645837BCN 119645837 BCN119645837 BCN 119645837BCN 202411605187 ACN202411605187 ACN 202411605187ACN 119645837 BCN119645837 BCN 119645837B
Authority
CN
China
Prior art keywords
test
graphical user
user interface
tested
test case
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
CN202411605187.8A
Other languages
Chinese (zh)
Other versions
CN119645837A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co LtdfiledCriticalBeijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202411605187.8ApriorityCriticalpatent/CN119645837B/en
Publication of CN119645837ApublicationCriticalpatent/CN119645837A/en
Application grantedgrantedCritical
Publication of CN119645837BpublicationCriticalpatent/CN119645837B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

Translated fromChinese

本公开提供了一种图形用户界面的测试方法,涉及软件测试技术领域,尤其涉及用户图形界面的测试、人工智能技术领域。具体实现方案为:响应于接收到多个目标设备发送的数据库内容同步请求,获取所述数据库内容同步请求中包含的目标设备的设备状态信息;基于多个所述目标设备的设备状态信息,将数据库内容同步请求对应的数据库内容数据,拆分为对应多个所述目标设备的多个数据块;基于所述多个数据块生成多个数据块同步任务,将多个所述数据块同步任务分配给多个所述目标设备,其中,多个所述目标设备中的任一目标设备被配置为响应于接收到所述服务器发送的所述数据块同步任务,执行所述数据块同步任务将对应的数据块同步到目标设备本地。

The present disclosure provides a method for testing a graphical user interface, which relates to the field of software testing technology, and in particular to the field of testing a graphical user interface and the field of artificial intelligence technology. A specific implementation scheme is as follows: in response to receiving a database content synchronization request sent by multiple target devices, obtaining device status information of the target device contained in the database content synchronization request; based on the device status information of the multiple target devices, splitting the database content data corresponding to the database content synchronization request into multiple data blocks corresponding to the multiple target devices; generating multiple data block synchronization tasks based on the multiple data blocks, and assigning the multiple data block synchronization tasks to the multiple target devices, wherein any one of the multiple target devices is configured to execute the data block synchronization task in response to receiving the data block synchronization task sent by the server to synchronize the corresponding data block to the local target device.

Description

Testing method and device for graphical user interface and electronic equipment
Technical Field
The present disclosure relates to the field of software testing technologies, and in particular, to the field of testing and artificial intelligence technologies for a graphical user interface.
Background
The graphical user interface (GRAPHICAL USER INTERFACE, GUI) of an application plays an important role in software use, directly affecting the implementation of software functions and user experience. When an application is updated in version, the GUI typically changes, which may affect the proper functioning of existing functions. Thus, it is necessary to conduct GUI testing in order to ensure that new versions do not negatively impact the original functionality.
At present, a manual test mode is mainly adopted, manual operation is performed in a scene requiring frequent test in the manual test, the efficiency is low, human errors are easily introduced, and the test result is inaccurate.
Disclosure of Invention
The disclosure provides a database content synchronization method, a database content synchronization device and electronic equipment for solving at least one of the technical problems.
According to an aspect of the present disclosure, there is provided a method of testing a graphical user interface, wherein the method comprises:
cutting the target test case to obtain the cut target test case;
generating a test action based on the graphical user interface to be tested and the cut target test case;
And executing the test action to automatically test the graphical user interface to be tested to obtain a test result.
According to an aspect of the present disclosure, there is provided a test apparatus of a graphical user interface, wherein the apparatus includes:
the cutting module is used for cutting the target test case to obtain the cut target test case;
the generating module is used for generating a test action based on the graphical user interface to be tested and the cut target test case;
And the testing module is used for executing the testing action to automatically test the graphical user interface to be tested to obtain a testing result.
According to another aspect of the present disclosure, there is provided an electronic device including:
At least one processor, and
A memory communicatively coupled to the at least one processor, wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method described above.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method according to the above.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method according to the above.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of a testing method of a graphical user interface according to a first embodiment of the present disclosure;
FIG. 2 is a schematic diagram of one branch of an exemplary original target test case;
FIG. 3 is a schematic diagram of one branch of an exemplary tailored target test case;
FIG. 4 is a schematic diagram of an exemplary generated test action;
FIG. 5 is a flow chart of a testing method of a graphical user interface according to a second embodiment of the present disclosure;
FIG. 6 is a flow chart of an exemplary S203;
FIG. 7 is an interface diagram of an exemplary graphical user interface detection interface element;
FIG. 8 is a schematic diagram of an exemplary test system;
FIG. 9 is a schematic diagram of a testing party device of a graphical user interface according to a third embodiment of the present disclosure;
fig. 10 is a block diagram of an electronic device for implementing the methods of embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Embodiments of the disclosure and features of embodiments may be combined with each other without conflict.
As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The method for testing the graphical User interface according to the present disclosure may be performed by an electronic device such as a terminal device or a server, where the terminal device may be a vehicle-mounted device, a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal digital assistant (Personal DIGITAL ASSISTANT, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc., and the method may be implemented by a processor invoking computer readable program instructions stored in a memory. Or the test method of the graphical user interface provided by the present disclosure may be performed by a server.
In disclosing a first embodiment, referring to fig. 1, fig. 1 shows a flow chart of a testing method of a graphical user interface provided in the first embodiment of the present disclosure. The method comprises the following steps:
s101, cutting the target test case to obtain the cut target test case.
S102, generating a test action based on the graphical user interface to be tested and the cut target test case.
And S103, executing a test action to automatically test the graphical user interface to be tested, and obtaining a test result.
Test cases (Test cases) refer to descriptions of Test tasks performed on application software, and embody Test schemes, methods, technologies and strategies. The content of the test case may include at least one of test targets, test environments, input data, test steps, expected results, test scripts, etc., to ultimately form a document. In other words, a test case is a set of test inputs, execution conditions, and expected results formulated for a particular goal to test whether a particular application's needs are met.
The graphical user interface (GRAPHICAL USER INTERFACE, GUI) refers to a computer-operated user interface that is displayed graphically. The GUI is an interface display format in which a user communicates with the application software, and the GUI contains a plurality of interface elements, at least some of which the user can manipulate to effect interaction with the application software. Therefore, in order to verify a certain function of the GUI, a test case needs to be formed for the requirements of the GUI.
In this case, a test case set including a plurality of test cases may be formed for the GUI to be tested, and since the test cases include a plurality of expressions (or "descriptions") that are irrelevant to the execution steps of the test, for example, a summary expression, in S101, the target test cases may be cut first, and a part of expressions that are irrelevant to the execution of the test may be removed, so as to obtain the cut target test cases, thereby reducing information that needs to be processed and resolved later, and making the generation of subsequent test actions clearer, and reducing errors.
Further, after the cut target test case is obtained, a test action is generated based on the GUI to be tested actually and the target test case, and then the action is executed to automatically test the GUI, so that the automation of the GUI test is realized.
Referring to fig. 2-4, fig. 2 shows a schematic diagram of one branch of an exemplary original target test case, fig. 3 shows a schematic diagram of one branch of an exemplary tailored target test case, and fig. 4 shows a schematic diagram of an exemplary generated test action. As an example, referring to FIG. 2, the original test case, because it was written by the relevant tester on demand, is not uniform in format style and may contain many summaries, markups, or other expressions that are not related to automated execution. In the present disclosure, after clipping, referring to fig. 3, a clipped test case is obtained, and the expression of the test case related to execution is retained. For example, a part of the test cases in FIG. 2 is "Main dialogue test case (case) →dialogue page→welcome logic and adjustment→function→map related history data→how to go to the hometown input→normally show welcome and map history content". In the expression of the test cases, welcome logic and adjustment, functions and map related historical data are all in summary expression and are irrelevant to the subsequent generation of test actions, so that the test cases after being cut in the figure 3 are obtained, and the expression of the test cases which are required to be executed in the actual generation of the test actions is reserved, namely 'dialog pages, how to go from the input to the deceased, and normal welcome and map historical content display'.
Further, based on the test case cut in fig. 3, the test actions to be executed for testing the expressions are determined, and by way of example, referring to fig. 4, five test actions are obtained, namely, cold start application software (app), clicking on a dialogue tag (tab), inputting "how to go to the home in the main dialogue, clicking on a send button, and verifying that welcome exists in the current page. Therefore, the executor executes the five actions, and the test of the test case of fig. 3 can be completed, so that a test result is obtained.
According to the method provided by the disclosure, the original target test case can be cut to obtain the target test case which needs to be tested actually, then the test action is automatically generated aiming at the target test case which needs to be tested actually, and then the test action is automatically tested aiming at the GUI application test action to be tested, so that the automatic test of the GUI is realized, and the automation of the GUI test is realized and the test process is simplified.
In the related art, the automatic test of the GUI mainly adopts two modes, namely a recording and playback mode and a model driving mode, wherein in the recording and playback mode, a tester needs to manually test the GUI, a recording tool records the operations and then performs the playback test, in the model driving mode, the description including interface elements, business logic and the like is required to be input, and a mathematical model automatically determines test cases or scripts. In the two modes, the recording and playback modes have poor flexibility, the intelligence is carried out according to prerecording, the model driving mode has poor semantic understanding capability, and the model driving is complex. Based on this, the disclosure proposes a testing method of a graphical user interface, see the following.
In disclosing the second embodiment, referring to fig. 5, fig. 5 shows a flow chart of a testing method of a graphical user interface provided in the second embodiment of the present disclosure. The method comprises the following steps:
s201, screening out target test cases which can be used for automatic testing from a preset test case set based on preset screening conditions.
Wherein, the preset screening conditions comprise at least one of the following:
(1) The number of preconditions exceeds a preset threshold.
The precondition is a condition that must be true before the test case is executed. If the preconditions are too excessive or too severe, it is not suitable for automatic testing and therefore filtration is required. The preset may be set as required, for example, 3, 5, etc., which is not limited herein.
(2) Test cases rely on the input of complex data. Complex data, such as dynamic data, is difficult to automatically test in such cases, and can be filtered.
(3) Test cases require complex interactions. In this case, the accuracy of the test is low and thus can be filtered.
The above conditions are only exemplary descriptions, not limiting, and the individual conditions may be omitted or combined. By the method, one or more target test cases suitable for automatic test are screened from the test case set, and subsequent operations can be executed aiming at any target test case, so that test cases unsuitable for automatic test are screened, the accuracy of the test is improved, and invalid test is avoided.
S202, inputting the target test case and a preset prompt word into a large model, and removing invalid expressions in the target test case through the large model to obtain the cut target test case.
Because the test case includes a plurality of expressions (or "descriptions") irrelevant to the execution steps of the test, for example, summary expressions, in S202, the target test case may be cut first, specifically, a preset prompt term (prompt) may be combined, for example, due to the generalization capability and semantic parsing capability of the large model, the expression irrelevant to the execution of the test in the original target test case is removed through guidance of the prompt term, so as to obtain the cut target test case, thereby reducing information required to be processed and resolved subsequently, making the generation of the subsequent test action clearer, and reducing errors.
Wherein the large model includes at least one of a machine learning model having a large number of parameters and a complex structure, a large language model, an encoder (transducer) architecture-based language model, and the like, without limitation. .
It should be noted that S202 is one implementation of S101, and currently, S101 has other implementations, which are not limited herein.
S203, automatically testing the graphical user interface to be tested based on the history test action corresponding to the history test case similar to the target test case.
Referring to fig. 6, fig. 6 shows an exemplary flow diagram of S203, S203 comprising:
S2031, based on the target test case, performing similarity retrieval on the historical test cases contained in the preset automatic test case library to obtain a historical test case with similarity with the target test case higher than a preset threshold value.
S2032, automatically testing the graphical user interface to be tested through the history test action corresponding to the history test case.
S2033, determining an untested part in the graphical user interface to be tested, executing the target test case based on the graphical user interface to be tested and the clipping based on the untested part, and generating a test action.
In order to enable the tested test cases and the test results thereof to be continuously used and realize the data flywheel, an automatic test case library can be established, wherein the history test cases and related information thereof are stored, and the related information such as history test actions, history test results, history graphical user interfaces, history test results and the like corresponding to the history test cases are not limited herein. After each test, the test cases and related information are stored into an automatic test case library as historical test cases. Therefore, when a new target test case is carried out, whether the history test case exists in the similarity of the current target test case or not can be searched in the automatic test case library, if so, the history test case is taken out, the corresponding history test action is obtained, and then the history test action is executed to carry out automatic test. However, the test cases are not always completely consistent, so that the history test action may only test a part of functions of the current target test case, thereby locating a part of the current target test case, which is not tested by the history test action, and executing the subsequent test of S204. If the history test actions can all cover the current target test case, the execution of the subsequent steps is empty.
The preset threshold value of the similarity may be set as required, for example, 70%, and the like, which is not limited herein.
By the method, on one hand, historical test data can be multiplexed to realize a data flywheel, and on the other hand, subsequent test steps can be simplified.
In some examples, the historical test cases are in the form of text vectors, that is, the historical test cases in the automatic test case library are stored in a vector manner, so that quick retrieval can be achieved, in which case S2031 includes:
And step one, converting the target test case into a text vector form.
And secondly, carrying out vector similarity retrieval on the basis of the target test case in the text vector form and the historical test case in the text vector form of a preset automatic test case library to obtain the historical test case with the vector similarity higher than a preset threshold value with the target test case.
Firstly, the target test case is also converted into a vector form, and then vector similarity retrieval is carried out with the history test case in the vector form, so that retrieval and matching can be rapidly realized. The preset threshold value of the vector similarity may be set according to needs, for example, 80%, and the like, which is not limited herein.
In some examples, S203 includes:
S2031', based on the target test cases, performing similarity retrieval on the history test cases contained in the preset automatic test case library to obtain history test cases with similarity with the target test cases higher than a preset threshold value;
s2032', inputting the target test case and the history test case into a large model, and verifying whether the description of the target test case and the description of the history test case are matched or not through the large model.
If the result is a match, S2033 is executed, and if the result is a mismatch, the flow ends, S203 is skipped, and S204 is executed.
S2033', automatically testing the graphical user interface to be tested through the history test action corresponding to the history test case;
S2034', determining an untested part in the graphical user interface to be tested, executing the target test case based on the graphical user interface to be tested and the clipping based on the untested part, and generating a test action.
In this implementation, step S2032' is introduced, that is, after the historical test case similar to the current target test case is retrieved, a discrimination step is added, and whether the description of the target test case and the description of the historical test case similar to the threshold are matched is determined through a large model, so that test errors are avoided. Because the description has semantic information, a large model is introduced for verification, so that accuracy can be ensured.
In some cases, S203 (including S2031-S2033 and S2031 '-S2034') may be omitted, and is not limited herein.
S204, detecting interface elements contained in the graphical user interface to be tested.
S205, inputting a large model based on interface elements, target test cases and preset callable function sets, and obtaining test actions output by the large model.
The test action at least comprises a target interface element corresponding to the test action, the position of the target interface element on the graphical user interface to be tested, and a callable function corresponding to the test action. The purpose of the test action is to call the corresponding callable function on the target interface element to execute the test action, and obtain the returned result of the callable function. In S205, by combining the large model with the target test case and the available callable function set, the large model is input for analysis, so as to obtain which test actions need to be completed under the current GUI to be tested, so that the test requirement of the target test case can be realized, and the whole test path is disassembled into a plurality of single-step test actions, and the target test case can be completed under the GUI to be tested by executing the test actions, so as to obtain the test result.
The GUI refers to a computer-operated user interface that is displayed in a graphical manner. The GUI is an interface display format in which a user communicates with the application software, and the GUI contains a plurality of interface elements, at least some of which the user can manipulate to effect interaction with the application software. At this step, the GUI to be tested may run the application software using the device loaded with the application software, and then a real-time screenshot is taken. To verify a certain function of the GUI, the related interface elements which need to be operated or read are needed to be positioned, so that the graphical user interface to be tested is firstly identified to obtain the interface elements contained in the GUI, then the large model is input for analysis by combining the target test case and the available callable function set to obtain the test actions which need to be completed under the current GUI to be tested, the test requirements of the target test case can be realized, and therefore, the whole test path is disassembled into a plurality of single-step test actions, and the target test case can be completed under the GUI to be tested by executing the test actions, so that the test result is obtained.
In some examples, the interface elements include interactive interface elements and text interface elements, the interactive interface elements are interface elements included in the GUI that a user can use to interact with the application software, and the text interface elements are interface elements included in the GUI for description. Because the features of the two are inconsistent, two models can be used to identify two interface elements respectively, and S204 includes:
inputting the graphical user interface to be tested into an interactive element detection (GUIICON) model to obtain an interactive interface element and a position thereof.
Inputting the graphic user interface to be tested into a character extraction (OCR) model to obtain character interface elements and positions thereof.
Referring to fig. 7, fig. 7 illustrates an interface schematic of an exemplary graphical user interface detection interface element. The recognition results of the first step and the second step comprise recognized interface elements, rectangular frames (used for representing the positions of the interface elements) of the interface elements and numerical identifiers allocated to the rectangular frames. For example, in the detection interface shown in FIG. 7, the graphical user interface includes five interface elements, image 1, FIG. 2, example text, button 1, and button 2, each identified interface element having a rectangular box and a numerical designation in the upper left corner. These information are then input into the large model, which in combination with the large model generates the test action. The large model has graphic analysis capability, but because the GUI is complex, the target recognition capability of the large model usually generates recognition errors, so that interface elements can be recognized through a pre-trained GUIICON model, an OCR model and the like, and then input into the large model, the recognition accuracy can be obviously improved, and the accuracy of the position where the test action is executed on the GUI to be tested is further ensured.
In some examples, the test action includes a plurality of, and S205 includes:
And inputting the large model based on the interface element, the target test case and the preset callable function set to obtain a plurality of test actions and execution sequences of the plurality of test actions output by the large model.
In some examples, to complete a target test case, multiple test actions are typically performed, a large model is used to synthesize interface elements, target test cases, and callable function sets, analyze which test actions are required to be performed to implement the target test case in the current GUI, and determine the operational location of each test action and corresponding callable function.
For example, referring to FIG. 3, the target test case to be tested is "dialogue page→how to go away from home" and "welcome and map history content are normally shown" referring to FIG. 4, the test actions to be performed are five execution actions of cold start application software (app) →clicking dialogue tag (tab) →how to go away from home "entered in the main dialogue also input box→clicking the send button→on the main dialogue page and verifying welcome exists. In other words, the target test case shown in fig. 3, namely, dialogue page, how to go to the hometown, normal showing of welcome and map history content, recognized interface elements, callable function set, and the large model are input into the large model, and the large model outputs test actions and execution sequences thereof, namely, referring to fig. 4, cold start application software (app), clicking dialogue tag (tab), inputting "how to go to the hometown" in the main dialogue input box, clicking a send button in the main dialogue page, and verifying welcome exists in the current page.
Wherein, in some examples, the callable function set includes a plurality of callable functions, and a plurality of callable functions may be preset, each callable function having a corresponding operation function, and illustratively, the callable function set includes at least one of the following callable functions:
(1) A first callable function for clicking on any interface element.
Illustratively, the first callable function can be expressed as a tap (element: int). The first callable function is used to click on an interactive interface element displayed on the GUI, and "element" is a numerical identifier assigned to the interactive interface element displayed on the GUI.
(2) And the second callable function is used for inputting text aiming at any interface element.
For example, the second callable function can be expressed as input (element: int, text_input: str). The second callable function is used for text input, "element" is a numeric identifier assigned to the interactive interface element of the GUI display, and "text_input" is an input string.
(3) And the third callable function is used for representing the sliding track of the hand pointer on the graphical user interface to be tested.
Illustratively, the third callable function can be expressed as a wipe (direction). This third callable function is used to slide the smartphone screen, representing the finger's sliding track on the screen, with the sliding distance defaulting to the distance of sliding half the screen in some examples. "direction" is a string representing four directions, up (slide up), down (slide down), left (slide left), right (slide right).
(4) And a fourth callable function for pressing any interface element for a long time.
The fourth callable function can be expressed, for example, as long_press (element: int). The fourth callable function is for pressing an interface element displayed on the GUI for a long time. An "element" is a numerical identifier assigned to an interactive interface element of a GUI display.
(5) And fifth callable functions are used for verifying that any interface element exists in the graphical user interface to be tested.
Illustratively, the fifth callable function can be expressed as an element_exist. According to the target test case, the existence of a certain interface element needs to be checked on one GUI page. "content" means check content. An "element" is a numerical identifier assigned to an interactive interface element of a GUI display.
(6) And a sixth callable function for verifying that no interface element exists in the graphical user interface to be tested.
Illustratively, the sixth callable function can be expressed as an assast_not_exist (content: str). According to the target test case, it is required to verify that a certain interface element does not exist in one GUI page. "content" means check content. An "element" is a numerical identifier assigned to an interactive interface element of a GUI display.
The conditional callable functions described above are exemplary only, are not limiting, and individual callable functions may be omitted or combined.
It should be noted that S204-S205 are one implementation of S102, and currently, S102 has other implementations, which are not limited herein.
S206, calling the callable functions corresponding to the test actions according to the execution sequence, and executing the test actions aiming at the target interface elements to obtain parameters returned by the callable functions as test results.
In S205, when the large model generates the test actions, corresponding callable functions are allocated to each test action to implement the test action. In S206, the executor sequentially calls the corresponding functions according to the test actions and the execution sequences output by the large model, that is, the test paths, and executes the callable functions on the target interface element, so as to obtain the parameters returned by the callable functions as test results, thereby realizing automatic test of each test case of the GUI.
It should be noted that S206 is one implementation of S103, and currently, S103 has other implementations, which are not limited herein.
S207, establishing a mapping relation among the target test case, the test action, the graphical user interface to be tested and the test result, and storing the mapping relation in at least one of a case memory and an automatic test case library.
In the method provided by the disclosure, each time a target test case is executed, a mapping relation among the target test case, the test action, the graphical user interface to be tested and the test result can be established, and the data with the mapping relation is stored as historical data into at least one of a case memory and an automatic test case library. And after the cut target test case is obtained, performing similarity retrieval in an automatic test case library based on the historical test case to obtain the historical test case with the similarity higher than a preset threshold value. The target test case, the test action, the graphical user interface to be tested and the test result can be stored in a vector form in an automatic test case library so as to be convenient for searching and archiving, and the original data of the target test case, the test action, the graphical user interface to be tested and the test result can be stored in a case memory so as to be convenient for expanding application based on the original data.
S208, inputting the target test case, the test action, the graphical user interface to be tested, the graphical user interface after the automatic test is finished and the test result into the large model, determining the correctness of the automatic test based on the large model, and obtaining correction suggestion information output by the large model.
In some cases, to avoid errors in the generation and execution of test actions, a correction mechanism is introduced. The method comprises the steps of inputting a target test case, a test action, a graphical user interface to be tested, a graphical user interface after automatic test and a test result into a large model, judging the correctness of the automatic test through the generalization capability of the large model, in other words, judging whether the automatic test is performed according to expected evolution, generating correction suggestion information based on the judgment result, and if the correctness is judged to be qualified, the correction suggestion can be null. The correction proposal information indicates errors in the generation and execution of the test action and the way of modifying the errors, and by the way, the test error can be avoided, and the accuracy of the test result can be improved.
S209, inputting the target test case, the test action, the graphical user interface to be tested, the test result and the preset test requirement into a large model, determining whether the automatic test meets the test requirement or not through the large model, and obtaining test requirement summary information output by the large model.
The requirement summary information is information indicating whether the automatic test satisfies the test requirement and indicating the progress of the automatic test. Inputting the target test case, the test action, the graphical user interface to be tested, the test result and the preset test requirement into a large model, judging whether the automatic test meets the test requirement or not through the generalization capability of the large model, recording the test progress in the process of executing each test action, and finally generating test requirement summary information based on the judgment result and the test progress. By recording the test progress of each test action and whether the test requirement is met, the test action can be used as guiding information to guide the generation of the subsequent test action.
It should be noted that at least any one of steps S207 to 209 may be omitted, and the order of execution of steps S207 to S09 may be exchanged, which is not limited herein.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an exemplary test system of the method provided by the present disclosure. The method of the present disclosure may be applied in a test system such as that shown in fig. 8. The test system includes a judgment optimization module, a retrieval module, and a generation module, wherein the retrieval module may be omitted in some examples. The judging and optimizing module comprises a judging device and a clipping device, the searching module comprises a vector searching device and an actuator and is linked with an automatic test case set, and the generating module comprises a visual analyzer, an action generator, an actuator, a case memory, a corrector and a summarizer and is connected with equipment for loading application software.
Wherein, in the judgment optimization module:
The judging device is used for screening out target test cases which can be used for automatic testing in a preset test case set based on preset screening conditions.
The cutter is used for inputting the target test case and a preset prompt word into the large model, and removing invalid expressions in the target test case through the large model to obtain the cut target test case.
The search module comprises:
The vector retriever is used for retrieving the similarity between the historical test cases contained in the preset automatic test case library based on the target test cases, and obtaining the historical test cases with the similarity higher than a preset threshold value with the target test cases.
The executor is used for automatically testing the graphical user interface to be tested through the history test action corresponding to the history test case, determining the untested part in the graphical user interface to be tested, and inputting the untested part to the generating module.
The generation module comprises:
The visual parser is used for detecting interface elements contained in the graphical user interface to be tested.
The action generator is used for inputting a large model based on interface elements, target test cases and a preset callable function set to obtain test actions output by the large model.
The executor is used for calling the callable function corresponding to the test action according to the execution sequence, executing the test action aiming at the target interface element, and obtaining the parameter returned by the callable function as a test result.
The case memory is used for establishing a mapping relation among the target test case, the test action, the graphical user interface to be tested and the test result, and storing the mapping relation in the case memory.
The corrector is used for inputting the target test case, the test action, the graphical user interface to be tested, the graphical user interface after the automatic test is finished and the test result into the large model, determining the correctness of the automatic test based on the large model, and obtaining correction suggestion information output by the large model.
The summarizer is used for inputting the target test case, the test action, the graphical user interface to be tested, the test result and the preset test requirement into the large model, determining whether the automatic test meets the test requirement or not through the large model, and obtaining test requirement summarizing information output by the large model.
In disclosing a third embodiment, based on the same principle as fig. 1, fig. 9 shows a testing apparatus 90 of a graphical user interface provided by the third embodiment of the present disclosure, the apparatus comprising:
the clipping module 901 is configured to clip the target test case to obtain a clipped target test case;
The generating module 902 is configured to generate a test action based on the graphical user interface to be tested and the target test case after clipping;
The testing module 903 is configured to perform a testing action to automatically test the graphical user interface to be tested, so as to obtain a testing result.
In some examples, the generation module is specifically to:
detecting interface elements contained in a graphical user interface to be tested;
Inputting a large model based on interface elements, target test cases and a preset callable function set to obtain a test action output by the large model;
the test action at least comprises a target interface element corresponding to the test action, the position of the target interface element on the graphical user interface to be tested, and a callable function corresponding to the test action.
In some examples, the test action includes a plurality;
The generating module is used for inputting a large model based on interface elements, target test cases and preset callable function sets to obtain a test action output by the large model:
And inputting the large model based on the interface element, the target test case and the preset callable function set to obtain a plurality of test actions and execution sequences of the plurality of test actions output by the large model.
In some examples, the interface elements include interactive interface elements and text interface elements;
the generating module is used for detecting interface elements contained in the graphical user interface to be tested, and the interface elements are used for:
inputting the graphical user interface to be tested into an interactive element detection model to obtain an interactive interface element and a position thereof;
And inputting the graphic user interface to be tested into a text extraction model to obtain text interface elements and positions thereof.
In some examples, the callable function set includes at least one of the following callable functions:
A first callable function for clicking any interface element;
the second callable function is used for inputting text aiming at any interface element;
the third callable function is used for representing the sliding track of the hand pointer on the graphical user interface to be tested;
a fourth callable function for pressing any interface element for a long time;
A fifth callable function for verifying that any interface element exists in the graphical user interface to be tested;
And a sixth callable function for verifying that no interface element exists in the graphical user interface to be tested.
In some examples, the test module is specifically to:
And calling the callable function corresponding to the test action according to the execution sequence, and executing the test action aiming at the target interface element to obtain the parameter returned by the callable function as a test result.
In some examples, the clipping module is to:
And inputting the target test case and a preset prompt word into a large model, and removing invalid expressions in the target test case through the large model to obtain the cut target test case.
In some examples, the apparatus further comprises:
The retrieval module is used for carrying out similarity retrieval on the historical test cases contained in the preset automatic test case library based on the target test cases to obtain historical test cases with similarity higher than a preset threshold value with the target test cases;
automatically testing the graphical user interface to be tested through the history test action corresponding to the history test case;
and determining an untested part in the graphical user interface to be tested, executing the target test case based on the graphical user interface to be tested and the clipping based on the untested part, and generating a test action.
In some examples, the apparatus further comprises:
The verification module is used for inputting the target test case and the history test case into a large model, and verifying whether the description of the target test case and the description of the history test case are matched or not through the large model;
And executing the history test action corresponding to the history test case under the condition of matching, and automatically testing the graphical user interface to be tested.
In some examples, the apparatus further comprises:
the storage module is used for establishing a mapping relation among the target test case, the test action, the graphical user interface to be tested and the test result, and storing the mapping relation in at least one of the case memory and the automatic test case library.
In some examples, the apparatus further comprises:
And the correction module is used for inputting the target test case, the test action, the graphical user interface to be tested, the graphical user interface after the automatic test is finished and the test result into the large model, determining the correctness of the automatic test based on the large model, and obtaining correction suggestion information output by the large model.
In some examples, the apparatus further comprises:
The required module is used for inputting the target test case, the test action, the graphical user interface to be tested, the test result and the preset test requirement into the large model, determining whether the automatic test meets the test requirement or not through the large model, and obtaining test requirement summary information output by the large model.
In some examples, the apparatus further comprises:
The screening module is used for screening out target test cases which can be used for automatic testing from a preset test case set based on preset screening conditions.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 10 shows a schematic block diagram of an example electronic device 1000 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1002 or a computer program loaded from the storage unit 1002 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
The various components in device 1000 are connected to I/O interfaces 1005, including an input unit 1006, e.g., keyboard, mouse, etc., an output unit 1007, e.g., various types of displays, speakers, etc., a storage unit 1008, e.g., magnetic disk, optical disk, etc., and a communication unit 1009, e.g., network card, modem, wireless communication transceiver, etc. Communication unit 1009 allows device 1000 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The computing unit 1001 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the respective methods and processes described above, for example, a test method of a graphical user interface. For example, in some embodiments, the testing method of the graphical user interface may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM 1002 and/or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by computing unit 1001, one or more steps of the test method of the graphical user interface described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured with the testing method of the graphical user interface in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be a special or general purpose programmable processor, operable to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user, for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback), and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a Local Area Network (LAN), a Wide Area Network (WAN), and the Internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (25)

CN202411605187.8A2024-11-112024-11-11 Graphical user interface testing method, device, and electronic deviceActiveCN119645837B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411605187.8ACN119645837B (en)2024-11-112024-11-11 Graphical user interface testing method, device, and electronic device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411605187.8ACN119645837B (en)2024-11-112024-11-11 Graphical user interface testing method, device, and electronic device

Publications (2)

Publication NumberPublication Date
CN119645837A CN119645837A (en)2025-03-18
CN119645837Btrue CN119645837B (en)2025-10-03

Family

ID=94943100

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411605187.8AActiveCN119645837B (en)2024-11-112024-11-11 Graphical user interface testing method, device, and electronic device

Country Status (1)

CountryLink
CN (1)CN119645837B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2022097592A (en)*2021-06-242022-06-30阿波▲羅▼智▲聯▼(北京)科技有限公司Data synchronization method and device, electronic equipment, storage medium, and computer program
CN116126719A (en)*2023-02-082023-05-16北京百度网讯科技有限公司Interface testing method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20200019488A1 (en)*2018-07-122020-01-16Sap SeApplication Test Automate Generation Using Natural Language Processing and Machine Learning

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2022097592A (en)*2021-06-242022-06-30阿波▲羅▼智▲聯▼(北京)科技有限公司Data synchronization method and device, electronic equipment, storage medium, and computer program
CN116126719A (en)*2023-02-082023-05-16北京百度网讯科技有限公司Interface testing method and device, electronic equipment and storage medium

Also Published As

Publication numberPublication date
CN119645837A (en)2025-03-18

Similar Documents

PublicationPublication DateTitle
CN116521841B (en)Method, device, equipment and medium for generating reply information
KR20200108775A (en)Training corpus generating method, apparatus, device and storage medium
CN113553309B (en) A method, device, electronic device and storage medium for determining a log template
CN108228567B (en)Method and device for extracting short names of organizations
CN110647314B (en)Skill generation method and device and electronic equipment
WO2023142451A1 (en)Workflow generation methods and apparatuses, and electronic device
CN118170378B (en) Page generation method, device, electronic device, storage medium, and program product
CN117573507A (en) Test case generation method, device, electronic equipment and storage medium
CN112989066B (en) Data processing method and device, electronic device, computer readable medium
CN115328891A (en) Data migration method, device, storage medium and electronic device
CN119623630A (en) Question-answering method, system, electronic device and storage medium based on tool calling
CN119759356A (en) Code generation method, device and electronic device based on large model
CN118133794B (en)Table configuration method, apparatus, device and storage medium
CN119149695A (en)Conversation processing method and device based on large model, electronic equipment and storage medium
CN119645837B (en) Graphical user interface testing method, device, and electronic device
CN116992057B (en)Method, device and equipment for processing multimedia files in storage equipment
CN112767924A (en)Voice recognition method and device, electronic equipment and storage medium
CN118643165A (en) Method, device and product for adjusting output content of generative large language model
CN117909235A (en)Code risk detection method, training method and device of deep learning model
CN117290242A (en)Method and device for generating test case review report and electronic equipment
CN117290143A (en)Fault locating method, system, electronic equipment and computer readable storage medium
CN113742240B (en) User interface testing method, device, storage medium and electronic device
CN115687717A (en)Method, device and equipment for acquiring hook expression and computer readable storage medium
CN118568006B (en) Application interface awakening method, device, equipment, storage medium and program product
CN119476496B (en) Article generation method, device, equipment and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp