CN111651368B - User graphical interface testing method and computer readable storage medium - Google Patents

User graphical interface testing method and computer readable storage medium Download PDF

Info

Publication number
CN111651368B
CN111651368B CN202010769772.7A CN202010769772A CN111651368B CN 111651368 B CN111651368 B CN 111651368B CN 202010769772 A CN202010769772 A CN 202010769772A CN 111651368 B CN111651368 B CN 111651368B
Authority
CN
China
Prior art keywords
window
graphical interface
user graphical
relative offset
coordinates
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
CN202010769772.7A
Other languages
Chinese (zh)
Other versions
CN111651368A (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 Zhixiang Technology Co Ltd
Original Assignee
Beijing Zhixiang 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 Zhixiang Technology Co Ltd filed Critical Beijing Zhixiang Technology Co Ltd
Priority to CN202010769772.7A priority Critical patent/CN111651368B/en
Publication of CN111651368A publication Critical patent/CN111651368A/en
Application granted granted Critical
Publication of CN111651368B publication Critical patent/CN111651368B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management

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)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a user graphic interface test method and a computer readable storage medium, when the running environments of a test system and a recording system are inconsistent, the relative offset of window elements of the test system and the recording system is firstly obtained through calculation, then the actual position of the window elements is obtained through calculation according to the relative offset, and finally the user graphic interface test is carried out based on the actual position of the window elements, so that when the running environments of the test system and the recording system are inconsistent, the accurate test of a user graphic interface is realized, and the problem that the test environment is inconsistent with the recording environment and the user graphic interface cannot be accurately tested is effectively solved.

Description

