CN109062793B - Test method and device of roller control and electronic equipment - Google Patents

Test method and device of roller control and electronic equipment Download PDF

Info

Publication number
CN109062793B
CN109062793B CN201810812530.4A CN201810812530A CN109062793B CN 109062793 B CN109062793 B CN 109062793B CN 201810812530 A CN201810812530 A CN 201810812530A CN 109062793 B CN109062793 B CN 109062793B
Authority
CN
China
Prior art keywords
roller control
area
tested
control
target
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
CN201810812530.4A
Other languages
Chinese (zh)
Other versions
CN109062793A (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 Testin Information Technology Co Ltd
Original Assignee
Beijing Testin Information 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 Testin Information Technology Co Ltd filed Critical Beijing Testin Information Technology Co Ltd
Priority to CN201810812530.4A priority Critical patent/CN109062793B/en
Publication of CN109062793A publication Critical patent/CN109062793A/en
Application granted granted Critical
Publication of CN109062793B publication Critical patent/CN109062793B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Testing Of Devices, Machine Parts, Or Other Structures Thereof (AREA)

Abstract

The application discloses a method and a device for testing a roller control and electronic equipment thereof, which are used for solving the problems that in the prior art, more resources are consumed for testing various rollers and the efficiency is low. The method comprises the following steps: acquiring a target roller control, wherein the target roller control comprises a roller control to be tested; determining a rolling direction, a rolling amplitude and a test area in the target roller control; and testing the roller control to be tested on the test area based on the rolling direction and the rolling amplitude.

Description

Test method and device of roller control and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for testing a roller control, and an electronic device.
Background
With the rapid development of computer technology, the number of official applications, system-owned applications, and various open source applications has increased exponentially, and the types of scroll wheel controls used in these applications are also many.
However, in the prior art, for each type of wheel control, a special test program and an interface of the type of wheel control are required to test the wheel control of this type.
Obviously, the prior art described above needs to consume a lot of resources for testing various types of wheel controls, and the efficiency is also very low. Therefore, a method for testing a roller control is urgently needed to improve the testing efficiency of the roller control.
Disclosure of Invention
The embodiment of the application provides a method and a device for testing a roller control and electronic equipment, and aims to solve the problems that a large amount of resources are consumed and the efficiency is low in the method for testing the roller control in the prior art.
In order to solve the above technical problem, the embodiment of the present application is implemented as follows:
in a first aspect, a method for testing a roller control is provided, including:
acquiring a target roller control, wherein the target roller control comprises a roller control to be tested;
determining a rolling direction, a rolling amplitude and a test area in the target roller control;
and testing the roller control to be tested on the test area based on the rolling direction and the rolling amplitude.
In a second aspect, a testing apparatus for a roller control is provided, which includes:
the device comprises an acquisition unit, a detection unit and a control unit, wherein the acquisition unit is used for acquiring a target roller control which comprises a roller control to be tested;
the determining unit is used for determining a rolling direction, a rolling amplitude and a test area in the target roller control;
and the testing unit is used for testing the roller control to be tested on the testing area based on the rolling direction and the rolling amplitude.
In a third aspect, an electronic device is provided, which includes:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring a target roller control, wherein the target roller control comprises a roller control to be tested;
determining a rolling direction, a rolling amplitude and a test area in the target roller control;
and testing the roller control to be tested on the test area based on the rolling direction and the rolling amplitude.
In a fourth aspect, a computer-readable storage medium is presented, the computer-readable storage medium storing one or more programs that, when executed by an electronic device that includes a plurality of application programs, cause the electronic device to:
acquiring a target roller control, wherein the target roller control comprises a roller control to be tested;
determining a rolling direction, a rolling amplitude and a test area in the target roller control;
and testing the roller control to be tested on the test area based on the rolling direction and the rolling amplitude.
The embodiment of the application can at least achieve the following technical effects by adopting the technical scheme:
the embodiment of the invention can firstly obtain a target roller control comprising a roller control to be tested for any type of roller control, then determine the rolling direction, the rolling amplitude and the testing area in the target roller control, and finally test the roller control to be tested on the testing area based on the rolling direction and the rolling amplitude, thereby providing a universal testing method for testing various types of roller controls, not providing a specific interface for the roller control to be tested, and not needing to respectively design a testing program for each type of roller control, saving a large amount of resources on one hand, and improving the testing efficiency of the roller control on the other hand.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic implementation flow chart of a testing method for a wheel control according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating two types of scroll wheel controls provided in one embodiment of the present description;
fig. 3 is a schematic flow chart of a testing method for a wheel control provided in an embodiment of the present disclosure, applied in an actual scene;
fig. 4 is a schematic structural diagram of a testing apparatus for a roller control according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
In order to solve the problems that a large variety of roller tests need to consume more resources and have low efficiency in the prior art, embodiments of the present specification provide a method for testing a roller control. The execution subject of the testing method for the wheel control provided by the embodiment of the present disclosure may be, but is not limited to, a testing terminal and the like, which can be configured to execute at least one of the testing apparatuses of the method provided by the embodiment of the present disclosure.
For convenience of description, the following description will be made of an embodiment of the method, taking the main implementation of the method as an example of a test apparatus capable of implementing the method. It is to be understood that the subject matter of the method is a test apparatus, which is exemplary only, and should not be construed as limiting the method.
As described in the background art, there are many types of roller controls, and when testing the roller controls, a test script needs to be designed for each type of roller control, and a corresponding interface is needed to test the roller controls, which obviously results in a large workload and low efficiency for testers taking over the roller controls. In order to solve the problem, an embodiment of the present invention provides a universal testing method for a roller control, that is, for any type of roller control, a target roller control capable of wrapping a roller control to be tested may be first obtained, a rolling direction, a rolling amplitude, and a testing area are then determined in the target roller control, and finally, the roller control to be tested is tested in the testing area based on the rolling direction and the rolling amplitude.
Specifically, an implementation flow diagram of a testing method for a wheel control according to one or more embodiments of the present specification is shown in fig. 1, and includes:
step 110, obtaining a target roller control, wherein the target roller control comprises a roller control to be tested;
optionally, because the display interfaces of screens of different types of terminal devices are different in size, the target roller control is obtained, and an interface area including the roller control to be tested can be determined based on the display interface where the roller control to be tested is located; and then, acquiring a target roller control based on the interface area comprising the roller control to be tested, wherein the target roller control is the minimum control of the interface area comprising the roller control to be tested.
How to obtain the target scroll wheel control is described in detail below with reference to the specific scroll wheel control in fig. 2 (a).
As shown in fig. 2(a), a schematic diagram of a to-be-tested roller control provided in an embodiment of the present invention is shown, in which fig. 2(a) includes a to-be-tested roller control 21, a to-be-tested roller control 22, and a to-be-tested roller control 23. Taking the roller control 21 to be tested as an example, the display condition of the roller control 21 to be tested in the display interface of a certain terminal device is shown in fig. 2(a), based on the display interface where the roller control 21 to be tested is located, it may be determined that the minimum interface area 210 including the roller control 21 to be tested is included first, and then based on the minimum interface area 210 including the roller control 21 to be tested, a target roller control corresponding to the roller control 21 to be tested, that is, a roller control corresponding to the minimum interface area 210 may be obtained.
In analogy, a minimum interface area 220 including the roller control 22 to be tested, a roller control corresponding to the minimum interface area 220 (i.e., a target roller control corresponding to the roller control 22 to be tested), and a minimum interface area 230 including the roller control 23 to be tested, and a roller control corresponding to the minimum interface area 230 (i.e., a target roller control corresponding to the roller control 23 to be tested) can also be determined.
Step 120, determining a rolling direction, a rolling amplitude and a test area in the target roller control;
optionally, determining a scrolling direction, a scrolling amplitude and a test area in the target roller control, specifically determining the scrolling direction based on the scrolling direction of the target roller control; determining a rolling amplitude based on the area of the interface region of the target roller control; and determining a test area based on the text recognizable area of the target wheel control.
In general, the scrolling directions of the scroll wheel control may include both horizontal scrolling and vertical scrolling directions. Taking the roller control to be tested in fig. 2(a) as an example, it is obvious that the rolling direction of the target roller control corresponding to the roller control to be tested 21 is vertical to roll, and it can be determined that the rolling direction is vertical to roll; based on the area of the interface region of the target wheel control, specifically, based on the vertical width of the interface region 210, determining the scroll amplitude, assuming that the scroll amplitude at each time is determined to be the vertical width a of the scroll box 211 shown in fig. 2(a), i.e., the distance length of one time of scrolling, it should be understood that the value of the scroll amplitude should be appropriate in size, and may be determined through multiple tests; and based on the text recognizable area of the target wheel control, the test area may be determined, and assuming that the text recognizable area of the target wheel control is the scroll box 211, the interface area where the scroll box 211 is located may be determined as the test area.
If the roller control to be tested rolls in the horizontal direction, the rolling direction of the corresponding target roller control can be determined to roll in the horizontal direction, and further the rolling direction can be determined to roll in the horizontal direction; based on the area of the interface area of the target wheel control, the scroll amplitude can be determined based on the horizontal width of the interface area of the target wheel control; and determining a test area based on the text recognizable area of the target roller control, and determining the middle highlighted area of the roller control to be tested as the test area if only the middle highlighted area of the roller control to be tested is the text recognizable area in the roller control to be tested.
It should be noted that the text recognizable area of the roller control to be tested may also include a plurality of text recognizable areas, so as to improve the testing efficiency, a plurality of test areas may be correspondingly determined, taking fig. 2(b) as an example, the text recognizable area of the target roller control corresponding to the roller control to be tested 24 in fig. 2(b) includes areas where three numbers "7", "8", and "9" are located, and then based on the text recognizable area of the target roller control corresponding to the roller control to be tested 24, three test areas, that is, the test area 241, the test area 242, and the test area 243 shown in fig. 2(b), may be determined. In the actual testing process, each time the roller control 24 to be tested rolls, three numerical values in the corresponding three testing areas can be obtained, so that whether a preset expected value appears in the roller control 24 to be tested can be quickly determined, and the testing efficiency is greatly improved.
In addition, the scroll magnitude can also be characterized by a scroll speed, which can be determined based on the area of the interface region of the target scroll wheel control. Taking the interface area 210 of the target roller control as an example, since the rolling direction of the target roller control is vertical rolling, the rolling speed can be determined according to the interface height of the interface area 210, the determination of the specific numerical value of the rolling speed can be determined according to the actual situation, and is not suitable to be too large, and if the rolling speed is too large, the rolling is possibly difficult to control, so that the test result is influenced, and if the rolling speed is too small, the test efficiency is influenced.
And step 130, testing the roller control to be tested on the test area based on the rolling direction and the rolling amplitude.
Optionally, based on the rolling direction and the rolling amplitude, the roller control to be tested is tested in the test area, specifically, a preset expected value is obtained first, where the preset expected value is a value included in the roller control to be tested, and taking the roller control to be tested 21 in fig. 2(a) as an example, the value included in the roller control to be tested 21 is 1-12, and then the preset expected value may be one of 1-12; then, rolling the roller control to be tested according to the rolling direction and the rolling amplitude; then obtaining the value of the test area when the roller control to be tested performs rolling operation; and finally, testing the roller control to be tested based on the preset expected value and the value of the test area when the roller control to be tested performs rolling operation.
Next, the rolling operation of the roller control to be tested according to the rolling direction and the rolling amplitude will be described in detail by taking the roller control to be tested 21 shown in fig. 2(a) as an example. As can be seen from the rolling direction of the to-be-tested roller control in fig. 2(a), the rolling direction is vertical rolling, and if the set rolling amplitude is a, the to-be-tested roller control 21 is subjected to rolling operation according to the rolling direction and the rolling amplitude, specifically, the to-be-tested roller control 21 is subjected to rolling operation according to the vertical rolling direction and the rolling amplitude a, that is, the to-be-tested roller control 21 rolls in the vertical direction, and the rolling amplitude of each time is a.
Optionally, the roller control to be tested is tested based on a preset expected value and a value of the test area appearing when the roller control to be tested performs a rolling operation, including the following two cases: in the case 1, if a preset expected value appears in a test area within a preset time period, setting a control corresponding to the preset expected value; in case 2, if the preset expected value does not appear in the test area within the preset time period, an error message is reported. It should be understood that the preset time period may be preset by a timer during an actual test.
Optionally, for the case 1, if a preset expected value occurs in the test area within a preset time period, setting a control corresponding to the preset expected value, including: and if the preset expected value appears in the test area within the preset time period, clicking the control corresponding to the preset expected value to enable the control corresponding to the preset expected value to roll to the central position of the target area, wherein the target area is the text recognition area in the test area. In order to more accurately set the control corresponding to the preset expected value, the control corresponding to the preset expected value may be clicked, so that the control corresponding to the preset expected value is scrolled to the central position of the target area.
In case 2, because the preset expected value does not appear in the test area within the preset time period, it indicates that some problems may occur in the whole program of the roller control to be tested, such as a corresponding data structure is missing, or the control does not scroll to the preset expected value due to an excessively large scroll amplitude or a too small preset time period. And no matter which reason causes the preset expected value not to appear in the test area within the preset time period, error information is reported so as to further check whether the control corresponding to the preset expected value has a problem.
Optionally, obtaining a value of the test area when the roller control to be tested performs a rolling operation, specifically obtaining a value of the test area when the roller control to be tested performs a rolling operation based on a preset identification method; the preset Recognition method at least comprises one of Optical Character Recognition (OCR), image Recognition and control Recognition methods. The control identification method comprises UIAutomator and Robotium.
The following describes in detail a testing method of a wheel control provided in an embodiment of the present invention with reference to fig. 2(a) and fig. 3. Fig. 3 is a schematic flow chart of the method for testing a wheel control according to the embodiment of the present invention applied in an actual scene, which includes the following main steps:
step 31, acquiring a minimum control capable of wrapping a roller control to be tested;
as shown in fig. 2(a), for the roller control 21 to be tested, a minimum control capable of wrapping the roller control 21 to be tested, that is, a control corresponding to the interface area 210, may be obtained.
32, drawing a scroll box in the minimum control;
the scroll box 211 is outlined in the control corresponding to the minimum control, i.e., the interface area 210, where the width a of the scroll box 211 may be the scroll amplitude, and the scroll direction is the vertical direction, and the interface area where the scroll box 211 is located is the above-mentioned test area.
Step 33, rolling the roller control to be tested based on the rolling box;
the scroll control 21 to be tested is scrolled based on the scroll box 211, i.e., the scroll wheel control 21 to be tested is scrolled in the vertical direction, and the scroll amplitude is a each time.
Step 34, identifying all texts appearing in the scroll box;
each time the scroll control 21 to be tested performs a scroll operation, a numerical value appears in the scroll box 211, and at this time, the numerical value appearing in the scroll box 211 may be recognized by at least one of OCR, image recognition and control recognition methods.
Step 35, judging whether a preset expected value appears in the scroll box, if so, executing step 36, otherwise, executing step 37;
assuming that the preset expected value is 12 out of 1 to 12, it can be determined whether the preset expected value 12 appears in the scroll box 211, if it is determined that the preset expected value 12 appears in the scroll box, step 36 is executed, and if it is determined that the preset expected value 12 does not appear in the scroll box 211, step 37 is continuously executed.
Step 36, setting a control corresponding to a preset expected value;
in order to more accurately set the control corresponding to the preset expected value, the control corresponding to the preset expected value may be clicked, so that the control corresponding to the preset expected value is scrolled to the central position of the target area, that is, the central position of the text recognition area in the scroll box.
And step 37, judging whether the preset time period is exceeded or not, if the preset time period is exceeded, returning error information after the test is finished, and if the preset time period is not exceeded, executing step 33.
If the preset time period is exceeded, it is indicated that the preset expected value does not appear in the scroll frame (i.e., the test area) within the preset time period, and in this case, it may be that an error message needs to be returned because the preset expected value is missing in the program code corresponding to the control to be tested, so that a developer or a tester may inquire whether there are some problems in the program code corresponding to the control to be tested. If the preset time period is not exceeded, the process returns to step 33, and continues to scroll the roller control to be tested based on the scroll box to determine whether the preset expected value appears in the scroll box (i.e., the test area).
The embodiment of the invention can firstly obtain a target roller control comprising a roller control to be tested for any type of roller control, then determine the rolling direction, the rolling amplitude and the testing area in the target roller control, and finally test the roller control to be tested on the testing area based on the rolling direction and the rolling amplitude, thereby providing a universal testing method for testing various types of roller controls, not providing a specific interface for the roller control to be tested, and not needing to respectively design a testing program for each type of roller control, saving a large amount of resources on one hand, and improving the testing efficiency of the roller control on the other hand.
Fig. 4 is a schematic structural diagram of a testing apparatus 400 for a roller control. Referring to fig. 4, in a software implementation, a testing apparatus 400 for a wheel control may include an obtaining unit 401, a determining unit 402, and a testing unit 403, wherein:
an obtaining unit 401, configured to obtain a target roller control, where the target roller control includes a roller control to be tested;
a determining unit 402, configured to determine a scrolling direction, a scrolling amplitude, and a test area in the target wheel control;
a testing unit 403, configured to test the to-be-tested roller control on the testing area based on the rolling direction and the rolling amplitude.
In the embodiment of the invention, for any type of roller control, a target roller control including the roller control to be tested can be obtained through the obtaining unit 401, then the rolling direction, the rolling amplitude and the test area are determined in the target roller control through the determining unit 402, and finally the roller control to be tested can be tested on the test area through the test unit 403 based on the rolling direction and the rolling amplitude, so that a universal test method is provided for testing various types of roller controls, a specific interface is not required to be provided for the roller control to be tested, and a test program is not required to be designed for each type of roller control, so that a large amount of resources are saved on one hand, and the test efficiency of the roller control is improved on the other hand.
Optionally, in an embodiment, the obtaining unit 401 is configured to:
determining an interface area comprising the roller control to be tested based on the display interface where the roller control to be tested is located;
and acquiring the target roller control based on the interface area comprising the roller control to be tested, wherein the target roller control is the minimum control of the interface area comprising the roller control to be tested.
Optionally, in an embodiment, the determining unit 402 is configured to:
determining the scrolling direction based on the wheel direction of the target wheel control;
determining the scroll amplitude based on the area of the interface region of the target scroll wheel control;
determining the test area based on a text recognizable area of the target wheel control.
Optionally, in an embodiment, the test unit 403 is configured to:
acquiring a preset expected value;
performing rolling operation on the roller control to be tested according to the rolling direction and the rolling amplitude;
acquiring a value of the test area when the roller control to be tested performs rolling operation;
and testing the roller control to be tested based on the preset expected value and the value of the test area appearing when the roller control to be tested is subjected to rolling operation.
Optionally, in an embodiment, the test unit 403 is configured to:
if the preset expected value appears in the test area within a preset time period, setting a control corresponding to the preset expected value;
and reporting error information if the preset expected value does not appear in the test area within a preset time period.
Optionally, in an embodiment, the test unit 403 is configured to:
and if the preset expected value appears in the test area within a preset time period, clicking a control corresponding to the preset expected value to enable the control corresponding to the preset expected value to roll to the central position of a target area, wherein the target area is a text recognition area in the test area.
Optionally, in an embodiment, the test unit 403 is configured to:
acquiring a value of the test area when the roller control to be tested performs rolling operation based on a preset identification method;
the preset recognition method at least comprises one of an Optical Character Recognition (OCR) recognition method, an image recognition method and a control recognition method.
The testing apparatus 400 of the roller control can implement the testing method of the roller control according to the embodiments of the methods shown in fig. 1 to fig. 3, which specifically refers to the testing method of the roller control according to the embodiment shown in fig. 1 and will not be described again.
Fig. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification. Referring to fig. 5, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory to the memory and then runs the computer program to form the testing device of the roller control on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
acquiring a target roller control, wherein the target roller control comprises a roller control to be tested;
determining a rolling direction, a rolling amplitude and a test area in the target roller control;
and testing the roller control to be tested on the test area based on the rolling direction and the rolling amplitude.
The method for testing the wheel control according to the embodiment shown in fig. 1 of the present specification may be applied to a processor, or may be implemented by the processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in one or more embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in hardware, in a software module executed by a hardware decoding processor, or in a combination of the hardware and software modules executed by a hardware decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method for testing the wheel control shown in fig. 1 to 3, which is not described herein again.
Of course, besides the software implementation, the electronic device in this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of the present disclosure should be included in the scope of protection of one or more embodiments of the present disclosure.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (5)

1. A method for testing a roller control is characterized by comprising the following steps:
acquiring a target roller control, wherein the target roller control comprises a roller control to be tested;
determining a rolling direction, a rolling amplitude and a test area in the target roller control;
testing the roller control to be tested on the test area based on the rolling direction and the rolling amplitude;
wherein, acquire target roller control, include:
determining an interface area comprising the roller control to be tested based on the display interface where the roller control to be tested is located;
acquiring the target roller control based on the interface area including the roller control to be tested, wherein the target roller control is the minimum control of the interface area including the roller control to be tested;
determining a scrolling direction, a scrolling amplitude, and a test area in the target scroll wheel control, comprising:
determining the scrolling direction based on the wheel direction of the target wheel control;
determining the scroll amplitude based on the area of the interface region of the target scroll wheel control;
determining the test area based on a text recognizable area of the target wheel control;
the rolling directions of the roller control comprise a horizontal rolling direction and a vertical rolling direction;
if the roller control to be tested rolls in the horizontal direction, determining that the rolling direction of the corresponding target roller control also rolls in the horizontal direction, and further determining that the rolling direction rolls in the horizontal direction; determining a scrolling amplitude based on the area of the interface area of the target roller control, specifically based on the horizontal width of the interface area of the target roller control; determining a test area based on the text recognizable area of the target roller control, and determining the middle highlighted area of the roller control to be tested as the test area if only the middle highlighted area of the roller control to be tested is the text recognizable area in the roller control to be tested;
the scroll amplitude is characterized by a scroll speed, and the scroll speed of the target roller control is determined based on the area of the interface area of the target roller control;
based on the rolling direction and the rolling amplitude, the roller control to be tested is tested on the test area, and the method comprises the following steps:
acquiring a preset expected value;
performing rolling operation on the roller control to be tested according to the rolling direction and the rolling amplitude;
acquiring a value of the test area when the roller control to be tested performs rolling operation;
testing the roller control to be tested based on the preset expected value and the value of the test area appearing when the roller control to be tested is subjected to rolling operation;
based on the preset expected value and the value of the test area appearing when the roller control to be tested performs the rolling operation, the method for testing the roller control to be tested comprises the following steps:
if the preset expected value appears in the test area within a preset time period, setting a control corresponding to the preset expected value;
if the preset expected value does not appear in the test area within a preset time period, reporting error information;
if the preset expected value appears in the test area within a preset time period, setting a control corresponding to the preset expected value, including:
and if the preset expected value appears in the test area within a preset time period, clicking a control corresponding to the preset expected value to enable the control corresponding to the preset expected value to roll to the central position of a target area, wherein the target area is a text recognition area in the test area.
2. The method of claim 1, wherein obtaining the value of the test region that appears when the roller control under test is performing a scrolling operation comprises:
acquiring a value of the test area when the roller control to be tested performs rolling operation based on a preset identification method;
the preset recognition method at least comprises one of an Optical Character Recognition (OCR) recognition method, an image recognition method and a control recognition method.
3. A testing device for a roller control, comprising:
the device comprises an acquisition unit, a detection unit and a control unit, wherein the acquisition unit is used for acquiring a target roller control which comprises a roller control to be tested;
the determining unit is used for determining a rolling direction, a rolling amplitude and a test area in the target roller control;
the test unit is used for testing the roller control to be tested on the test area based on the rolling direction and the rolling amplitude;
the acquisition unit is configured to:
determining an interface area comprising the roller control to be tested based on the display interface where the roller control to be tested is located;
acquiring the target roller control based on the interface area including the roller control to be tested, wherein the target roller control is the minimum control of the interface area including the roller control to be tested;
the determining unit is configured to:
determining the scrolling direction based on the wheel direction of the target wheel control;
determining the scroll amplitude based on the area of the interface region of the target scroll wheel control;
determining the test area based on a text recognizable area of the target wheel control;
the rolling directions of the roller control comprise a horizontal rolling direction and a vertical rolling direction;
if the roller control to be tested rolls in the horizontal direction, determining that the rolling direction of the corresponding target roller control also rolls in the horizontal direction, and further determining that the rolling direction rolls in the horizontal direction; determining a scrolling amplitude based on the area of the interface area of the target roller control, specifically based on the horizontal width of the interface area of the target roller control; determining a test area based on the text recognizable area of the target roller control, and determining the middle highlighted area of the roller control to be tested as the test area if only the middle highlighted area of the roller control to be tested is the text recognizable area in the roller control to be tested;
the scroll amplitude is characterized by a scroll speed, and the scroll speed of the target roller control is determined based on the area of the interface area of the target roller control;
based on the rolling direction and the rolling amplitude, testing the roller control to be tested on the test area, including:
acquiring a preset expected value;
performing rolling operation on the roller control to be tested according to the rolling direction and the rolling amplitude;
acquiring a value of the test area when the roller control to be tested performs rolling operation;
testing the roller control to be tested based on the preset expected value and the value of the test area appearing when the roller control to be tested is subjected to rolling operation;
based on the preset expected value and the value of the test area appearing when the roller control to be tested performs the rolling operation, the method for testing the roller control to be tested comprises the following steps:
if the preset expected value appears in the test area within a preset time period, setting a control corresponding to the preset expected value;
if the preset expected value does not appear in the test area within a preset time period, reporting error information;
if the preset expected value appears in the test area within a preset time period, setting a control corresponding to the preset expected value, including:
and if the preset expected value appears in the test area within a preset time period, clicking a control corresponding to the preset expected value to enable the control corresponding to the preset expected value to roll to the central position of a target area, wherein the target area is a text recognition area in the test area.
4. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring a target roller control, wherein the target roller control comprises a roller control to be tested;
determining a rolling direction, a rolling amplitude and a test area in the target roller control;
testing the roller control to be tested on the test area based on the rolling direction and the rolling amplitude;
wherein, acquire target roller control, include:
determining an interface area comprising the roller control to be tested based on the display interface where the roller control to be tested is located;
acquiring the target roller control based on the interface area including the roller control to be tested, wherein the target roller control is the minimum control of the interface area including the roller control to be tested;
determining a scrolling direction, a scrolling amplitude, and a test area in the target scroll wheel control, comprising:
determining the scrolling direction based on the wheel direction of the target wheel control;
determining the scroll amplitude based on the area of the interface region of the target scroll wheel control;
determining the test area based on a text recognizable area of the target wheel control;
the rolling directions of the roller control comprise a horizontal rolling direction and a vertical rolling direction;
if the roller control to be tested rolls in the horizontal direction, determining that the rolling direction of the corresponding target roller control also rolls in the horizontal direction, and further determining that the rolling direction rolls in the horizontal direction; determining a scrolling amplitude based on the area of the interface area of the target roller control, specifically based on the horizontal width of the interface area of the target roller control; determining a test area based on the text recognizable area of the target roller control, and determining the middle highlighted area of the roller control to be tested as the test area if only the middle highlighted area of the roller control to be tested is the text recognizable area in the roller control to be tested;
the scroll amplitude is characterized by a scroll speed, and the scroll speed of the target roller control is determined based on the area of the interface area of the target roller control;
based on the rolling direction and the rolling amplitude, testing the roller control to be tested on the test area, including:
acquiring a preset expected value;
performing rolling operation on the roller control to be tested according to the rolling direction and the rolling amplitude;
acquiring a value of the test area when the roller control to be tested performs rolling operation;
testing the roller control to be tested based on the preset expected value and the value of the test area appearing when the roller control to be tested is subjected to rolling operation;
based on the preset expected value and the value of the test area appearing when the roller control to be tested performs the rolling operation, the method for testing the roller control to be tested comprises the following steps:
if the preset expected value appears in the test area within a preset time period, setting a control corresponding to the preset expected value;
if the preset expected value does not appear in the test area within a preset time period, reporting error information;
if the preset expected value appears in the test area within a preset time period, setting a control corresponding to the preset expected value, including:
and if the preset expected value appears in the test area within a preset time period, clicking a control corresponding to the preset expected value to enable the control corresponding to the preset expected value to roll to the central position of a target area, wherein the target area is a text recognition area in the test area.
5. A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to:
acquiring a target roller control, wherein the target roller control comprises a roller control to be tested;
determining a rolling direction, a rolling amplitude and a test area in the target roller control;
testing the roller control to be tested on the test area based on the rolling direction and the rolling amplitude;
wherein, acquire target roller control, include:
determining an interface area comprising the roller control to be tested based on the display interface where the roller control to be tested is located;
acquiring the target roller control based on the interface area including the roller control to be tested, wherein the target roller control is the minimum control of the interface area including the roller control to be tested;
determining a scrolling direction, a scrolling amplitude, and a test area in the target scroll wheel control, comprising:
determining the scrolling direction based on the wheel direction of the target wheel control;
determining the scroll amplitude based on the area of the interface region of the target scroll wheel control;
determining the test area based on a text recognizable area of the target wheel control;
the rolling directions of the roller control comprise a horizontal rolling direction and a vertical rolling direction;
if the roller control to be tested rolls in the horizontal direction, determining that the rolling direction of the corresponding target roller control also rolls in the horizontal direction, and further determining that the rolling direction rolls in the horizontal direction; determining a scrolling amplitude based on the area of the interface area of the target roller control, specifically based on the horizontal width of the interface area of the target roller control; determining a test area based on the text recognizable area of the target roller control, and determining the middle highlighted area of the roller control to be tested as the test area if only the middle highlighted area of the roller control to be tested is the text recognizable area in the roller control to be tested;
the scroll amplitude is characterized by a scroll speed, and the scroll speed of the target roller control is determined based on the area of the interface area of the target roller control;
based on the rolling direction and the rolling amplitude, testing the roller control to be tested on the test area, including:
acquiring a preset expected value;
performing rolling operation on the roller control to be tested according to the rolling direction and the rolling amplitude;
acquiring a value of the test area when the roller control to be tested performs rolling operation;
testing the roller control to be tested based on the preset expected value and the value of the test area appearing when the roller control to be tested is subjected to rolling operation;
based on the preset expected value and the value of the test area appearing when the roller control to be tested performs the rolling operation, the method for testing the roller control to be tested comprises the following steps:
if the preset expected value appears in the test area within a preset time period, setting a control corresponding to the preset expected value;
if the preset expected value does not appear in the test area within a preset time period, reporting error information;
if the preset expected value appears in the test area within a preset time period, setting a control corresponding to the preset expected value, including:
and if the preset expected value appears in the test area within a preset time period, clicking a control corresponding to the preset expected value to enable the control corresponding to the preset expected value to roll to the central position of a target area, wherein the target area is a text recognition area in the test area.
CN201810812530.4A 2018-07-23 2018-07-23 Test method and device of roller control and electronic equipment Active CN109062793B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810812530.4A CN109062793B (en) 2018-07-23 2018-07-23 Test method and device of roller control and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810812530.4A CN109062793B (en) 2018-07-23 2018-07-23 Test method and device of roller control and electronic equipment

Publications (2)

Publication Number Publication Date
CN109062793A CN109062793A (en) 2018-12-21
CN109062793B true CN109062793B (en) 2022-03-04

Family

ID=64836084

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810812530.4A Active CN109062793B (en) 2018-07-23 2018-07-23 Test method and device of roller control and electronic equipment

Country Status (1)

Country Link
CN (1) CN109062793B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457219B (en) * 2019-08-08 2021-06-22 中国建设银行股份有限公司 Method and device for selecting time when test script is recorded
CN110580221A (en) * 2019-08-21 2019-12-17 东软集团股份有限公司 Control testing method and device, storage medium and electronic equipment
CN111813479A (en) * 2020-07-06 2020-10-23 北京飞漫软件技术有限公司 Method and system for constructing roller object

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3660673A1 (en) * 2012-03-22 2020-06-03 Irdeto B.V. Updating software components
CN106547454A (en) * 2015-09-16 2017-03-29 阿里巴巴集团控股有限公司 Display packing and device
CN107220170A (en) * 2016-03-22 2017-09-29 阿里巴巴集团控股有限公司 A kind of method of testing, device and electronic equipment
CN106383780A (en) * 2016-09-05 2017-02-08 努比亚技术有限公司 Monkey test method and device
CN108009078B (en) * 2016-11-01 2021-04-27 腾讯科技(深圳)有限公司 Application interface traversal method, system and test equipment
CN108121644A (en) * 2017-12-19 2018-06-05 珠海市君天电子科技有限公司 A kind of test method, device and the electronic equipment of page control performance

Also Published As

Publication number Publication date
CN109062793A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109189682B (en) Script recording method and device
CN109062793B (en) Test method and device of roller control and electronic equipment
CN107274442B (en) Image identification method and device
CN109033772B (en) Verification information input method and device
CN110334013B (en) Decision engine testing method and device and electronic equipment
CN109271611B (en) Data verification method and device and electronic equipment
CN110956275A (en) Risk prediction and risk prediction model training method and device and electronic equipment
CN111163067B (en) Safety testing method and device and electronic equipment
CN112199268B (en) Software compatibility testing method and electronic equipment
CN109978044B (en) Training data generation method and device, and model training method and device
CN112634201B (en) Target detection method and device and electronic equipment
CN110222936B (en) Root cause positioning method and system of business scene and electronic equipment
CN110764986A (en) Page fluency detection method and device
CN109828926B (en) Method and device for judging whether application interface is loaded abnormally
CN110874315A (en) Test method, test device, electronic equipment and storage medium
CN110647547A (en) Consumption delay monitoring method and device, electronic equipment and computer readable storage medium
CN109189677B (en) Test method and device for updating state of variable value
CN109271453B (en) Method and device for determining database capacity
CN109740336B (en) Method and device for identifying verification information in picture and electronic equipment
CN116756037A (en) Abnormal code positioning system, method, equipment and computer readable storage medium
CN109145821B (en) Method and device for positioning pupil image in human eye image
CN108388982B (en) Task running method and device and electronic equipment
CN109598478B (en) Wind measurement result description document generation method and device and electronic equipment
CN109388564B (en) Test method and device and electronic equipment
CN112183951B (en) Supervision processing method and device based on audit quality evaluation

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
TA01 Transfer of patent application right

Effective date of registration: 20210716

Address after: 100016 no.4301, No.52 Jiuxianqiao hospital, Chaoyang District, Beijing

Applicant after: BEIJING TESTIN INFORMATION TECHNOLOGY Co.,Ltd.

Address before: Room 2016, building 2, No.8, Fenghuang Third Road, Zhongxin Guangzhou Knowledge City, Guangzhou 510260, Guangdong Province

Applicant before: GUANGZHOU TESTIN INFORMATION TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant