CN110457219B - Method and device for selecting time when test script is recorded - Google Patents

Method and device for selecting time when test script is recorded Download PDF

Info

Publication number
CN110457219B
CN110457219B CN201910729269.6A CN201910729269A CN110457219B CN 110457219 B CN110457219 B CN 110457219B CN 201910729269 A CN201910729269 A CN 201910729269A CN 110457219 B CN110457219 B CN 110457219B
Authority
CN
China
Prior art keywords
value
time
sliding
coordinate
initial
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
CN201910729269.6A
Other languages
Chinese (zh)
Other versions
CN110457219A (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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN201910729269.6A priority Critical patent/CN110457219B/en
Publication of CN110457219A publication Critical patent/CN110457219A/en
Priority to PCT/CN2020/106706 priority patent/WO2021023171A1/en
Priority to JP2022506362A priority patent/JP7255827B2/en
Application granted granted Critical
Publication of CN110457219B publication Critical patent/CN110457219B/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/3684Test management for test design, e.g. generating new test cases
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)
  • Telephone Function (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method and a device for selecting time when a test script is recorded, and relates to the technical field of computers. One embodiment of the method comprises: identifying an initial time displayed by a time control, wherein the initial time comprises at least one time element and an initial value thereof; for each time element, acquiring a coordinate distance between an initial value and an adjacent value of the time element, wherein the adjacent value is a value adjacent to the initial value in the values of the same time element of the time control, and calculating a difference value between a target value and the initial value of the time element in preset target time; and simulating the user to finish time selection according to the coordinate distance and the difference value. The implementation method can simulate the time selection of the user only through the codes without the participation of the user, is suitable for different mobile equipment models, operating system versions, screen sizes, resolution ratios, different applications and the like, is good in compatibility of the test scripts, high in flexibility and capable of saving a large amount of labor cost.

Description

Method and device for selecting time when test script is recorded
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for selecting time when a test script is recorded.
Background
In recent years, under the background of the mobile internet era, along with the rapid development of the mobile internet, the mobile application of the intelligent terminal shows the well-spraying type growth, the mobile financial application APP becomes a main channel for connecting a commercial bank with a customer, and before the mobile financial application is on line, the function of the mobile application needs to be fully tested, the traditional manual test can not ensure the on-line quality and efficiency requirement of the system, so that an automation tool needs to be introduced to realize the automatic regression test of the mobile APP. Remove financial APP automated test, it is exactly to record automatic script according to the business demand, simulate operations such as cell-phone touch, button, schedule the execution in batches on mobile terminal through the test frame, the automatic execution is to APP's test work. The automatic script recording is used for helping an automatic tester to generate an automatic script based on a control recording mode, and the recorded script can be executed on Android and ios equipment with different resolutions and different versions. When the function test is carried out on the mobile APP, the core function of the mobile application is selected, the test cases are recorded into an automatic test script, a regression test script library is established, and iterative regression is carried out before each version of the application is on line, so that the application defect is found, the application quality is improved, the test efficiency is improved, and the labor cost is saved.
Taking the automatic test of the time control as an example, because the brand model, the operating system version, the screen size, the resolution and the like of the mobile device are various, the size and the default time of the time control (for example, including year, month, day, hour, minute, second and the like) in the mobile application installed on the mobile device are also inconsistent.
At present, when a time control is automatically tested, a keyword driving frame is generally adopted to record a test script. The key word driving frame is a functional automation testing frame, and the basic working principle of the key word driving frame is that a test case is divided into four different parts, namely a testing step, an object in the testing step, an action executed on the testing object and data required by the testing object.
Taking the time selection by sliding the time control up and down as an example, when the keyword driving frame is used for recording the automatic test script, the current commonly used script recording method is to complete a test case with time selection by manually sliding the screen to the target time by a user, and the specific process is as follows: opening a time control menu, wherein the control menu generally displays a certain default time, selecting a certain time element (year, month, day, time, minute, second and the like) in the current page of the time control pull-down menu as an operation object, executing an up-sliding or down-sliding action aiming at the operation object, and sliding according to a sliding distance corresponding to the action; and if the specified target time is not found in the page after sliding, continuing to select the current operation object to execute the sliding action until the specified target time is found.
However, according to the recording method, time selection is performed through the time control, so that too many steps are required for recording, and the accuracy of operation or assignment is not sufficient. If the target value and the current value span a large amount, a large number of click and slide steps need to be recorded, and since the default value is usually the current time, the actual default time is not the time when the test case is recorded at the beginning when the test case is operated at the later stage. Meanwhile, for the complex control, the styles are different in different mobile phone operating systems, and if a recording mode is adopted, the simultaneous support of multiple operating system versions is difficult. Different operating systems, different screen sizes and resolutions, the same sliding proportion is executed, and the positioning dates after sliding are different. Therefore, a plurality of test scripts are recorded respectively in different mobile phone operating systems, different screen sizes and resolutions and different default times in APP, the target time can be searched and selected, the applicability of a single automatic test script is low, and the script recording needs to be adjusted repeatedly.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1) aiming at different mobile phone brands and models, operating systems, screen sizes and resolutions, the running compatibility of the same test script is poor;
2) the size of the time control in different mobile applications is different from default initial time, and it may be necessary to record an automated test script for time selection of the time control of different mobile APPs, respectively, which is high in labor cost.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for selecting time when recording a test script, which can simulate time selection of a user only through a code without user participation, and can be applied to different mobile device models, operating system versions, screen sizes, resolutions, different applications, and the like, and the test script has good compatibility and high flexibility, and saves a large amount of labor cost.
To achieve the above object, according to an aspect of the embodiments of the present invention, a method for selecting time when recording a test script is provided.
A method for selecting time when a test script is recorded comprises the following steps: identifying an initial time of display of a time control, the initial time comprising at least one time element and an initial value thereof; for each time element, acquiring a coordinate distance between an initial value and an adjacent value of the time element, wherein the adjacent value is a value adjacent to the initial value in the values of the same time element of the time control, and calculating a difference value between a target value of the time element and the initial value in a preset target time; and simulating the user to finish time selection according to the coordinate distance and the difference value.
Optionally, the obtaining of the coordinate distance between the initial value and the adjacent value of the time element comprises: respectively acquiring an initial value of the time element and a coordinate value of an adjacent value through a coordinate acquisition tool; and calculating the absolute value of the difference between the coordinate value of the initial value and the coordinate value of the adjacent value to obtain the coordinate distance.
Optionally, simulating the user completion time selection according to the coordinate distance and the difference value comprises: judging the sliding direction according to the difference value; taking the coordinate distance as a unit distance of each sliding, sliding the time element along the sliding direction and acquiring a current value after each sliding; when the current value is equal to the target value, time selection is completed.
Optionally, simulating the user completion time selection according to the coordinate distance and the difference value comprises: judging the sliding direction according to the difference value; obtaining the sliding distance of the time element according to the coordinate distance and the absolute value of the difference; and sliding the time element along the sliding direction according to the sliding distance so as to enable the sliding value to be the target value, and finishing time selection.
According to another aspect of the embodiment of the invention, a device for selecting time when recording the test script is provided.
An apparatus for time selection for recording of test scripts, comprising: the time identification module is used for identifying the initial time displayed by the time control, and the initial time comprises at least one time element and an initial value thereof; the numerical value processing module is used for acquiring the coordinate distance between the initial value and the adjacent value of each time element, wherein the adjacent value is the value adjacent to the initial value in the values of the same time element of the time control, and calculating the difference value between the target value and the initial value of the time element in the preset target time; and the time selection module is used for simulating the completion of time selection of the user according to the coordinate distance and the difference value.
Optionally, the numerical processing module is further configured to: respectively acquiring an initial value of the time element and a coordinate value of an adjacent value through a coordinate acquisition tool; and calculating the absolute value of the difference between the coordinate value of the initial value and the coordinate value of the adjacent value to obtain the coordinate distance.
Optionally, the time selection module is further configured to: judging the sliding direction according to the difference value; taking the coordinate distance as a unit distance of each sliding, sliding the time element along the sliding direction and acquiring a current value after each sliding; when the current value is equal to the target value, time selection is completed.
Optionally, the time selection module is further configured to: judging the sliding direction according to the difference value; obtaining the sliding distance of the time element according to the coordinate distance and the absolute value of the difference; and sliding the time element along the sliding direction according to the sliding distance so as to enable the sliding value to be the target value, and finishing time selection.
According to another aspect of the embodiment of the invention, an electronic device for time selection when a test script is recorded is provided.
An electronic device for time selection when a test script is recorded, comprising: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors realize the method for selecting the time when the test script is recorded, which is provided by the embodiment of the invention.
According to yet another aspect of embodiments of the present invention, a computer-readable medium is provided.
A computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for selecting time when recording a test script according to an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: identifying an initial time displayed by the time control, the initial time comprising at least one time element and an initial value thereof; for each time element, acquiring a coordinate distance between an initial value and an adjacent value of the time element, wherein the adjacent value is a value adjacent to the initial value in the values of the same time element of the time control, and calculating a difference value between a target value and the initial value of the time element in preset target time; the user is simulated according to the coordinate distance and the difference value to complete time selection, the user can be simulated only through codes without participation of the user, the method is applicable to different mobile equipment models, operating system versions, screen sizes, resolution ratios, different applications and the like, the test script is good in compatibility and high in flexibility, and a large amount of labor cost is saved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a method for selecting time when recording a test script according to an embodiment of the present invention;
FIG. 2 is a schematic view of an interface for date selection according to one embodiment of the present invention;
FIG. 3 is a schematic diagram of a date selection device according to one embodiment of the present invention;
FIG. 4 is a schematic illustration of an interface for making year selections in accordance with one embodiment of the present invention;
FIG. 5 is a flowchart of an implementation of year selection according to one embodiment of the invention;
FIG. 6 is a schematic diagram of the main blocks of an apparatus for time selection when recording test scripts according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In order to solve the technical problems in the prior art, the invention provides a method for selecting time when a test script is recorded, which can simulate the time selection of a user only through codes without the participation of the user, is suitable for different mobile equipment models, operating systems, screen sizes, resolutions and different applications, has good compatibility of the test script, and saves a large amount of labor cost.
Fig. 1 is a schematic diagram illustrating main steps of a method for selecting time when recording a test script according to an embodiment of the present invention. As shown in fig. 1, the method for selecting time when recording a test script according to the embodiment of the present invention mainly includes the following steps S101 to S103.
Step S101: identifying an initial time displayed by a time control, wherein the initial time comprises at least one time element and an initial value thereof;
step S102: for each time element, acquiring a coordinate distance between an initial value and an adjacent value of the time element, wherein the adjacent value is a value adjacent to the initial value in the values of the same time element of the time control, and calculating a difference value between a target value and the initial value of the time element in preset target time;
step S103: and simulating the user to finish time selection according to the coordinate distance and the difference value.
According to the embodiment of the invention, when the initial time of the time control display is identified, the image identification technology can be used for realizing the display. The initial time includes time elements such as year, month, day, hour, minute, second, and the like.
According to an embodiment of the present invention, when obtaining the coordinate distance between the initial value of the time element and the adjacent value, the following steps may be specifically performed:
respectively acquiring an initial value of a time element and a coordinate value of an adjacent value through a coordinate acquisition tool;
and calculating the absolute value of the difference between the coordinate value of the initial value and the coordinate value of the adjacent value to obtain the coordinate distance.
The coordinate acquisition tool can be integrated in an automatic test tool, or can be self-contained in a mobile equipment system. When the initial value of the time element and the coordinate values of the adjacent values are obtained, the coordinate values of the upper left corner (or the lower left corner, the upper right corner, the lower right corner, etc.) of the space occupied by each numerical value (including the initial value and the adjacent values) may be obtained, or the coordinate values of the center of the space occupied by each numerical value may be obtained.
The distance between two adjacent numerical values can be obtained by calculating the coordinate distance between the initial value and the adjacent value. In general, when the time control is set, the distance between two adjacent numerical values is fixed.
According to another embodiment of the present invention, when simulating the user completion time selection according to the coordinate distance and the difference, the method may specifically be performed according to the following steps:
judging the sliding direction according to the difference value;
taking the coordinate distance as a unit distance of each sliding, sliding the time element along the sliding direction and acquiring a current value after each sliding;
when the current value is equal to the target value, the time selection is completed.
According to another embodiment of the present invention, when simulating the user completion time selection according to the coordinate distance and the difference, the following steps may be specifically performed:
judging the sliding direction according to the difference value;
obtaining the sliding distance of the time element according to the coordinate distance and the absolute value of the difference;
and according to the sliding distance, sliding the time element along the sliding direction to enable the sliding value to be a target value, and finishing time selection.
The difference between the initial value and the target value of the time element in the preset target time may be a positive number, and may also be a negative number and 0. When the difference value is 0, the initial value is equal to the target value, and the initial value is directly used as the selected time without moving the time element; when the difference is a positive number or a negative number, the sliding direction needs to be determined according to the numerical value change trend of the time element in the time control. Specifically, for example: assuming that the time elements in the time control are arranged up and down and are increased progressively from top to bottom, when the difference is a positive number, the sliding direction is upward; when the difference is negative, the sliding direction is downward.
After the direction of the slide is determined, the time element can be slid along the direction of the slide to select the time. In specific execution, the coordinate distance can be taken as a unit distance of each sliding, and a current value after the sliding is obtained and judged whether to be equal to a target value or not every time the sliding is performed; or the total sliding distance is calculated according to the coordinate distance and the absolute value of the difference, and then the target value is directly slid once according to the sliding distance.
The following describes a specific implementation process of the method for selecting time when recording the test script, by taking date selection (year, month, and day) as an example. When the user completes time selection according to the coordinate distance and the difference value, a method of taking the coordinate distance as a unit distance of each sliding, acquiring a current value after the sliding and judging whether the current value is equal to a target value or not every sliding is taken as an example for introduction.
FIG. 2 is a schematic diagram of an interface for date selection according to one embodiment of the invention. As shown in FIG. 2, which illustrates a common interface diagram for a date control, time selection is made by a pull-down scrolling of time elements, including year, month and day. In this example, the target time is day 27 of 6 months of 2015, with time selection by sliding the time element below. In the prior art, the time element is generally slid by manually sliding the screen, so that the value of the time element is changed until the current value of the time element is equal to the target value. In the embodiment of the present invention, the time selection by the user is simulated by the proposed date selection device, please refer to fig. 3.
Fig. 3 is a schematic structural diagram of a device for date selection according to an embodiment of the present invention. As shown in fig. 3, an apparatus 300 for date selection according to an embodiment of the present invention includes 1 inception date recognition unit 301, 1 time element coordinate information recognition unit 302, 1 time element coordinate storage unit 303, 1 time element calculation search unit 304, and 1 time element simulation selection unit 305.
The device 300 for selecting a date according to the embodiment of the present invention receives a preset target date value as a parameter assignment value before use. When the device 300 runs, the system automatically clicks and pops up a drop-down selection box, searches for a selection target date option and the like, and then completes a series of actions;
an inception date recognition unit 301 for recognizing an inception date in the pull-down scroll menu, the inception date including 3 time elements (year, month, day) and corresponding initial values, using an image recognition technique;
a time element coordinate information identification unit 302 for identifying coordinate information of different values of each time element in the pull-down scrolling date control and sending the identified coordinate information to a time element coordinate storage unit 303;
the time element coordinate storage unit 303 is configured to store coordinate information of different values of time elements, and establish a correspondence table between values and coordinates of each time element. Meanwhile, calculating the coordinate distance between the initial value of each time element and the adjacent value as the unit distance of the sliding date;
a time element calculation search unit 304 for calculating a difference between a target value and an initial value of a time element, and performing a cyclic decision search starting from the initial value until the target value of the time element is found;
and a time element simulation selection unit 305 for simulating the tester to complete the selection of the target date according to the calculation and search result of the time element calculation search unit 304.
FIG. 4 is a schematic view of an interface for making year selections, in accordance with one embodiment of the present invention. As shown in fig. 4, in which only an interface for selecting one time element (year) is shown, time selection is performed by pulling down the scroll time element. Where the initial value of the time element (year) is 1978 and when the target value to be selected is 1990, the screen needs to be slid up to find 1990. In the prior art, when recording a test script, the time element of the year is used as an operation object, and the user manually performs a sliding action on the operation object to find the target value 1990, thereby completing the year selection. In the embodiment of the present invention, the time selection performed by the user is simulated by the proposed method for selecting the year, and the specific implementation flow is shown in fig. 5.
FIG. 5 is a flow chart of an implementation of year selection according to an embodiment of the present invention. As shown in fig. 5, the implementation process of year selection according to the embodiment of the present invention mainly includes the following steps:
1) identifying an initial value of a time element (year) in a pull-down scrolling date control through an image identification technology;
2) by a coordinate acquisition tool integrated in the automated test tool, coordinate values of the initial value of the time element are acquired and recorded (for example: the coordinates of the upper left corner of the area corresponding to the initial value);
3) the adjacent values of the initial value of the time element are acquired and recorded by a coordinate acquisition tool integrated in the automated test tool (i.e.: the previous or next value of the initial value) of the coordinate values (for example: the upper left corner coordinate of the region corresponding to the neighborhood);
4) calculating the absolute value of the difference between the coordinate value of the initial value and the coordinate value of the adjacent value to obtain a coordinate distance, and taking the coordinate distance as a unit distance of sliding for one year each time;
5) calculating the difference value between the target value and the initial value of the time element (year) transmitted in advance;
6) it is determined whether the current value is the input target value. If the difference value between the input target value and the current value is 0, selecting the current value to complete year selection, and ending the process; if the difference value is positive, sliding upwards for one grid, acquiring a value after sliding as a current value, circularly judging and sliding until the current value is equal to the target value, wherein the number of the sliding grids is the absolute value of the difference value between the target value and the initial value; if the difference value is negative, sliding downwards for one grid, acquiring a value after sliding as a current value, and circularly judging and sliding until the current value is equal to the target value, wherein the number of the sliding grids is the absolute value of the difference value between the target value and the initial value;
7) and simulating the tester to complete the year selection according to the calculation and search results.
Likewise, when a search for the month and date is required, it is also performed in accordance with the search selection method for the year. In general, when the year becomes larger from top to bottom, the time element (year) to be selected may be slid in the sliding direction described in the above-described step 6); when the year is successively smaller from top to bottom, the time element (year) to be selected may be slid in the direction opposite to the sliding direction described in the above-described step 6). The present invention is not limited to the case where values of the same time element are arranged vertically, but is also applicable to the case where values of the same time element are arranged horizontally. The above scenarios are all within the protection scope of the technical solution of the present invention, and those skilled in the art can perform corresponding expansion according to the needs of practical application.
Fig. 6 is a schematic diagram of main blocks of an apparatus for selecting time when recording a test script according to an embodiment of the present invention. As shown in fig. 6, the apparatus 600 for selecting time when recording a test script according to an embodiment of the present invention mainly includes a time identification module 601, a numerical processing module 602, and a time selection module 603.
The time identification module 601 is configured to identify an initial time displayed by the time control, where the initial time includes at least one time element and an initial value thereof;
a numerical processing module 602, configured to, for each time element, obtain a coordinate distance between an initial value and an adjacent value of the time element, where the adjacent value is a value adjacent to the initial value in values of the same time element of the time control, and calculate a difference between a target value of the time element and the initial value in a preset target time;
and a time selection module 603, configured to simulate a user to complete time selection according to the coordinate distance and the difference.
According to an embodiment of the present invention, the numerical processing module 602 may further be configured to:
respectively acquiring an initial value of the time element and a coordinate value of an adjacent value through a coordinate acquisition tool;
and calculating the absolute value of the difference between the coordinate value of the initial value and the coordinate value of the adjacent value to obtain the coordinate distance.
According to another embodiment of the present invention, the time selection module 603 may further be configured to:
judging the sliding direction according to the difference value;
taking the coordinate distance as a unit distance of each sliding, sliding the time element along the sliding direction and acquiring a current value after each sliding;
when the current value is equal to the target value, time selection is completed.
According to yet another embodiment of the present invention, the time selection module 603 may be further configured to:
judging the sliding direction according to the difference value;
obtaining the sliding distance of the initial time element according to the coordinate distance and the absolute value of the difference;
and sliding the time element along the sliding direction according to the sliding distance so as to enable the sliding value to be the target value, and finishing time selection.
According to the technical scheme of the embodiment of the invention, the initial time displayed by the time control is identified, and the initial time comprises at least one time element and an initial value thereof; for each time element, acquiring a coordinate distance between an initial value and an adjacent value of the time element, wherein the adjacent value is a value adjacent to the initial value in the values of the same time element of the time control, and calculating a difference value between a target value and the initial value of the time element in preset target time; the user is simulated according to the coordinate distance and the difference value to complete time selection, the user can be simulated only through codes without participation of the user, the method is applicable to different mobile equipment models, operating system versions, screen sizes, resolution ratios, different applications and the like, the test script is good in compatibility and high in flexibility, and a large amount of labor cost is saved.
Fig. 7 illustrates an exemplary system architecture 700 of a method for time selection upon test script recording or an apparatus for time selection upon test script recording to which embodiments of the present invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. The terminal devices 701, 702, 703 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 701, 702, 703. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for selecting time when recording the test script provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the apparatus for selecting time when recording the test script is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device or server implementing an embodiment of the present invention. The terminal device or the server shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware. The described units or modules may also be provided in a processor, and may be described as: a processor includes a time identification module, a numerical processing module, and a time selection module. Where the names of these units or modules do not in some cases constitute a limitation on the units or modules themselves, for example, the time identification module may also be described as a "module for identifying the initial time of the time control display".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: identifying an initial time of display of a time control, the initial time comprising at least one time element and an initial value thereof; for each time element, acquiring a coordinate distance between an initial value and an adjacent value of the time element, wherein the adjacent value is a value adjacent to the initial value in the values of the same time element of the time control, and calculating a difference value between a target value of the time element and the initial value in a preset target time; and simulating the user to finish time selection according to the coordinate distance and the difference value.
According to the technical scheme of the embodiment of the invention, the initial time displayed by the time control is identified, and the initial time comprises at least one time element and an initial value thereof; for each time element, acquiring a coordinate distance between an initial value and an adjacent value of the time element, wherein the adjacent value is a value adjacent to the initial value in the values of the same time element of the time control, and calculating a difference value between a target value and the initial value of the time element in preset target time; the user is simulated according to the coordinate distance and the difference value to complete time selection, the user can be simulated only through codes without participation of the user, the method is applicable to different mobile equipment models, operating system versions, screen sizes, resolution ratios, different applications and the like, the test script is good in compatibility and high in flexibility, and a large amount of labor cost is saved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for selecting time when a test script is recorded is characterized by comprising the following steps:
identifying an initial time of display of a time control, the initial time comprising at least one time element and an initial value thereof;
for each time element, acquiring a coordinate distance between an initial value and an adjacent value of the time element, wherein the adjacent value is a value adjacent to the initial value in the values of the same time element of the time control, and calculating a difference value between a target value of the time element and the initial value in a preset target time;
and simulating the user to finish time selection according to the coordinate distance and the difference value.
2. The method of claim 1, wherein obtaining a coordinate distance between an initial value and an adjacent value of the time element comprises:
respectively acquiring an initial value of the time element and a coordinate value of an adjacent value through a coordinate acquisition tool;
and calculating the absolute value of the difference between the coordinate value of the initial value and the coordinate value of the adjacent value to obtain the coordinate distance.
3. The method of claim 1, wherein simulating a user completion time selection based on the coordinate distance and the difference comprises:
judging the sliding direction according to the difference value;
taking the coordinate distance as a unit distance of each sliding, sliding the time element along the sliding direction and acquiring a current value after each sliding;
when the current value is equal to the target value, time selection is completed.
4. The method of claim 1, wherein simulating a user completion time selection based on the coordinate distance and the difference comprises:
judging the sliding direction according to the difference value;
obtaining the sliding distance of the time element according to the coordinate distance and the absolute value of the difference;
and sliding the time element along the sliding direction according to the sliding distance so as to enable the sliding value to be the target value, and finishing time selection.
5. An apparatus for selecting time when recording a test script, comprising:
the time identification module is used for identifying the initial time displayed by the time control, and the initial time comprises at least one time element and an initial value thereof;
the numerical value processing module is used for acquiring the coordinate distance between the initial value and the adjacent value of each time element, wherein the adjacent value is the value adjacent to the initial value in the values of the same time element of the time control, and calculating the difference value between the target value and the initial value of the time element in the preset target time;
and the time selection module is used for simulating the completion of time selection of the user according to the coordinate distance and the difference value.
6. The apparatus of claim 5, wherein the numerical processing module is further configured to:
respectively acquiring an initial value of the time element and a coordinate value of an adjacent value through a coordinate acquisition tool;
and calculating the absolute value of the difference between the coordinate value of the initial value and the coordinate value of the adjacent value to obtain the coordinate distance.
7. The apparatus of claim 5, wherein the time selection module is further configured to:
judging the sliding direction according to the difference value;
taking the coordinate distance as a unit distance of each sliding, sliding the time element along the sliding direction and acquiring a current value after each sliding;
when the current value is equal to the target value, time selection is completed.
8. The apparatus of claim 5, wherein the time selection module is further configured to:
judging the sliding direction according to the difference value;
obtaining the sliding distance of the time element according to the coordinate distance and the absolute value of the difference;
and sliding the time element along the sliding direction according to the sliding distance so as to enable the sliding value to be the target value, and finishing time selection.
9. An electronic device for time selection when recording a test script, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201910729269.6A 2019-08-08 2019-08-08 Method and device for selecting time when test script is recorded Active CN110457219B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN201910729269.6A CN110457219B (en) 2019-08-08 2019-08-08 Method and device for selecting time when test script is recorded
PCT/CN2020/106706 WO2021023171A1 (en) 2019-08-08 2020-08-04 Method and apparatus for test script recording time selection
JP2022506362A JP7255827B2 (en) 2019-08-08 2020-08-04 METHOD AND APPARATUS FOR TIME SELECTION WHEN TEST SCRIPT RECORDING

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910729269.6A CN110457219B (en) 2019-08-08 2019-08-08 Method and device for selecting time when test script is recorded