User graphical interface testing method and computer readable storage medium
Technical Field
The invention relates to the technical field of automatic testing, in particular to a user graphical interface testing method and a computer readable storage medium.
Background
The existing test scheme of the user graphical interface is as follows: coordinate matching method and image matching method. The coordinate matching method is that a tester records and stores the coordinates and the action instructions of each window element of the target system through a recorder in advance, the tester positions the window elements of the target system by using the coordinates, and the mouse or keyboard operation is completed according to the action instructions, so that the test purpose is achieved. The image matching method is that a tester records and stores the screenshot and the action instruction of each window element of the target system through a recorder in advance, the tester positions the window or control of the target system by using the identification screenshot, and the mouse or keyboard operation is completed according to the action instruction, so that the test purpose is achieved.
However, both the coordinate matching method and the image matching method require that the test environment of the target system and the recording environment must be consistent, and once the resolution of the operating environment or the operating system is changed, the test result will be affected.
Disclosure of Invention
The invention provides a user graphical interface testing method based on coordinate offset and a computer readable storage medium, which are used for solving the problem that the user graphical interface cannot be accurately tested due to the fact that a testing environment is inconsistent with a recording environment when the user graphical interface is tested in the prior art.
In a first aspect, the present invention provides a method for testing a graphical user interface, including: acquiring relative offset coordinates of window elements of a user graphical interface to be tested; calculating the actual coordinates of the current window elements according to the relative offset coordinates, and testing the user graphical interface based on the actual coordinates of the window elements; wherein one or more of the window elements are included within the user graphical interface.
Optionally, the obtaining of the relative offset coordinates of the window element of the graphical user interface to be tested includes: judging the following two aspects: recording whether the screen resolution of the user graphical interface is consistent with the screen resolution of the user graphical interface to be tested or not; in a second aspect, whether the operating system recording the user graphical interface is consistent with the operating system of the user graphical interface to be tested or not is judged, and if only the first aspect is inconsistent, the relative offset coordinate is obtained based on the screen resolution of the recorded user graphical interface and the screen resolution of the user graphical interface to be tested; if only the second aspect is inconsistent, acquiring the relative offset coordinate based on an operating system recording the user graphical interface and an operating system of the user graphical interface to be tested; and if the first aspect is not consistent with the second aspect, acquiring the relative offset coordinate based on the screen resolution and the operating system for recording the user graphical interface and the screen resolution and the operating system for testing the user graphical interface.
Optionally, the acquiring the relative offset coordinate includes: respectively calculating the screen resolutions and the screen resolutions of the operation systems and the relative offset coordinates of window elements between the operation systems by taking any screen resolution and any operation system as references, and carrying out one-to-one correspondence on the screen resolutions and the operation systems which generate the relative offset coordinates and storing the screen resolutions and the operation systems which generate the relative offset coordinates into a preset relative offset coordinate table; and determining the relative offset coordinates of the window elements of the graphical user interface to be tested based on the screen resolution and the operating system of the recorded graphical user interface, the screen resolution and the operating system of the graphical user interface to be tested and the preset relative offset coordinate table.
Optionally, the calculating the relative offset coordinates of the window elements between the respective screen resolutions and the respective operating systems and the reference screen resolution and operating system respectively comprises: and sequentially and respectively acquiring the screen resolution and the relative position of each window element in the user graphical interface of each operating system, comparing the relative position of each window element with the reference screen resolution and the relative position of each window element in the user graphical interface of the operating system, and calculating to obtain the relative offset coordinate of the window element.
Optionally, when the window element is an area window element, the obtaining the relative offset coordinate includes: acquiring the position of a preset window coordinate in the recorded user graphical interface, acquiring the position of a preset window coordinate in the user graphical interface to be tested, comparing the position offset coordinates of the preset window coordinate during recording and testing, and taking the position offset coordinate of the preset window coordinate as the relative offset coordinate of a window element of the user graphical interface to be tested; or, carrying out image matching and positioning on the recorded user graphical interface window element and the user graphical interface window element to be tested to determine the relative offset coordinate of the user graphical interface window element to be tested; or carrying out optical character OCR (optical character recognition) matching positioning on the recorded window element in the user graphical interface and the window element in the user graphical interface to be tested so as to determine the relative offset coordinate of the window element of the user graphical interface to be tested.
Optionally, the preset window coordinates include window center coordinates and window corner position coordinates.
Optionally, when the window element is a dot window element, the obtaining the relative offset coordinate includes: setting a reference window element, and taking the position offset coordinate between the reference window element in the recorded user graphical interface and the reference window element in the user graphical interface to be tested as the relative offset coordinate of the window element of the user graphical interface to be tested.
Optionally, the calculating the actual coordinates of the current window element according to the relative offset coordinates includes: when the content and the size of each window element in a user graphical interface to be tested and a recorded user graphical interface are not changed, the starting coordinate of the user graphical interface is taken as a reference coordinate, and the relative offset coordinate of the window elements is added to obtain the actual coordinate of each window element; when the content or the size of the window elements in the user graphical interface to be tested and the recorded user graphical interface changes, the fixed invariant window elements in the tested and recorded user graphical interface are taken as reference coordinates, and the relative offset coordinates of the window elements are added to obtain the actual coordinates of each window element.
Optionally, the fixed invariant window elements comprise image window elements and text window elements.
In a second aspect, the present invention provides a computer-readable storage medium storing a signal-mapped computer program which, when executed by at least one processor, implements any of the graphical user interface testing methods described above.
The invention has the following beneficial effects:
the invention obtains the relative offset coordinate of the window element of the user graphical interface to be tested, calculates the actual coordinate of the current window element based on the relative offset coordinate, and then tests the user graphical interface according to the actual coordinate of the window element, thereby realizing the accurate test of the user graphical interface. That is to say, when the running environments of the test system and the recording system are inconsistent, the relative offset of the window elements of the test system and the recording system is firstly obtained through calculation, then the actual position of the window element is obtained through calculation according to the relative offset, and finally the user graphical interface is tested based on the actual position of the window element, so that when the running environments of the test system and the recording system are inconsistent, the accurate test of the user graphical interface is realized, and the problem that the test environment is inconsistent with the recording environment and the user graphical interface cannot be accurately tested is effectively solved.
Drawings
Fig. 1 is a schematic flowchart of a method for testing a gui according to a first embodiment of the present invention.
Detailed Description
Aiming at the problem that the graphical user interface is tested inaccurately when the testing environment is inconsistent with the recording environment in the prior art, the graphical user interface is tested accurately by acquiring the relative offset of the window elements of the testing system and the recording system, calculating the actual position of the window elements according to the relative offset and finally testing the graphical user interface based on the actual position of the window elements. The present invention will be described in further detail below with reference to the drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
The first embodiment of the present invention provides a method for testing a graphical user interface, and referring to fig. 1, the method includes:
s101, obtaining relative offset coordinates of window elements of a user graphical interface to be tested;
it should be noted that, because the operating environment of the testing system (i.e. the system corresponding to the gui to be tested, or may also be referred to as a target system) may be inconsistent with the operating environment of the recording system for recording the gui, for example, the screen resolution of the testing system or the screen resolution of the operating system is different from the screen resolution or the operating system of the recording system, and in the case that the screen resolution or the operating system is inconsistent, there will be a certain offset in the images of the two guis, and if the offset is not taken into account, the gui is directly tested, and the result is definitely inaccurate, based on this, the embodiment of the present invention first obtains the relative offset coordinates of the window element of the gui to be tested and tests the gui on the basis of the relative offset coordinates, thereby obtaining more accurate test results.
Wherein, the user graphic interface in the embodiment of the invention comprises one or more window elements.
And S102, calculating the actual coordinate of the current window element according to the relative offset coordinate, and testing the user graphical interface based on the actual coordinate of the window element.
That is, in the embodiment of the present invention, the relative offset of the window element of the gui is considered, and the gui is tested based on the relative offset coordinate of the window element of the gui to be tested, so as to obtain a more accurate test result, so that the method of the embodiment of the present invention can implement the gui testing on target systems of various screen resolutions and operating systems, that is, the embodiment of the present invention improves the accuracy of positioning the window element, and can implement compatibility with operating systems of multiple versions (such as win7/win10/win8, etc.), thereby expanding the universality and compatibility of the gui testing on the basis of improving the testing accuracy.
In specific implementation, in the embodiment of the present invention, the obtaining the relative offset coordinate of the window element of the user graphical interface to be tested includes:
judging whether the screen resolution of the recorded user graphic interface is consistent with the screen resolution of the tested user graphic interface or not, and whether the operating system of the recorded user graphic interface is consistent with the operating system of the tested user graphic interface or not,
if the two resolutions are not consistent, acquiring the relative offset coordinate based on the screen resolution of the recorded user graphic interface and the screen resolution of the tested user graphic interface;
if the two systems are not consistent, acquiring the relative offset coordinate based on the operating system for recording the user graphic interface and the operating system for testing the user graphic interface;
and if the screen resolution and the operating system of the user graphical interface are not consistent, acquiring the relative offset coordinate based on recording the screen resolution and the operating system of the user graphical interface and testing the screen resolution and the operating system of the user graphical interface.
That is to say, before obtaining the relative offset coordinates of the window elements of the gui to be tested, the embodiment of the present invention needs to first determine whether the screen resolutions of the recording system and the testing system are consistent with each other or not, and if the screen resolutions are consistent with each other, the gui testing is directly performed, or if the screen resolutions are inconsistent with each other, the relative offset coordinates of the window elements are obtained based on the inconsistency.
Specifically, the acquiring the relative offset coordinate according to the embodiment of the present invention includes:
respectively calculating the screen resolutions and the screen resolutions of the operation systems and the relative offset coordinates of window elements between the operation systems by taking any screen resolution and any operation system as references, and carrying out one-to-one correspondence on the screen resolutions and the operation systems which generate the relative offset coordinates and storing the screen resolutions and the operation systems which generate the relative offset coordinates into a preset relative offset coordinate table;
and determining the relative offset coordinates of the window elements of the graphical user interface to be tested based on the screen resolution and the operating system of the recorded graphical user interface, the screen resolution and the operating system of the tested graphical user interface and the preset relative offset coordinate table.
That is, in the embodiment of the present invention, based on target systems with different screen resolutions and different operating systems, a relative offset of a window element between different target systems is obtained based on a target system of any one of the screen resolutions and the operating systems, and is stored in a preset table, and then the relative offset is obtained based on the screen resolutions and the operating systems of the testing system and the recording system, and a test on a graphical user interface is performed according to the relative offset, thereby greatly facilitating a tester to perform the test.
Specifically, the calculating of the relative offset coordinates of the window elements between each screen resolution and each operating system and the screen resolution and the operating system of the reference respectively according to the embodiment of the present invention includes:
and sequentially and respectively acquiring the screen resolution and the relative position of each window element in the user graphical interface of each operating system, comparing the relative position of each window element with the reference screen resolution and the relative position of each window element in the user graphical interface of the operating system, and calculating to obtain the relative offset coordinate of the window element.
That is, the embodiment of the present invention obtains the relative offset coordinates of the window elements by comparing the relative positions of the window elements of the respective target systems.
In specific implementation, the embodiment of the present invention may obtain the relative offset coordinates of the window element by any one of the following manners:
the first mode is as follows: and obtaining the position of a preset window coordinate in the recorded user graphical interface, obtaining the position of a preset window coordinate in the tested user graphical interface, comparing the position offset coordinates of the preset window coordinate during recording and testing, and taking the position offset coordinate of the preset window coordinate as the relative offset coordinate of the window element of the user graphical interface to be tested.
Wherein the preset window coordinates may be window center coordinates, window angular position coordinates, and the like.
The second mode is as follows: carrying out image matching and positioning on the recorded user graphical interface window element and the tested user graphical interface window element to determine the relative offset coordinate of the user graphical interface window element to be tested;
the third mode is as follows: and carrying out optical character OCR (optical character recognition) matching and positioning on the recorded window elements in the user graphical interface and the tested window elements in the user graphical interface to determine the relative offset coordinates of the window elements of the user graphical interface to be tested.
The fourth mode is that: setting a reference window element, and taking the position offset coordinate between the reference window element in the recorded user graphical interface and the reference window element in the tested user graphical interface as the relative offset coordinate of the window element of the user graphical interface to be tested.
That is to say, the embodiment of the present invention may acquire the relative offset coordinates of the window element through the various manners described above, and store the acquired relative offset coordinates in a one-to-one correspondence manner according to the specific screen resolution and the operating system of the target system, and certainly, in the specific implementation, a person skilled in the art may also acquire the relative offset coordinates through other manners, which is not limited by the present invention.
For example, a first screen resolution of a first target system, a first operating system, and a second screen resolution of a second target system, a second operating system, which generates relative offset coordinates with the first target system, are stored in a relative offset coordinate table for subsequent queries.
Briefly, the method for acquiring the relative offset coordinates of the window elements in the embodiment of the present invention includes:
relative offset coordinates based on window center coordinates;
relative offset coordinates based on the angular position coordinates of the window;
relative offset coordinates based on reference window elements (image matching location center coordinates);
relative offset coordinates based on reference window elements (OCR recognition location center coordinates).
It should be noted that, in the embodiment of the present invention, when the window element is a Region window element, the acquiring the relative offset coordinate includes: acquiring the position of a preset window coordinate in the recorded user graphical interface, acquiring the position of a preset window coordinate in the tested user graphical interface, comparing the position offset coordinates of the preset window coordinate during recording and testing, and taking the position offset coordinate of the preset window coordinate as the relative offset coordinate of the window element of the user graphical interface to be tested; or, carrying out image matching and positioning on the recorded user graphical interface window element and the tested user graphical interface window element to determine the relative offset coordinate of the user graphical interface window element to be tested; or carrying out optical character OCR matching positioning on the recorded user graphical interface window element and the tested user graphical interface window element to determine the relative offset coordinate of the user graphical interface window element to be tested.
That is, for the area window element, the embodiment of the present invention may directly locate the window element relative offset coordinates by relative window coordinates, image matching, or OCR matching methods.
And when the window element is a point Anchor window element, the obtaining the relative offset coordinate comprises: setting a reference window element, and taking the position offset coordinate between the reference window element in the recorded user graphical interface and the reference window element in the tested user graphical interface as the relative offset coordinate of the window element of the user graphical interface to be tested.
That is, for a point window element, the embodiment of the present invention needs to obtain a position of a reference window element, and add an offset to indirectly position a relative offset coordinate of the window element.
Further, in this embodiment of the present invention, the calculating the actual coordinates of the current window element according to the relative offset coordinates includes:
when the content and the size of each window element in the test system and the recording system are not changed, the actual coordinates of each window element are obtained by taking the starting coordinates of the user graphical interface as reference coordinates and adding the relative offset coordinates of the window elements;
when the content or the size of the window elements in the test system and the recording system changes, the fixed window elements in the test system and the recording system are used as reference coordinates, and the relative offset coordinates of the window elements are added to obtain the actual coordinates of each window element.
Specifically, for a target system with unchanged window content and size, namely a system of a user graphical interface to be tested, the actual coordinates of window elements can be calculated by taking the starting coordinates of the window as reference coordinates and adding offset coordinates relative to the window coordinates; for the variation of the window content and size, the actual coordinates of the window elements can be calculated by using the fixed invariant window elements (such as images, characters, etc.) as the reference coordinates and adding the offset coordinates relative to the invariant window elements.
After testing the graphical user interface based on the actual coordinates of the window elements, the method according to the embodiment of the present invention further includes:
and comparing the test result with a preset expected result, if the test result is consistent with the expected result, determining that the test result is correct, and if not, returning a test result which is wrong.
For better illustration of the present invention, the method of the present invention will be described below by taking a specific example as an example:
in order to improve the accuracy of positioning the window elements, the embodiment of the invention is compatible with operating systems (such as win7/win10/win 8) of multiple versions, and a coordinate migration method is provided for capturing the window elements. In order to improve the flexibility of the test case, a programmable method is provided for controlling the positioning and operation of the window elements.
The method of the embodiment of the invention comprises three processes of recording the offset coordinates of the window elements, programming the positioning and operation of the window elements and verifying the instruction return result.
The recording window element offset coordinate step includes: and the tester captures the relative offset coordinates of the window elements through the recorder to generate a window configuration file. And after the recorder is started, clicking a hot key to capture a target window, prompting a set name (the default is the process name of the target window) and a file storage path (the default is the current path), and clicking and determining after modification to generate a new window image. And drawing a plurality of element areas on the new window image by using a mouse, and clicking, storing and generating a window information configuration file. The recorder can capture and edit a plurality of window images, and the recording results of different images of the same window are uniformly stored in a designated window information file. And if different windows are grabbed, prompting the generation of a new window configuration file for saving. The recorder dynamically displays the information content of the window and provides a positioning test button.
For a target system with unchanged window content and size, the actual coordinates of window elements can be calculated by taking the starting coordinates of the window as reference coordinates and adding offset coordinates relative to the window coordinates; for the variation of window content and size, the actual coordinates of the window element can be calculated by using the fixed window element (such as image and character) as the reference coordinates and adding the offset coordinates relative to the fixed window element.
The method for acquiring the relative offset coordinates of the window elements comprises the following steps:
relative offset coordinates based on window center coordinates;
relative offset coordinates based on the angular position coordinates of the window;
relative offset coordinates based on reference window elements (image matching location center coordinates);
relative offset coordinates based on reference window elements (OCR recognition location center coordinates).
The window elements in the embodiments of the present invention are divided into two types:
for the Region window element: the relative offset coordinates of the window elements are located directly by relative window coordinates, image matching or OCR matching methods.
For Anchor window elements: the position of the reference window element is obtained, and the offset is added, so that the relative offset coordinate of the window element is indirectly positioned.
The window information file in the embodiment of the invention comprises the following contents:
basic information of programs and windows: process name, running path, parent process name, window title, size, etc.;
captured Window Image: the fields include:
label: window name (. cwinN N)
type element type window
coords: window coordinates
image file: window graphic File name (stored in images directory under holding path)
Region Item: the fields include:
region label: element names (default in. R initial sequence number naming)
type: region type region _ xy (xy represents location angle position: nw upper left corner, sw lower left corner, ne upper right corner, se lower right corner)
coords: region coordinates (angular coordinates relative to the window in which it is located)
ocr _ text: OCR characters
window label: name of window where it is
Anchor Item: the fields include:
anchor label: element names (named with A initial sequence number by default)
type element type anchor
coords: anchor region coordinates (center coordinates relative to reference region)
ocr _ text: OCR characters
reference region label: region label for positioning
The positioning and operating steps of the programming control window element in the embodiment of the invention comprise: the test machine analyzes the test instruction, starts a target system, obtains a reference coordinate of a start window, reads a relative offset coordinate of a window element from a configuration file, and calculates an actual coordinate of the window element; the test machine issues an operation instruction to the actual coordinates of the window elements and returns the window text information.
The abstract AUTOGUI class and WIN _ INST class are used to locate and manipulate window elements. The AUTOGUI class provides a basic positioning function and a keyboard and mouse input operation function which take screen coordinates as parameters; the WIN _ INST class provides functionality that is located and entered through window elements, which is commonly used by test scripts. The WIN _ INST method is shown in table 1:
table 1 test script basic parameter condition table
Figure 129742DEST_PATH_IMAGE001
Finally, verifying the instruction and returning the result, specifically, matching the window element returned result with the expected result through a tester in the embodiment of the invention, and if the returned result is consistent with the expected result, indicating that the test result is correct; if the returned result is inconsistent with the expected result, the test result is wrong.
Generally speaking, in the embodiment of the invention, when the operating environments of the test system and the recording system are inconsistent, the relative offset of the window elements of the test system and the recording system is obtained through calculation, then the actual position of the window element is calculated according to the relative offset, and finally the user graphical interface is tested based on the actual position of the window element, so that when the operating environments of the test system and the recording system are inconsistent, the accurate test of the user graphical interface is realized, and the problem that the test environment is inconsistent with the recording environment and the user graphical interface cannot be accurately tested is effectively solved.
A second embodiment of the invention provides a computer-readable storage medium storing a signal-mapped computer program which, when executed by at least one processor, implements a method for testing a graphical user interface as described in any of the first embodiments of the invention.
The contents of the embodiments of the present invention can be understood by referring to the first and second embodiments of the present invention, and will not be discussed in detail herein.
Although the preferred embodiments of the present invention have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, and the scope of the invention should not be limited to the embodiments described above.

