CN112506805B - User interface countdown testing method and device - Google Patents

User interface countdown testing method and device Download PDF

Info

Publication number
CN112506805B
CN112506805B CN202110122343.5A CN202110122343A CN112506805B CN 112506805 B CN112506805 B CN 112506805B CN 202110122343 A CN202110122343 A CN 202110122343A CN 112506805 B CN112506805 B CN 112506805B
Authority
CN
China
Prior art keywords
count
countdown
counter
reading
test result
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
CN202110122343.5A
Other languages
Chinese (zh)
Other versions
CN112506805A (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.)
Casco Signal Beijing Ltd
Original Assignee
Casco Signal Beijing 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 Casco Signal Beijing Ltd filed Critical Casco Signal Beijing Ltd
Priority to CN202110122343.5A priority Critical patent/CN112506805B/en
Publication of CN112506805A publication Critical patent/CN112506805A/en
Application granted granted Critical
Publication of CN112506805B publication Critical patent/CN112506805B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

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 application provides a user interface countdown testing method, which comprises the following steps: the method comprises the steps of obtaining attribute parameters of user interface countdown equipment, obtaining position information of an equipment display area according to the attribute parameters, determining a timing area according to the position information, reading the count of the timing area in a set time period according to a preset time interval, calculating a difference value between the current count and the last count when the current count and the last count are determined to be digital characters, accumulating 1 by a first counter when the difference value does not meet a preset condition, stopping reading and outputting unqualified test results when the accumulated value of the first counter reaches a first preset value, determining that the accumulated value of the first counter does not reach the first preset value when reading is finished, and outputting qualified test results. According to the method and the device, the user interface countdown can be automatically read, so that the reading countdown is faster, the testing efficiency of the user interface countdown is improved, the user interface countdown is automatically read, the reading error and the reading omission can be avoided, and the testing accuracy of the user interface countdown is improved.

Description