Publications (2)

Publication Number Publication Date
CN110457219A CN110457219A (en) 2019-11-15
CN110457219B true CN110457219B (en) 2021-06-22

Family

ID=68485324

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910729269.6A Active CN110457219B (en) 2019-08-08 2019-08-08 Method and device for selecting time when test script is recorded

Country Status (3)

Country Link
JP (1) JP7255827B2 (en)
CN (1) CN110457219B (en)
WO (1) WO2021023171A1 (en)

Families Citing this family (2)

* 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
CN111124888B (en) * 2019-11-28 2021-09-10 腾讯科技(深圳)有限公司 Method and device for generating recording script and electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528402A (en) * 2016-09-28 2017-03-22 惠州Tcl移动通信有限公司 Method and system for testing terminal
CN107562610A (en) * 2017-09-21 2018-01-09 上海谦问万答吧云计算科技有限公司 Obtain method, apparatus, terminal and the medium of page load time

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11119900A (en) * 1997-10-20 1999-04-30 Fujitsu Takamisawa Component Ltd Device and method for touch input panel test
JP6608576B2 (en) * 2013-06-26 2019-11-20 京セラ株式会社 Electronic device and display control method
JP6326742B2 (en) * 2013-08-29 2018-05-23 富士通株式会社 Scenario generation program, scenario execution program, scenario generation method, scenario execution method, scenario generation apparatus, and scenario execution apparatus
CN105022687B (en) * 2014-04-22 2018-10-26 腾讯科技(深圳)有限公司 The implementation method and device of slide in automatic test scheme
JP5840311B2 (en) * 2015-01-28 2016-01-06 グリー株式会社 Display data creation method, control program, computer and terminal
US11023363B2 (en) * 2016-03-11 2021-06-01 Spirent Communications, Inc. Performance test application sequence script
CN109062793B (en) * 2018-07-23 2022-03-04 北京云测信息技术有限公司 Test method and device of roller control and electronic equipment
CN110457219B (en) * 2019-08-08 2021-06-22 中国建设银行股份有限公司 Method and device for selecting time when test script is recorded

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528402A (en) * 2016-09-28 2017-03-22 惠州Tcl移动通信有限公司 Method and system for testing terminal
CN107562610A (en) * 2017-09-21 2018-01-09 上海谦问万答吧云计算科技有限公司 Obtain method, apparatus, terminal and the medium of page load time