Claims (9)

1. A user graphical interface testing method is characterized by comprising the following steps:
acquiring relative offset coordinates of window elements of a user graphical interface to be tested;
calculating the actual coordinates of the current window elements according to the relative offset coordinates, and testing the user graphical interface based on the actual coordinates of the window elements;
wherein one or more of the window elements are included within the user graphical interface;
the acquiring of the relative offset coordinates of the window elements of the graphical user interface to be tested includes:
judging the following two aspects: recording whether the screen resolution of the user graphical interface is consistent with the screen resolution of the user graphical interface to be tested or not; in a second aspect, whether the operating system recording the user graphical interface is consistent with the operating system of the user graphical interface to be tested,
if only the first aspect is inconsistent, acquiring the relative offset coordinate based on the screen resolution of the recorded user graphical interface and the screen resolution of the user graphical interface to be tested;
if only the second aspect is inconsistent, acquiring the relative offset coordinate based on an operating system recording the user graphical interface and an operating system of the user graphical interface to be tested;
and if the first aspect is not consistent with the second aspect, acquiring the relative offset coordinate based on the screen resolution and the operating system for recording the user graphical interface and the screen resolution and the operating system for testing the user graphical interface.
2. The method of claim 1, wherein said obtaining the relative offset coordinates comprises:
respectively calculating the relative offset coordinates of window elements between the rest screen resolutions and the operation systems and the screen resolutions and the operation systems used as the references by taking any screen resolution and any operation system for recording the graphical user interface as the references, and performing one-to-one correspondence on the screen resolutions and the operation systems generating the relative offset coordinates and storing the screen resolutions and the operation systems generating the relative offset coordinates into a preset relative offset coordinate table;
and determining the relative offset coordinates of the window elements of the graphical user interface to be tested based on the screen resolution and the operating system of the recorded graphical user interface, the screen resolution and the operating system of the graphical user interface to be tested and the preset relative offset coordinate table.
3. The method of claim 2, wherein calculating relative offset coordinates of window elements between the remaining respective screen resolutions and respective operating systems and the screen resolution and operating system as references, respectively, comprises:
and sequentially and respectively acquiring the screen resolution and the relative position of each window element in the user graphical interface of each operating system, comparing the relative position of each window element with the reference screen resolution and the relative position of each window element in the user graphical interface of the operating system, and calculating to obtain the relative offset coordinate of the window element.
4. The method of claim 1, wherein when the window element is a region window element, the obtaining the relative offset coordinates comprises:
acquiring the position of a preset window coordinate in the recorded user graphical interface, acquiring the position of a preset window coordinate in the user graphical interface to be tested, comparing the position offset coordinates of the preset window coordinate during recording and testing, and taking the position offset coordinate of the preset window coordinate as the relative offset coordinate of a window element of the user graphical interface to be tested;
or,
carrying out image matching and positioning on the recorded window elements in the user graphical interface and the window elements in the user graphical interface to be tested so as to determine the relative offset coordinates of the window elements of the user graphical interface to be tested;
or,
and carrying out optical character OCR (optical character recognition) matching and positioning on the recorded window elements in the user graphical interface and the window elements in the user graphical interface to be tested to determine the relative offset coordinates of the window elements of the user graphical interface to be tested.
5. The method of claim 4,
the preset window coordinates include window center coordinates and window angular position coordinates.
6. The method of claim 1, wherein when the window element is a point window element, said obtaining the relative offset coordinates comprises:
setting a reference window element, and taking the position offset coordinate between the reference window element in the recorded user graphical interface and the reference window element in the user graphical interface to be tested as the relative offset coordinate of the window element of the user graphical interface to be tested.
7. The method according to any one of claims 1-6, wherein said calculating actual coordinates of the current window element from said relative offset coordinates comprises:
when the content and the size of each window element in a user graphical interface to be tested and a recorded user graphical interface are not changed, the starting coordinate of the user graphical interface is taken as a reference coordinate, and the relative offset coordinate of the window elements is added to obtain the actual coordinate of each window element;
when the content or the size of the window elements in the user graphical interface to be tested and the recorded user graphical interface changes, the fixed invariant window elements in the tested and recorded user graphical interface are taken as reference coordinates, and the relative offset coordinates of the window elements are added to obtain the actual coordinates of each window element.
8. The method of claim 7,
the fixed window elements include image window elements and text window elements.
9. A computer-readable storage medium, characterized in that it stores a signal-mapped computer program which, when executed by at least one processor, implements a graphical user interface testing method according to any one of claims 1 to 8.
CN202010769772.7A 2020-08-04 2020-08-04 User graphical interface testing method and computer readable storage medium Active CN111651368B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010769772.7A CN111651368B (en) 2020-08-04 2020-08-04 User graphical interface testing method and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010769772.7A CN111651368B (en) 2020-08-04 2020-08-04 User graphical interface testing method and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111651368A CN111651368A (en) 2020-09-11
CN111651368B true CN111651368B (en) 2020-11-03