User interface countdown testing method and device
Technical Field
The invention relates to the technical field of rail transit, in particular to a user interface countdown testing method and device.
Background
The train control center User Interface (UI) countdown test is one of automated tests for rail transit. Since the accuracy and efficiency of the UI countdown test relate to whether other subsequent tests of the rail transit automation test can be executed correctly and the execution efficiency is high or low, the UI countdown test is a particularly critical test in the rail transit automation test.
In the prior art, the UI countdown test is mainly performed manually, and a tester needs to read and confirm the count display of the UI countdown to realize the UI countdown test.
The problems existing in the prior art are as follows: the UI countdown is manually read, because the initial numerical value of the counting display of certain UI countdown is large, the time consumption is often long when the counting display of a complete UI countdown is read, the testing efficiency is influenced, and testers need to continuously pay attention to the change of the UI countdown, so that the visual fatigue is easily caused, the UI countdown test is mistakenly and neglected, and the testing accuracy is influenced.
Disclosure of Invention
The embodiment of the application aims to provide a user interface countdown testing method and device, and solves the problems of low efficiency and low accuracy of UI countdown testing in the prior art.
In order to solve the above technical problem, an embodiment of the present application provides the following technical solutions:
a first aspect of the present application provides a method for testing countdown of a user interface, including:
acquiring attribute parameters of user interface countdown equipment;
acquiring the position information of the equipment display area according to the attribute parameters;
determining a timing area according to the position information;
reading the count displayed in the timing area within a set time period according to a preset time interval;
when the current count and the last count are determined to be digital characters, calculating the difference value of the current count and the last count;
when the difference value does not meet the preset condition, the first counter accumulates 1;
when the accumulated value of the first counter reaches a first preset value, stopping reading the count and outputting a test result, wherein the test result shows that the test is unqualified;
and when the reading is finished, determining that the accumulated value of the first counter does not reach a first preset value, and outputting a test result, wherein the test result shows that the test is qualified.
In some variations of the first aspect of the present application, the method further comprises:
when the current count is determined to be empty, the second counter increments by 1;
when the accumulated value of the second counter reaches a second preset value, stopping reading the count and outputting a test result, wherein the test result shows that the test is unqualified;
and when the reading is finished, when the accumulated value of the first counter is determined not to reach a first preset value and the accumulated value of the second counter is determined not to reach a second preset value, outputting a test result, wherein the test result shows that the test is qualified.
In some variations of the first aspect of the present application, the method further comprises: when the current count is determined to be a non-numeric character, the third counter accumulates 1;
when the accumulated value of the third counter reaches a third preset value, stopping reading the count and outputting a test result, wherein the test result shows that the test is unqualified;
and when the reading is finished, when the accumulated value of the first counter is determined not to reach a first preset value and the accumulated value of the third counter is determined not to reach a third preset value, outputting a test result, wherein the test result shows that the test is qualified.
In some variations of the first aspect of the present application, before calculating the difference, the method includes:
and calculating the difference value of the last counting and the current counting when the last counting does not meet the condition that the last counting is smaller than the fourth preset value and the current counting does not meet the condition of the first preset range.
In some variations of the first aspect of the present application, the attribute parameters include a name and a type of a user interface countdown device;
correspondingly, the position information of the device display area is obtained according to the attribute parameters, and the position information is as follows:
and acquiring the coordinates of the station yard graph editor in the display area of the equipment according to the name and the type.
In some variations of the first aspect of the present application, the method further comprises: before reading the count, a first counter is initialized.
A second aspect of the present application provides a user interface countdown testing apparatus, the apparatus comprising:
the first acquisition module is used for acquiring the attribute parameters of the user interface countdown equipment;
the second acquisition module is used for acquiring the position information of the equipment display area according to the attribute parameters;
the determining module is used for determining a timing area according to the position information;
the reading module is used for reading the count displayed in the timing area within a set time period according to a preset time interval;
the calculation module is used for calculating the difference value of the current count and the last count when the current count and the last count are determined to be digital characters;
the first accumulation module is used for accumulating 1 by the first counter when the difference value does not meet the preset condition;
the first output module is used for stopping reading the count and outputting a test result when the accumulated value of the first counter reaches a first preset value, wherein the test result shows that the test is unqualified;
and the second output module is used for determining that the accumulated value of the first counter does not reach the first preset value when reading is finished, and outputting a test result, wherein the test result shows that the test is qualified.
In some variations of the first aspect of the present application, the apparatus further comprises:
the second accumulation module is used for accumulating 1 by the second counter when the current count is determined to be null;
the third output module is used for stopping reading the count and outputting a test result when the accumulated value of the second counter reaches a second preset value, wherein the test result shows that the test is unqualified;
and the fourth output module is used for outputting a test result when the accumulated value of the first counter does not reach the first preset value and the accumulated value of the second counter does not reach the second preset value after reading is finished, and the test result shows that the test is qualified.
A third aspect of the present application provides an electronic device, comprising: at least one processor; and at least one memory, bus connected with the processor; the processor and the memory complete mutual communication through the bus; the processor is configured to invoke the program instructions in the memory to perform the user interface countdown testing method according to the first aspect or any of the optional embodiments of the first aspect.
A fourth aspect of the present application provides a computer-readable storage medium, where the storage medium includes a stored program, where when the program runs, the apparatus on which the storage medium is located is controlled to execute the method for testing countdown of a user interface according to the first aspect or any one of the optional embodiments of the first aspect.
Compared with the prior art, the user interface countdown testing method provided by the first aspect of the application includes the steps of obtaining attribute parameters of user interface countdown equipment, obtaining position information of an equipment display area according to the attribute parameters, determining a timing area according to the position information, reading counts displayed by the timing area within a set time period according to preset time intervals, calculating a difference value between the current count and the last count when the current count and the last count are determined to be digital characters, accumulating 1 by a first counter when the difference value does not meet preset conditions, stopping reading the counts and outputting testing results when the accumulated value of the first counter reaches a first preset value, wherein the testing results show that the test is unqualified, and outputting the testing results when the reading is finished, confirming that the accumulated value of the first counter does not reach the first preset value; the UI countdown can be automatically read, the countdown value can be automatically and quickly read no matter how large the initial value of the UI countdown is, the time consumed for reading a complete UI countdown is short, the efficiency of reading the UI countdown is improved, and the efficiency of UI countdown testing is further improved; the UI countdown is automatically read, so that visual fatigue caused by continuous attention to the change of the UI countdown under the condition of manually reading the UI countdown can be avoided, errors and omissions of reading can not occur when the UI countdown is automatically read, the accuracy of reading the UI countdown can be ensured, and the accuracy of UI countdown testing is further improved; the problem that the efficiency and the accuracy of the UI countdown test are low in the prior art can be solved.
The user interface countdown testing device provided by the second aspect of the present application has the same beneficial effects as the user interface countdown testing method provided by the first aspect of the present application.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the present application are illustrated by way of example and not by way of limitation in the figures of the accompanying drawings and in which like reference numerals refer to similar or corresponding parts and in which:
FIG. 1 schematically illustrates a first flow chart of a user interface countdown testing method;
FIG. 2 schematically illustrates a flow chart two of a user interface countdown testing method;
FIG. 3 schematically illustrates a human countdown display diagram of a user interface countdown testing method;
FIG. 4 schematically illustrates a guided 15 second countdown display diagram of a user interface countdown testing method;
FIG. 5 schematically illustrates a guard unlock countdown display diagram of a user interface countdown testing method;
FIG. 6 schematically illustrates a block diagram of a user interface countdown testing device;
fig. 7 schematically shows a block diagram of an electronic device.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It should be noted that: unless otherwise defined, technical or scientific terms used herein shall have the ordinary meaning as understood by those of skill in the art to which this application belongs.
The method in the examples of the present invention will be described in detail below.
Fig. 1 schematically shows a first flowchart of a user interface countdown testing method in an embodiment of the present invention, and referring to fig. 1, the method may include:
s101, obtaining attribute parameters of user interface countdown equipment.
Specifically, the attribute parameters may include the type and name of the UI countdown device, and the like.
And S102, acquiring the position information of the equipment display area according to the attribute parameters.
Specifically, the position information of the display area of the UI countdown apparatus is acquired according to the attribute parameter of the UI countdown apparatus acquired in step S101. For example, location information of a display area of the device is acquired according to the type and name of the UI countdown device. The location information includes site map editor coordinates.
And S103, determining a timing area according to the position information.
Specifically, the timing area is determined based on the position information of the device display area acquired in step S102. The timing zone may be a search box. Illustratively, the search box may be determined based on the location information.
And S104, reading the count displayed in the timing area in the set time period according to the preset time interval.
Specifically, the count displayed in the timing area determined in step S103 in the set time period is read at preset time intervals. The preset time interval may be set according to the actual UI countdown device, and is not limited herein. For example, the preset time interval may be 7 counts read for 1 second.
And S105, when the current count and the last count are determined to be digital characters, calculating the difference value of the current count and the last count.
Specifically, the count read in step S104 includes a current count and a previous count, and when it is determined that the current count and the previous count read in step S104 are both digital characters, a difference between the current count and the previous count is calculated.
When it is determined that the current count and the last count are not both numeric characters, the difference between the current count and the last count is not calculated. That is, when either one of the current count and the last count is not a numeric character, or when neither the current count nor the last count is a numeric character, the difference between the current count and the last count is not calculated.
And S106, when the difference value does not meet the preset condition, the first counter accumulates 1.
Specifically, when the difference between the current count and the last count calculated according to step S105 does not satisfy the preset condition, the first counter increments by 1.
The preset condition may be that a difference between the current count and the last count is within a certain range. The preset condition may be set according to the type of the actual UI countdown device, and is not limited herein. The first counter is a counter for accumulating the total number of the difference between the current count and the last count which does not meet the preset condition.
And S107, stopping reading the count and outputting a test result when the accumulated value of the first counter reaches a first preset value.
Wherein the test result shows that the test is unqualified.
Specifically, when the difference between the current count and the last count does not meet the accumulated value of the preset condition and reaches a first preset value, the reading of the count is stopped, and a test result that the test is unqualified is output. The first preset value may be set according to the type of the actual UI countdown device, and the first preset value is not limited herein. For example, the first preset value for the human countdown may be set to 40 and the first preset value for the guard unlock countdown may be set to 4.
And S108, when the reading is finished, determining that the accumulated value of the first counter does not reach a first preset value, and outputting a test result.
Wherein, the test result shows that the test is qualified.
Specifically, when the reading count is finished, the accumulated value of the first counter is determined not to reach the first preset value, and a test result which is qualified in the test is output.
The user interface countdown testing method provided by the embodiment of the invention comprises the steps of obtaining the type and the name of user interface countdown equipment, obtaining position information of an equipment display area according to the type and the name, determining a timing area according to the position information, reading the count displayed by the timing area in a set time period according to a preset time interval, calculating the difference value between the current count and the last count when the current count and the last count are determined to be digital characters, accumulating 1 by a first counter when the difference value does not meet a preset condition, stopping reading the count and outputting a testing result when the accumulated value of the first counter reaches a first preset value, wherein the testing result shows that the test is unqualified, and outputting the testing result when the reading is finished, determining that the accumulated value of the first counter does not reach the first preset value; the UI countdown can be automatically read, the countdown value can be automatically and quickly read no matter how large the initial value of the UI countdown is, the time consumed for reading a complete UI countdown is short, the efficiency of reading the UI countdown is improved, and the efficiency of UI countdown testing is further improved; the UI countdown is automatically read, so that visual fatigue caused by continuous attention to the change of the UI countdown under the condition of manually reading the UI countdown can be avoided, errors and omissions of reading can not occur when the UI countdown is automatically read, the accuracy of reading the UI countdown can be ensured, and the accuracy of UI countdown testing is further improved; the problem that the efficiency and the accuracy of the UI countdown test are low in the prior art can be solved.
Further, as a refinement and an extension of the method shown in fig. 1, an embodiment of the present invention further provides a user interface countdown testing method.
Fig. 2 schematically illustrates a second flowchart of a user interface countdown testing method in the embodiment of the present invention, and referring to fig. 2, the user interface countdown testing method provided in the embodiment of the present invention may include:
s201, acquiring the type and the name of the user interface countdown equipment.
Specifically, the types of UI countdown devices may include: human-solution countdown, guide countdown, and guard unlock countdown. The name of the UI countdown device may include: XC-05 and CD1 boot, etc. The UI countdown device is in units of seconds.
And S202, acquiring the coordinates of the station yard graph editor of the display area of the equipment according to the type and the name.
Specifically, the yard graph editor coordinates of the display area of the UI countdown apparatus are acquired according to the type and name of the UI countdown apparatus acquired in step S201.
Illustratively, acquiring human countdown station yard graph editor coordinates of an equipment display area according to human countdown and XC-05; guide 15 second countdown facility yard graph editor coordinates to guide the 15 second countdown and CD1 guide the acquisition facility display area; protected unlock countdown device yard graph editor coordinates for the device display area are obtained from the protected unlock countdown and the F2-04-protected unlock.
And S203, determining a timing area according to the coordinates of the station yard graph editor.
Specifically, the timing area is determined based on the yard graph editor coordinates of the device display area acquired in step S202.
As an optional implementation manner of the embodiment of the present invention, the timing area may be a search box, and the search box may be determined according to the coordinates of the yard graph editor. The specific operation of determining the search frame according to the station yard graph editor coordinates is to determine the station yard graph editor coordinates, expand the station yard graph editor coordinates from top to bottom and from left to right, ensure to frame the original station yard graph editor coordinates, and obtain the search frame.
Specifically, fig. 3 schematically shows a human countdown display diagram of the user interface countdown testing method, referring to fig. 3, XC-05 is a type of UI countdown device, 200 is a countdown display to be read, 200 is a unit of second, and the frame outside 200 is a search frame.
Fig. 4 schematically shows a schematic diagram of a guided 15-second countdown display of a user interface countdown testing method, and referring to fig. 4, a CD1 is guided as a type of UI countdown device, 5 is a countdown display that needs to be read, 5 is in units of seconds, and 5 is a search box outside.
Fig. 5 schematically shows a protection unlock countdown display diagram of the user interface countdown testing method, and referring to fig. 5, F2-04-protection unlock is a type of UI countdown device, 181 is a countdown display to be read, 181 is a unit of second, and the frame outside 181 is a search frame.
The method comprises the steps that as the types of the countdown devices are more, the countdown area for countdown of each type of UI is different from the search box, the coordinates of a station yard graph editor in the display area of the device are obtained through the obtained type and name of the UI countdown device, and then the timing area is determined according to the coordinates of the station yard graph editor; the specific type of the UI countdown equipment and the accurate search box under the specific type can be determined, and the accuracy of reading the count through the search box subsequently can be ensured through the more accurate search box.
And S204, initializing a first counter.
Specifically, the first counter is a counter that accumulates the total number of times that the difference between the current count and the previous count does not satisfy the preset condition. Initializing the first counter is setting the first counter to 0.
And S205, reading the count displayed in the timing area in the set time period according to the preset time interval.
Step S205 is the same as step S104, and therefore, will not be described herein again.
S206, determining whether the current count and the last count are both numeric characters, if yes, performing step S207, and if not, performing step S211 or step S214.
Specifically, according to the count read in step S205, including the current count and the previous count, it is determined whether the current count and the previous count are both numeric characters, and if yes, step S207 is executed; if not, step S211 or step S214 is executed. Step S211 and step S214 are steps executed in parallel.
Judging whether the current count and the last count are digital characters, if so, executing step S207; it is to be understood that when it is determined that the current count and the last count are both numeric characters, step S207 is performed.
When it is determined that the current count and the last count are not both numeric characters, step S211 and step S214 are performed. That is, when either one of the current count and the last count is not a numeric character, or both the current count and the last count are not a numeric character, step S211 and step S214 are performed.
And S207, when the last counting is judged not to meet the conditions that the last counting is smaller than the fourth preset value and the current counting does not meet the first preset range, calculating the difference value of the last counting and the current counting.
Specifically, it is determined whether the current count and the previous count are both numeric characters according to step S206, and if so, it is determined that the previous count does not satisfy the condition of being less than the fourth preset value and the current count does not satisfy the first preset range, a difference between the current count and the previous count is calculated. When the current count and the last count are determined to be digital characters, the difference between the current count and the last count is calculated when the last count is judged not to satisfy the condition that the last count is smaller than the fourth preset value and the current count does not satisfy the first preset range.
As an optional implementation manner of the embodiment of the present invention, when it is determined that the last count satisfies a condition that is smaller than the fourth preset value and the current count satisfies the first preset range, the reading of the count is stopped and a test result is output, where the test result indicates that the test is failed.
The fourth preset value and the first preset range may be manually set according to the type of the actual UI countdown device, and the fourth preset value and the first preset range are not limited herein.
For example, when it is determined that the last count does not satisfy less than 10 and the current count is not an arbitrary integer between 1 and 3, the difference between the two is calculated.
And S208, when the difference value does not meet the preset condition, the first counter accumulates 1.
Step S208 is the same as step S106, and therefore, is not described herein again.
And S209, stopping reading the count and outputting a test result when the accumulated value of the first counter reaches a first preset value.
Wherein the test result shows that the test is unqualified.
Step S209 is the same as step S107, and therefore, is not described herein again.
S210, when the reading is finished, determining that the accumulated value of the first counter does not reach a first preset value, and outputting a test result.
Wherein, the test result shows that the test is qualified.
Step S210 is the same as step S108, and therefore, will not be described herein again.
And S211, when the current count is determined to be null, the second counter accumulates 1.
Specifically, it is determined whether the current count and the last count are both numeric characters according to step S206, and if not, step S211 or step S214 is executed. Step S211 and step S214 are steps executed in parallel. According to step S206, it is determined whether the current count and the last count are both numeric characters, and if not, when the current count is determined to be empty, the second counter increments by 1, or step S214 is executed.
The second counter is a counter that accumulates the total number of times the current count is empty. The current count being empty may be a countdown showing nothing.
S212, when the accumulated value of the second counter reaches a second preset value, stopping reading the count and outputting a test result.
Wherein the test result shows that the test is unqualified.
Specifically, when the accumulated value of the second counter with the current count being empty is determined to reach a second preset value, reading the count is stopped, and a test result which is unqualified in test is output. The second preset value may be set according to the type of the actual UI countdown device, and is not limited herein. For example, the second preset value for the human countdown may be set to 50 and the second preset value for the guard unlock countdown may be set to 5. The second preset value is different from the first preset value.
And S213, when the reading is finished, determining that the accumulated value of the first counter does not reach the first preset value and the accumulated value of the second counter does not reach the second preset value, and outputting a test result.
Wherein, the test result shows that the test is qualified.
Specifically, when the reading count is finished, when the accumulated value of the first counter is determined not to reach the first preset value and the accumulated value of the second counter is determined not to reach the second preset value, a test result which is qualified in the test is output.
And S214, when the current count is determined to be a non-numeric character, the third counter accumulates 1.
Specifically, it is determined whether the current count and the last count are both numeric characters according to step S206, and if not, step S211 or step S214 is executed. Step S211 and step S214 are steps executed in parallel. According to step S206, it is determined whether the current count and the last count are both numeric characters, if not, the second counter increments by 1 when the current count is determined to be empty, or the third counter increments by 1 when the current count is determined to be a non-numeric character.
The third counter is a counter that accumulates the current count as the total number of non-numeric characters. The current count of non-numeric characters may be all characters that appear except numeric characters and are null. For example, the non-numeric character may be B or O.
And S215, stopping reading the count and outputting the test result when the accumulated value of the third counter reaches a third preset value.
Wherein the test result shows that the test is unqualified.
Specifically, when the accumulated value of a third counter with the current count of the non-numeric characters reaches a third preset value, the reading of the count is stopped, and a test result that the test is unqualified is output. The third preset value may be set according to the type of the actual UI countdown device, and the third preset value is not limited herein. For example, the third preset value for the human countdown may be set to 30, and the third preset value for the guard unlock countdown may be set to 3. The third preset value is different from the second preset value and the first preset value.
And S216, when the reading is finished, when the accumulated value of the first counter is determined not to reach the first preset value and the accumulated value of the third counter is determined not to reach the third preset value, outputting a test result.
Wherein, the test result shows that the test is qualified.
Specifically, when the reading count is finished, when the accumulated value of the first counter is determined not to reach the first preset value and the accumulated value of the third counter is determined not to reach the third preset value, a test result which is qualified in the test is output.
The following describes another embodiment of the user interface countdown testing method provided by the present invention, where the embodiment includes the following steps:
step one, acquiring the input parameters of the user interface countdown.
Wherein the input parameters include a type of the user interface countdown and a name of the user interface countdown.
And secondly, acquiring the coordinates of the station yard graph editor of the countdown display area of the user interface according to the type of the countdown of the user interface and the countdown name of the user interface.
And step three, setting a character reading frame for countdown of the user interface according to the coordinates of the station diagram editor, and initializing intermediate variables of the coordinates of the station diagram editor.
Wherein the character read box includes a count of user interface countdown.
Acquiring coordinates of a station yard graph editor (TLE) in a countdown display area of the device UI according to the input parameters, specifically, setting the total number of currently continuously read countdown to be empty, the total number of currently continuously read countdown to be non-numeric characters, and the total number of currently read non-valid countdown to be 0.
And step four, reading a plurality of counts of the countdown preset time period according to a preset time interval.
The preset time period is the whole countdown time period of the user interface countdown, the plurality of counts comprise a current countdown count and a last countdown count, and the last countdown count is a count display value of a last time interval of the current countdown count.
And step five, judging whether the current countdown counting is empty or not or whether the current countdown counting is a non-numeric character or not, if not, executing the step six, and if so, executing the step eight and the step nine.
Step six, judging whether the last countdown which is not empty and is not a non-numeric character is less than 10 and whether the current countdown is any integer between 1 and 3, if so, quitting reading the countdown display, and if so, displaying the wrong countdown, so as to indicate that the test is unqualified; if not, calculating the difference between the current countdown count and the last countdown count.
That is, whether the current countdown count is empty or whether the current countdown count is a non-numeric character is judged, if not, when the current countdown count is not empty and is not a non-numeric character, whether the last countdown is less than 10 or not and the current countdown is any integer between 1 and 3 is judged; if so, quitting reading the count-down display, and indicating that the test is unqualified if the count-down display is wrong; if not, calculating the difference between the current countdown count and the last countdown count.
Step seven, judging whether the difference value is within the preset range error, if so, determining that the counting is correct, reading a plurality of counts of the countdown time period again according to the preset time interval, if not, adding one to the total number of the difference values which are not within the preset error, judging whether the total number of the difference values which are not within the preset error is greater than the first preset value, if so, quitting the counting display of the countdown reading and determining that the count display value is wrong, and indicating that the test is unqualified; if not, determining that the counting is correct, and reading a plurality of counts of the countdown time period again according to the preset time interval.
Step eight, if the current count-down count is empty, adding one to the total number of the count display value which is empty, judging whether the total number of the current count-down count which is continuously empty is larger than a set value, if so, quitting reading the count-down count and determining that the count display value is wrong, and indicating that the test is unqualified; if not, determining that the counting is correct, and reading a plurality of counts of the countdown time period again according to the preset time interval.
A certain setting value may be set according to a type of the user interface countdown, and when the user interface countdown is an artificial countdown, the certain setting value may be 50. The number of the sequences may be more than ten, and the number of the sequences is not limited herein.
Step nine, if the current count-down count is not a non-numeric character, adding one to the total number of non-numeric characters with the count display value, judging whether the current count-down count is continuously a non-numeric character, if so, quitting reading the count-down count, determining that the count display value is wrong, and indicating that the test is unqualified; if not, determining that the counting is correct, and reading a plurality of counts of the countdown time period again according to the preset time interval.
Specifically, step eight and step nine are parallel steps. A certain setting value may be set according to a type of the user interface countdown, and when the user interface countdown is an artificial countdown, the certain setting value may be 50. The number of the sequences may be more than ten, and the number of the sequences is not limited herein.
According to the method, a dynamic character recognition method is adopted, and a test mode of manually recognizing and judging UI countdown display is replaced by a test mode of using a machine for testing. The visual fatigue caused by long-time observation of countdown by operators is avoided, the subsequent test is influenced, the condition of counting omission or misreading during manual reading is reduced, the time spent by testers in UI countdown test is greatly reduced, and the test efficiency and accuracy are improved.
Based on the same inventive concept, as an implementation of the user interface countdown testing method, the embodiment of the invention also provides a user interface countdown testing device. Fig. 6 is a block diagram of an apparatus according to an embodiment of the present invention, and referring to fig. 6, the apparatus may include: a first obtaining module 601, configured to obtain an attribute parameter of a user interface countdown device; a second obtaining module 602, configured to obtain location information of the device display area according to the attribute parameter; a determining module 603, configured to determine a timing area according to the location information; a reading module 604, configured to read a count displayed in the timing area within a set time period according to a preset time interval; a calculating module 605, configured to calculate a difference between the current count and the last count when it is determined that the current count and the last count are both digital characters; a first accumulation module 606, configured to accumulate 1 by a first counter when the difference does not satisfy a preset condition; a first output module 607, configured to stop reading the count and output a test result when the accumulated value of the first counter reaches a first preset value, where the test result indicates that the test is failed; and a second output module 608, configured to determine that the accumulated value of the first counter does not reach the first preset value when reading is finished, and output a test result, where the test result indicates that the test is qualified.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes a second accumulating module 609, configured to accumulate 1 in the second counter when it is determined that the current count is empty; a third output module 610, configured to stop reading the count and output a test result when the accumulated value of the second counter reaches a second preset value, where the test result indicates that the test is not qualified; the fourth output module 611 is configured to, when the reading is finished, determine that the accumulated value of the first counter does not reach the first preset value and the accumulated value of the second counter does not reach the second preset value, output a test result, where the test result indicates that the test is qualified.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes a third accumulation module 612, configured to accumulate 1 by the third counter when it is determined that the current count is a non-numeric character; a fifth output module 613, configured to stop reading the count and output a test result when the accumulated value of the third counter reaches a third preset value, where the test result indicates that the test is not qualified; and a sixth output module 614, configured to, when reading is finished, determine that the accumulated value of the first counter does not reach the first preset value and the accumulated value of the third counter does not reach the third preset value, output a test result, where the test result indicates that the test is qualified.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes a first calculating module 615, configured to calculate a difference between the previous count and the current count when it is determined that the previous count does not satisfy a condition that is smaller than a fourth preset value and the current count does not satisfy a first preset range before the difference between the previous count and the current count is calculated.
As an alternative implementation manner of the embodiment of the present invention, the second obtaining module 602 is further configured to obtain the coordinates of the yard graph editor in the display area of the device according to the attribute parameters including the name and the type of the user interface countdown device.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes an initializing module 616, configured to initialize the first counter before reading the count.
Based on the same inventive concept, the embodiment of the invention also provides electronic equipment. Fig. 7 is a structural diagram of an electronic device in an embodiment of the present invention, and referring to fig. 7, the electronic device 70 may include: at least one processor 701; and at least one memory 702, bus 703 connected to processor 701; the processor 701 and the memory 702 complete mutual communication through a bus 703; the processor 701 is configured to call program instructions in the memory 702 to execute the user interface countdown testing method in one or more embodiments described above.
Here, it should be noted that: the above description of the user interface countdown testing apparatus embodiment is similar to the description of the method embodiment described above, and has similar beneficial effects to the method embodiment. For technical details not disclosed in the embodiments of the user interface countdown testing apparatus according to the embodiments of the present invention, please refer to the description of the method embodiments of the present invention for understanding.
Based on the same inventive concept, the embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a stored program, and when the program runs, the apparatus on which the storage medium is located is controlled to execute the method in one or more embodiments described above.
Here, it should be noted that: the above description of the computer-readable storage medium embodiments is similar to the description of the method embodiments described above, with similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the computer-readable storage medium of the embodiments of the present invention, reference is made to the description of the method embodiments of the present invention for understanding.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A user interface countdown testing method, the method comprising:
acquiring attribute parameters of user interface countdown equipment;
acquiring position information of a device display area according to the attribute parameters;
determining a timing area according to the position information;
reading the count displayed in the timing area within a set time period according to a preset time interval;
when the current count and the last count are determined to be digital characters, calculating the difference value of the current count and the last count;
when the difference value does not meet the preset condition, the first counter accumulates 1;
when the accumulated value of the first counter reaches a first preset value, stopping reading the count and outputting a test result, wherein the test result shows that the test is unqualified;
and when the reading is finished, determining that the accumulated value of the first counter does not reach a first preset value, and outputting a test result, wherein the test result shows that the test is qualified.
2. The method of claim 1, further comprising:
when the current count is determined to be empty, the second counter increments by 1;
when the accumulated value of the second counter reaches a second preset value, stopping reading the count and outputting a test result, wherein the test result shows that the test is unqualified;
and when the reading is finished, when the accumulated value of the first counter is determined not to reach a first preset value and the accumulated value of the second counter is determined not to reach a second preset value, outputting a test result, wherein the test result shows that the test is qualified.
3. The method of claim 1, further comprising:
when the current count is determined to be a non-numeric character, the third counter accumulates 1;
when the accumulated value of the third counter reaches a third preset value, stopping reading the count and outputting a test result, wherein the test result shows that the test is unqualified;
and when the reading is finished, when the accumulated value of the first counter is determined not to reach a first preset value and the accumulated value of the third counter is determined not to reach a third preset value, outputting a test result, wherein the test result shows that the test is qualified.
4. The method of claim 1, wherein prior to calculating the difference between the two, the method further comprises:
and calculating the difference value of the last counting and the current counting when the last counting does not meet the condition that the last counting is smaller than the fourth preset value and the current counting does not meet the condition of the first preset range.
5. The method of claim 1, wherein the attribute parameters include a name and a type of a user interface countdown device;
correspondingly, the position information of the device display area is obtained according to the attribute parameters, and the position information is as follows:
and acquiring the coordinates of the station yard graph editor in the display area of the equipment according to the name and the type.
6. The method of claim 1, further comprising: before reading the count, a first counter is initialized.
7. A user interface countdown testing apparatus, wherein the apparatus comprises:
the first acquisition module is used for acquiring the attribute parameters of the user interface countdown equipment;
the second acquisition module is used for acquiring the position information of the equipment display area according to the attribute parameters;
the determining module is used for determining a timing area according to the position information;
the reading module is used for reading the count displayed in the timing area within a set time period according to a preset time interval;
the calculation module is used for calculating the difference value of the current count and the last count when the current count and the last count are determined to be digital characters;
the first accumulation module is used for accumulating 1 by the first counter when the difference value does not meet the preset condition;
the first output module is used for stopping reading the count and outputting a test result when the accumulated value of the first counter reaches a first preset value, wherein the test result shows that the test is unqualified;
and the second output module is used for determining that the accumulated value of the first counter does not reach the first preset value when reading is finished, and outputting a test result, wherein the test result shows that the test is qualified.
8. The apparatus of claim 7, further comprising:
the second accumulation module is used for accumulating 1 by the second counter when the current count is determined to be null;
the third output module is used for stopping reading the count and outputting a test result when the accumulated value of the second counter reaches a second preset value, wherein the test result shows that the test is unqualified;
and the fourth output module is used for outputting a test result when the accumulated value of the first counter does not reach the first preset value and the accumulated value of the second counter does not reach the second preset value after reading is finished, and the test result shows that the test is qualified.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor;
and at least one memory, bus connected with the processor;
the processor and the memory complete mutual communication through the bus; the processor is configured to invoke program instructions in the memory to perform the user interface countdown testing method of any of claims 1 to 6.
10. A computer-readable storage medium, characterized in that the storage medium comprises a stored program, wherein the program, when executed, controls a device on which the storage medium is located to perform a user interface countdown testing method according to any one of claims 1 to 6.
CN202110122343.5A 2021-01-29 2021-01-29 User interface countdown testing method and device Active CN112506805B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110122343.5A CN112506805B (en) 2021-01-29 2021-01-29 User interface countdown testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110122343.5A CN112506805B (en) 2021-01-29 2021-01-29 User interface countdown testing method and device