Also Published As

Publication number Publication date
CN110457219A (en) 2019-11-15
JP7255827B2 (en) 2023-04-11
JP2022543579A (en) 2022-10-13
WO2021023171A1 (en) 2021-02-11

Similar Documents

Publication Publication Date Title
CN111897740A (en) User interface testing method and device, electronic equipment and computer readable medium
CN113592535B (en) Advertisement recommendation method and device, electronic equipment and storage medium
CN111045653A (en) System generation method and device, computer readable medium and electronic equipment
CN110457219B (en) Method and device for selecting time when test script is recorded
US9798650B1 (en) Application testing system and method
CN113138927A (en) Software function testing method and device
CN108196877A (en) The method and apparatus and computing device of component release management
CN113220563B (en) Test case generation method, system, storage medium and computer equipment
CN112905262A (en) Configuration method and device of aerospace measurement and control system
CN112988583A (en) Method and device for testing syntax compatibility of database
CN112783762A (en) Software quality evaluation method and device and server
CN110866205A (en) Method and apparatus for storing information
CN111984234A (en) Method and device for processing work order
CN109783745B (en) Method, device and computer equipment for personalized typesetting of pages
CN114265777B (en) Application program testing method and device, electronic equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN113448820B (en) Webpage testing method and device
CN110096392B (en) Method and device for outputting information
CN111061625A (en) Automatic testing method and device applied to out-of-order password keyboard
CN113296912A (en) Task processing method, device and system, storage medium and electronic equipment
CN110175116B (en) Test date switching method, device and system
CN113568535B (en) Map plate selecting method, map plate selecting device, medium and electronic equipment
CN111104626B (en) Information storage method and device
CN114595697B (en) Method, apparatus, server and medium for generating pre-labeled samples
CN113836037B (en) Interface interaction testing method, device, equipment and storage medium

Legal Events

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

Effective date of registration: 20220923

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Patentee after: CHINA CONSTRUCTION BANK Corp.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Patentee before: CHINA CONSTRUCTION BANK Corp.

Patentee before: Jianxin Financial Science and Technology Co.,Ltd.