Family

ID=72351874

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010769772.7A Active CN111651368B (en) 2020-08-04 2020-08-04 User graphical interface testing method and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111651368B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112395201A (en) * 2020-11-26 2021-02-23 交控科技股份有限公司 ATS test method and device
CN112527683B (en) * 2020-12-24 2022-08-26 卡斯柯信号有限公司 Automatic interface test system for computer interlocking system and application
CN112685328B (en) * 2021-03-12 2021-06-08 北京志翔科技股份有限公司 Graphical interface testing method and device and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101395991B1 (en) * 2011-09-01 2014-05-19 엘지디스플레이 주식회사 Display having touch sensor and method for improving touch performance thereof
CN104519387A (en) * 2013-09-26 2015-04-15 中国电信股份有限公司 Method for realizing television remote control, remote controller and system
CN106095170B (en) * 2016-06-02 2019-07-09 深圳创维-Rgb电子有限公司 A kind of OSD trigger area offset correction method and system
CN107678594A (en) * 2017-09-30 2018-02-09 努比亚技术有限公司 Calibration method, device, terminal device and the storage medium of touch screen
CN108833912A (en) * 2018-08-22 2018-11-16 高新兴科技集团股份有限公司 A kind of measurement method and system of video camera machine core optical axis center and field angle