Publications (2)

Publication Number Publication Date
CN112506805A CN112506805A (en) 2021-03-16
CN112506805B true CN112506805B (en) 2021-06-15

Family

ID=74952477

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110122343.5A Active CN112506805B (en) 2021-01-29 2021-01-29 User interface countdown testing method and device

Country Status (1)

Country Link
CN (1) CN112506805B (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102736967A (en) * 2011-04-13 2012-10-17 鸿富锦精密工业(深圳)有限公司 Test system and method of watchdog timer
US20190325470A1 (en) * 2018-04-24 2019-10-24 Capital One Services, Llc Swag weighted inventory fast tracker
CN112241504A (en) * 2019-07-16 2021-01-19 腾讯科技(深圳)有限公司 Timing method and timing device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向多核DSP的看门狗定时器设计;章磊等;《第十八届计算机工程与工艺年会暨第四届微处理器技术论坛论文集》;20201231;第496-501页 *

Also Published As

Publication number Publication date
CN112506805A (en) 2021-03-16

Similar Documents

Publication Publication Date Title
US11568429B2 (en) Demand forecasting method and demand forecasting apparatus
CN111626046B (en) Correlation verification method for positions of telemetering text primitives and equipment primitives of transformer substation
CN116128312B (en) Dam safety early warning method and system based on monitoring data analysis
US20220035356A1 (en) Equipment failure diagnosis support system and equipment failure diagnosis support method
CN101241018A (en) Indicating instrument full-automatic test method based on computer visual sense technology
CN104572999B (en) Heterogeneous data-based error data detection method and device
CN105653521A (en) Data verification method and device
CN112506757A (en) Automatic test method, system, computer device and medium thereof
CN112506805B (en) User interface countdown testing method and device
CN105372545A (en) A cable error prevention method based on code identification
CN112637888B (en) Coverage hole area identification method, device, equipment and readable storage medium
JP2013182468A (en) Parameter value setting error detection system, parameter value setting error detection method and parameter value setting error detection program
CN113608089B (en) SOA test method, system and device for switching power supply MOS tube and readable storage medium
CN111881259B (en) Equipment fault probability assessment method and system based on text mining
KR101675986B1 (en) Method and apparatus for analyzing safety of automotive software
CN117639086A (en) Topology identification function evaluation method and device for power distribution area
CN114305316A (en) Vision detection method and system, vision detection all-in-one machine and storage medium
CN114398940A (en) Equipment fault diagnosis method and system for Internet of vehicles
CN114612889A (en) Instrument information acquisition method and system, electronic equipment and storage medium
CN110941932B (en) Demand modeling and verifying method for hardware logic design
CN109639520B (en) Computer-aided test method for network communication of reactor protection system
CN111090037A (en) Reliability detection method for instrument control card
CN112327800A (en) Vehicle detection method and device and diagnosis equipment
CN106250280B (en) Clock signal testing method and device
CN115860316B (en) Method, apparatus and storage medium for determining inspection requirements of a product, and identifying a product

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