Also Published As

Publication number Publication date
CN111651368A (en) 2020-09-11

Similar Documents

Publication Publication Date Title
CN111651368B (en) User graphical interface testing method and computer readable storage medium
CN106776319B (en) Automatic test method and device
CN103377119B (en) A kind of non-standard control automated testing method and device
US20150378876A1 (en) Visual graphical user interface verification
US20110214107A1 (en) Method and system for testing graphical user interfaces
WO2021159736A1 (en) Application compatibility test method and apparatus, and computer device
CN108536597A (en) A kind of terminal test method, device, terminal device and storage medium
CN104268083A (en) Software automatic testing method and device
CN110765015A (en) Method for testing application to be tested and electronic equipment
CN103838674A (en) Intelligent testing robot based on digital image and use method thereof
US10705950B2 (en) Method and system for semi-automatic testing of program code for graphical user interfaces
CN108399125B (en) Automatic testing method and device, computer equipment and storage medium
CN111177009A (en) Script generation method and device, electronic equipment and storage medium
CN113076257A (en) Test script recording method, device, medium and computer equipment
CN114218072A (en) Test script generation method and device, storage medium and computer equipment
CN106507656A (en) Teaching of assembly positions
CN117349181A (en) Software testing method and device, readable storage medium and electronic equipment
US20210271588A1 (en) Rendering gui test object of application under test to reflect test information
CN112181809B (en) Graphic user interface automatic test method based on multiple positioning methods
JP2019106107A (en) Program, information processing apparatus, and screen test system
CN112559362B (en) Automatic testing method and testing device for dynamic user interface
CN114116474A (en) Software checking method and device, electronic equipment and storage medium
EP3574406B1 (en) Method and system for automated testing of computer program code
CN112188192A (en) Code stream adaptability test method, system, computer equipment and storage medium
CN111400193A (en) Test case generation method, device, equipment and storage medium

Legal Events

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