+

WO2018121582A1 - Script generation method and device - Google Patents

Script generation method and device Download PDF

Info

Publication number
WO2018121582A1
WO2018121582A1 PCT/CN2017/118906 CN2017118906W WO2018121582A1 WO 2018121582 A1 WO2018121582 A1 WO 2018121582A1 CN 2017118906 W CN2017118906 W CN 2017118906W WO 2018121582 A1 WO2018121582 A1 WO 2018121582A1
Authority
WO
WIPO (PCT)
Prior art keywords
operation behavior
terminal device
information
behavior information
picture
Prior art date
Application number
PCT/CN2017/118906
Other languages
French (fr)
Chinese (zh)
Inventor
李珂
张辉
张�杰
樊苑苑
Original Assignee
北京奇虎科技有限公司
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 北京奇虎科技有限公司 filed Critical 北京奇虎科技有限公司
Publication of WO2018121582A1 publication Critical patent/WO2018121582A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3696Methods or tools to render software testable
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Definitions

  • the present disclosure relates to the field of computer software, and in particular, to a script generation method and apparatus.
  • the UI (User Interface) interface of the terminal device includes a lot of control information, such as various software APPs, weather information, time information, telephone shortcut operations, home page home keys, return keys, and the like.
  • control information such as various software APPs, weather information, time information, telephone shortcut operations, home page home keys, return keys, and the like.
  • the terminal device can perform corresponding functions by clicking, sliding, dragging, etc., which is convenient for the user to use.
  • Testing the UI interface of the terminal device requires the UI tester to write a special UI test script.
  • UI test scripts need to use their corresponding scripting language, which makes the technical level of UI testers more demanding.
  • the writing of a large number of UI test scripts takes a long time and manpower, which leads to inefficient testing.
  • the present disclosure has been made in order to provide a script generating method and apparatus that overcomes the above problems or at least partially solves the above problems.
  • a script generating method including:
  • the operation behavior information is recorded in the order in which the user operates on the browser
  • the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
  • a script generating apparatus including:
  • a synchronization module configured to display, on the browser, a picture including information about each control of the UI interface of the terminal device
  • a capture module configured to sequentially capture a behavior of a user operating a picture on a browser, and obtain related operation behavior information
  • a recording module configured to record the operation behavior information in the order in which the user operates on the browser
  • the generating module is configured to save the recorded operation behavior information, and generate a script file corresponding to the operation behavior information.
  • a computer program comprising:
  • Computer readable code when the computer readable code is run on a computing device, causes the computing device to perform the script generation method described above.
  • a computer readable medium comprising:
  • a picture including each control information of the terminal device UI interface is displayed on the browser; the behavior of the user operating the picture on the browser is sequentially captured, and related operation behavior information is acquired; Recording is performed in the order in which the user operates on the browser; the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
  • the operation behavior information of the corresponding terminal device UI interface can be obtained through the operation of the picture displayed on the browser.
  • the operation behavior information can be recorded and saved in the order of operation.
  • the saved script information can directly generate the corresponding script file without requiring the UI tester to manually write the script file.
  • the technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
  • FIG. 1 shows a flow chart of a script generation method according to an embodiment of the present disclosure
  • FIG. 2 shows a flowchart of a script generation method according to another embodiment of the present disclosure
  • FIG. 3 illustrates a flow chart of a script generation method according to still another embodiment of the present disclosure
  • FIG. 4 shows a flowchart of a script generation method according to still another embodiment of the present disclosure
  • FIG. 5 shows a functional block diagram of a script generating apparatus according to an embodiment of the present disclosure
  • FIG. 6 shows a functional block diagram of a script generating apparatus according to another embodiment of the present disclosure
  • FIG. 7 schematically illustrates a block diagram of a computing device for performing a script generation method in accordance with an embodiment of the present disclosure
  • FIG. 8 schematically illustrates a storage unit for holding or carrying program code that implements a script generation method according to an embodiment of the present disclosure.
  • FIG. 1 shows a flow chart of a script generation method in accordance with one embodiment of the present disclosure. As shown in FIG. 1 , the script generation method specifically includes the following steps:
  • Step S101 Display a picture including each control information of the terminal device UI interface on the browser.
  • the UI service of the terminal device is synchronized with the browser by using the process service in the terminal device, and the picture corresponding to the UI interface of the terminal device is displayed correspondingly on the browser.
  • the picture includes various control information of the terminal device UI interface.
  • the terminal device UI interface displays various control information including a software APP, a phone shortcut operation icon, a Home button, a return button, and the like, and the corresponding image displayed on the browser also includes the control information.
  • the operation of the picture displayed on the browser it may also be synchronized to the UI interface of the terminal device.
  • Step S102 sequentially capture the behavior of the user operating the picture on the browser, and obtain related operation behavior information.
  • the behavior of the user corresponding to the picture corresponding to the UI interface of the terminal device is sequentially captured by the user, and the related operation behavior information is acquired.
  • the related operation behavior information includes, for example, obtaining control information of the terminal device UI interface corresponding to the user operation picture.
  • Each control in the picture has its corresponding coordinate position. According to the action of the user's operation picture, the coordinate position of the picture is calculated, and the control in the picture corresponding to the position can be obtained, and the UI interface of the corresponding terminal device can be obtained.
  • the control information includes, for example, the control Id corresponding to the control in the terminal device UI interface, the class name when the control is executed, the text corresponding to the control name, and the coordinate position of the control in the image.
  • the related operation behavior information further includes information such as capturing the behavior of the user operating the picture on the browser, and converting the operation behavior of the corresponding terminal device UI interface.
  • the converted operation behavior includes a control such as clicking a terminal device UI interface, a sliding terminal device UI interface, a drag and drop terminal device UI interface control, a text input on the terminal device UI interface, and an operation key such as a Home button touching the terminal device UI interface. , return key and other behaviors.
  • the information of the operation behavior includes, for example, the name of the operation behavior, parameters involved in the execution of the operation behavior of the terminal device, and the like. Different operational behaviors involve different parameters, such as duration, call address, transfer parameters, coordinate position, and so on.
  • the parameters involved are the calling address; when the operation behavior is a sliding interface, the parameters involved are coordinate addresses, including the coordinate position of the sliding start and the sliding end; the operation behavior is the waiting time between the two operation behaviors. When it comes to the specific length of the parameters, such as 1.2s.
  • step S103 the operation behavior information is recorded in the order in which the user operates on the browser.
  • Step S104 the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
  • the operation behavior information acquired in step S102 is sequentially recorded in the order in which the user operates on the picture displayed by the browser, and the operation behavior information of the record is saved.
  • the saved operation behavior information can also generate a script file corresponding thereto, such as a json script file.
  • the script file can be used to test different types of terminal devices.
  • the operation behavior information saved in the test script file can be run normally on different types of terminal devices to detect the terminal device.
  • a picture including each control information of the terminal device UI interface is displayed on the browser; the behavior of the user operating the picture on the browser is sequentially captured, and related operation behavior information is acquired; and the operation behavior information is according to the user. Recording is performed in the order of operations on the browser; the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
  • the operation behavior information of the corresponding terminal device UI interface can be obtained through the operation of the picture displayed on the browser.
  • the operation behavior information can be recorded and saved in the order of operation.
  • the saved script information can directly generate the corresponding script file without requiring the UI tester to manually write the script file.
  • the technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
  • FIG. 2 shows a flow chart of a script generation method according to another embodiment of the present disclosure. As shown in FIG. 2, the script generation method specifically includes the following steps:
  • Step S201 displaying a picture including each control information of the terminal device UI interface on the browser.
  • Step S202 sequentially capture the behavior of the user operating the picture on the browser, and obtain related operation behavior information.
  • step S203 the operation behavior information is recorded in the order in which the user operates on the browser.
  • Step S204 modifying the record of the operation behavior information.
  • the recorded operation behavior information can also be modified. For example, when some operation behavior information in the recorded operation behavior information does not need to be tested, at least one operation behavior information that is not tested in the recorded operation behavior information may be deleted; if the recorded operation behavior information is already recorded When it is not applicable to the test, all the recorded operation behavior information may also be deleted, and steps S202-S203 are re-executed to record the new operation behavior information. Or when some operation behavior information cannot be obtained by the user's operation behavior on the picture, such as inputting a text search control. The operation behavior information that cannot be obtained by the user's operation behavior on the picture can be saved in the preset operation behavior information. Select at least one operation behavior information from the preset operation behavior information and add it to the recorded operation behavior information. After the addition, the order of the added operational behavior information can be further adjusted, and the added operational behavior information can be adjusted to the required order.
  • Step S205 the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
  • the operation behavior information of the record is saved, and the corresponding script file, such as a json script file, can also be generated for the saved operation behavior information.
  • the script file can be used to test different types of terminal devices.
  • the operation behavior information saved in the test script file can be run normally on different types of terminal devices to detect the terminal device.
  • the recording order of the operation behavior information may be modified, at least one operation behavior information may be deleted, or from a preset At least one operation behavior information is added to the recorded operation behavior information in the operation behavior information, so that the operation behavior information can be modified and adjusted according to the test requirement, which is more flexible and convenient to cope with different test requirements, so that the UI tester does not need Then write the script file manually.
  • the technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
  • FIG. 3 illustrates a flow chart of a script generation method in accordance with yet another embodiment of the present disclosure. As shown in FIG. 3, the script generation method specifically includes the following steps:
  • Step S301 displaying a picture including each control information of the terminal device UI interface on the browser.
  • Step S302 sequentially capturing the behavior of the user operating the picture on the browser, and acquiring related operation behavior information.
  • step S303 the operation behavior information is recorded in the order in which the user operates on the browser.
  • Step S304 The operation behavior information is transmitted to the terminal device, so that the terminal device performs the corresponding operation behavior according to the operation behavior information.
  • Step S305 receiving corresponding operation behavior result information returned by the terminal device.
  • Step S306 Determine, according to the operation behavior result information, whether the operation behavior is performed normally in the terminal device.
  • the obtained operation behavior information is transmitted to the terminal device by means of a network request, for the terminal device to perform the corresponding operation behavior according to the operation behavior information. Thereafter, the result information of the corresponding operation behavior returned by the terminal device is received. According to the operation behavior result information, combined with the operation behavior information, it can be determined whether the operation behavior is performed normally in the terminal device.
  • the operation behavior information is a certain control of clicking the UI interface of the terminal device, and the control is an APP icon of the installed software application, and the result information of the corresponding operation behavior returned by the received terminal device is to open the software application, and the operation behavior can be judged
  • the terminal device is normally executed; if the operation behavior information is dragging and dropping a certain control of the terminal device UI interface to a specified location, the control is an APP application icon of the installed software, and the result information of the corresponding operation behavior returned by the received terminal device is When the software application APP icon is moved to the designated, it can be judged that the operation behavior is performed normally in the terminal device.
  • the above are examples. The implementation is based on the actual situation, and is not specifically limited here.
  • step S307 is performed; otherwise, step S308 is performed.
  • Step S307 If the operation behavior is performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is normally marked.
  • the record of the operation behavior information corresponding to the operation behavior is normally marked.
  • the corresponding operation behavior information may be marked in the browser, and the operation behavior information is marked and passed.
  • marking it is possible to mark such as color, text, etc., mark the normally executed operation behavior information as green, or add a normally executed text symbol to mark the operation behavior information.
  • step S310 is performed.
  • Step S308 if the operation behavior is not normally executed by the terminal device, the record of the operation behavior information corresponding to the operation behavior is erroneously marked, and an error message prompt is returned.
  • the operation behavior is not performed normally in the terminal device, and the record of the operation behavior information corresponding to the operation behavior is incorrectly marked.
  • the corresponding operation behavior information may be marked in the browser, and the operation behavior information is marked.
  • marking it is possible to mark such as color, text, etc., mark the operation behavior information that is not normally executed as red, or add an abnormally executed text symbol to mark the operation behavior information. It can also return an error message corresponding to it. The error message indicates that the moving position is incorrect, the corresponding control is not opened, and the thinking time exceeds the set time.
  • step S309 the record of the operation behavior information is modified.
  • the terminal device analyzes according to the returned error information, and can modify the record of the operation behavior information correspondingly. If the original operation behavior information is deleted, a new parameter about the thinking time is added for a longer period of time. Operational behavior information, etc.
  • step S304 (not shown) may be re-executed, and the modified operation behavior information is transmitted to the terminal device, and steps S304-S309 are performed to test whether the operation behavior information can be normally executed by the terminal device.
  • step S310 it is determined whether the user triggers the save operation.
  • step S311 is performed. Otherwise, step S302 is executed to continue capturing the behavior of the user operating the picture on the browser, and obtaining related operation behavior information.
  • Step S311 the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
  • step S104 For the step, refer to step S104 in the embodiment of FIG. 1 , and details are not described herein again.
  • step S303 is performed by the browser, and the step S304 is transmitted to the terminal device, the two steps may not be limited to a specific execution sequence, and may also be performed simultaneously.
  • an operation behavior information is transmitted to the terminal device, so that the terminal device performs the corresponding operation behavior according to the operation behavior information.
  • the operation behavior result information it is judged whether the operation behavior is performed normally in the terminal device. If the operation behavior is not performed normally in the terminal device, the analysis may be performed according to the returned error information, and the operation behavior information may be modified. Therefore, it is tested whether the recorded operation behavior information is reasonable, and whether it can be used for testing the terminal device UI interface.
  • the record operation behavior information can also be modified and adjusted according to the actual situation, which is more flexible, so that the UI tester does not need to manually write the script file.
  • the technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
  • FIG. 4 shows a flow chart of a script generation method according to still another embodiment of the present disclosure. As shown in FIG. 4, the script generation method specifically includes the following steps:
  • Step S401 displaying a picture including each control information of the terminal device UI interface on the browser.
  • Step S402 sequentially capturing the behavior of the user operating the picture on the browser, and acquiring related operation behavior information.
  • step S403 the operation behavior information is recorded in the order in which the user operates on the browser.
  • Step S404 modifying the recording order of the operation behavior information.
  • Step S404 in this embodiment is an optional step. If the recording order of the operation behavior information is not required to be modified, the step may be skipped.
  • Step S405 The at least one operation behavior information is transmitted to the terminal device, so that the terminal device performs the corresponding operation behavior according to the operation behavior information.
  • Step S406 receiving corresponding operation behavior result information returned by the terminal device.
  • Step S407 Determine, according to the operation behavior result information, whether the operation behavior is performed normally in the terminal device.
  • Step S408 If the operation behavior is performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is normally marked.
  • step S411 is performed.
  • Step S409 if the operation behavior is not performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is erroneously marked, and an error message prompt is returned.
  • Step S410 modifying the record of the operation behavior information.
  • steps S405-S410 reference may be made to the description of steps S303-S307 in the embodiment of FIG. 3, and details are not described herein again.
  • step S411 it is determined whether the recorded operation behavior information is transmitted.
  • step S412 If the recorded operation behavior information has been transmitted to the terminal device, step S412 is performed. Otherwise, step S405 is executed to continue to transmit the subsequent operation behavior information of the recorded operation behavior information of the current transmission to the terminal device, and continue to perform steps S405-S410 to test whether the recorded operation behavior information can be normally executed in the terminal device. .
  • Step S412 the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
  • step S104 For the step, refer to step S104 in the embodiment of FIG. 1 , and details are not described herein again.
  • the recorded at least one operation behavior information is transmitted to the terminal device, so that the terminal device performs the corresponding operation behavior according to the operation behavior information.
  • the operation behavior result information it is judged whether the operation behavior is performed normally in the terminal device. It can be used to test whether the user operation behavior information is set in an orderly manner, and whether it can be used to test the terminal device UI interface.
  • the record operation behavior information can also be modified and adjusted according to the actual situation, which is more flexible, so that the UI tester does not need to manually write the script file.
  • the technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
  • FIG. 5 shows a functional block diagram of a script generating apparatus according to an embodiment of the present disclosure.
  • the script generating apparatus includes the following modules:
  • the synchronization module 510 is configured to display, on the browser, a picture including various control information of the terminal device UI interface.
  • the synchronization module 510 synchronizes the UI interface of the terminal device with the browser by using the process service in the terminal device, and correspondingly displays a picture corresponding to the terminal device UI interface on the browser.
  • the picture includes various control information of the terminal device UI interface.
  • the terminal device UI interface displays various control information including a software APP, a phone shortcut operation icon, a Home button, a return button, and the like, and the corresponding image displayed on the browser also includes the control information.
  • the operation of the synchronization module 510 for the picture displayed on the browser may also be synchronously synchronized to the UI interface of the terminal device.
  • the capturing module 520 is configured to sequentially capture the behavior of the user operating the picture on the browser, and obtain related operation behavior information.
  • the capturing module 520 sequentially captures the behavior of the user operating the picture corresponding to the terminal device UI interface on the browser, and acquires related operation behavior information.
  • the related operation behavior information includes control information such as the capture module 520 acquiring the terminal device UI interface corresponding to the user operation picture. Each control in the picture has its corresponding coordinate position, and the capture module 520 performs calculation according to the behavior of the user's operation picture in the coordinate position of the picture, and can obtain the control in the picture corresponding to the position, and the capture module 520 can obtain the corresponding The information of the control of the terminal device UI interface.
  • the control information includes a control Id corresponding to the control in the terminal device UI interface, a class name when the control is executed, a text corresponding to the control name, and a coordinate position of the control in the image.
  • the related operational behavior information further includes information such as the capture module 520 capturing the behavior of the user operating the image on the browser, and converting the acquired operational behavior of the corresponding terminal device UI interface.
  • the converted operation behavior includes a control such as clicking a terminal device UI interface, a sliding terminal device UI interface, a drag and drop terminal device UI interface control, a text input on the terminal device UI interface, and an operation key such as a Home button touching the terminal device UI interface. , return key and other behaviors.
  • the information of the operation behavior includes, for example, the name of the operation behavior, parameters involved in the execution of the operation behavior of the terminal device, and the like. Different operational behaviors involve different parameters, such as duration, call address, transfer parameters, coordinate position, and so on.
  • the parameters involved are the calling address; when the operation behavior is a sliding interface, the parameters involved are coordinate addresses, including the coordinate position of the sliding start and the sliding end; the operation behavior is the waiting time between the two operation behaviors. When it comes to the specific length of the parameters, such as 1.2s.
  • the recording module 530 is configured to record the operation behavior information in the order in which the user operates on the browser.
  • the generating module 540 is configured to save the recorded operation behavior information, and generate a script file corresponding to the operation behavior information.
  • the recording module 530 sequentially records the operation behavior information acquired by the capture module 520 in the order in which the user operates on the picture displayed by the browser, and the generation module 540 saves the recorded operation behavior information.
  • the generating module 540 can also generate a script file corresponding to the saved operation behavior information, such as a json script file.
  • the script file can be used to test different types of terminal devices.
  • the operation behavior information saved in the test script file can be run normally on different types of terminal devices to detect the terminal device.
  • a picture including various control information of the terminal device UI interface is displayed on the browser; the behavior of the user operating the picture on the browser is sequentially captured, and related operation behavior information is acquired; and the operation behavior information is according to the user. Recording is performed in the order of operations on the browser; the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
  • the operation behavior information of the corresponding terminal device UI interface can be obtained through the operation of the picture displayed on the browser.
  • the operation behavior information can be recorded and saved in the order of operation.
  • the saved script information can directly generate the corresponding script file without requiring the UI tester to manually write the script file.
  • the technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
  • FIG. 6 shows a functional block diagram of a script generating apparatus according to another embodiment of the present disclosure. As shown in FIG. 6, the difference from FIG. 5 is that the script generating apparatus further includes the following modules:
  • the modification module 550 is configured to modify the recording order of the operation behavior information.
  • the modification module 550 can also modify the recorded operation behavior information and modify the recording order of the operation behavior information.
  • the modification module 550 further includes a deletion module 551, as some operational behavior information in the already recorded operational behavior information does not need to be tested again.
  • the deleting module 551 may delete corresponding at least one operation behavior information that is not tested in the recorded operation behavior information; if the recorded operation behavior information is not applicable to the test, the deleting module 551 may delete all the recorded records.
  • the behavior information is re-executed, and the capture module 520 and the record module 530 are re-executed to re-record new operational behavior information. Or when some operation behavior information cannot be obtained by the user's operation behavior on the picture, such as inputting a text search control.
  • the modification module 550 further includes an add module 552.
  • the adding module 552 can save the operation behavior information that cannot be obtained by the user's operation behavior on the picture in the preset operation behavior information.
  • the adding module 552 selects at least one piece of operation behavior information from the preset operation behavior information and adds it to the recorded operation behavior information. After the adding module 552 is added, the order of the added operational behavior information may be further adjusted, and the added operational behavior information is adjusted to the required order.
  • the transmission module 560 is configured to transmit the at least one operation behavior information to the terminal device, so that the terminal device performs the corresponding operation behavior according to the operation behavior information.
  • the receiving module 570 is configured to receive corresponding operation behavior result information returned by the terminal device.
  • the determining module 580 is configured to determine, according to the operation behavior result information, whether the operation behavior is performed normally in the terminal device; if the operation behavior is performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is normally marked, and the next operation behavior is continued. If the operation behavior is not performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is erroneously marked, and an error message prompt is returned.
  • the transmission module 560 transmits the operation behavior information acquired by the capture module 520 to the terminal device by using a method such as a network request, and the terminal device performs the corresponding operation behavior according to the operation behavior information. Thereafter, the receiving module 570 receives result information of the corresponding operational behavior returned by the terminal device.
  • the determining module 580 can determine whether the operation behavior is performed normally in the terminal device according to the operation behavior result information and the operation behavior information.
  • the operation behavior information transmitted by the transmission module 560 is a certain control of the UI device of the terminal device, and the control is a software application APP icon installed by the terminal module, and the result information of the corresponding operation behavior returned by the terminal device received by the receiving module 570 is opened.
  • the software application the determining module 580 can determine that the operation behavior is performed normally in the terminal device; for example, the operation behavior information transmitted by the transmission module 560 is to drag a certain control of the terminal device UI interface to a specified location, and the control is an installed software application APP icon.
  • the result information of the corresponding operation behavior returned by the terminal device received by the receiving module 570 is that the software application APP icon moves to the designation, and the determining module 580 can determine that the operation behavior is performed normally in the terminal device.
  • the above are examples. The implementation is based on the actual situation, and is not specifically limited here.
  • the determining module 580 determines that the operation behavior is normally performed by the terminal device, and the determining module 580 performs normal marking of the operation behavior information corresponding to the operation behavior, for example, the determining module 580 can mark the corresponding operation behavior information in the browser, and mark The operational behavior information test passed.
  • the marking can be performed using, for example, color, text, etc.
  • the judging module 580 marks the normally executed operation behavior information as green, or the judging module 580 adds a normally executed character symbol to mark or the like before the operation behavior information.
  • the judging module 580 judges that the operation behavior is not performed normally in the terminal device, and the judging module 580 mismarks the record of the operation behavior information corresponding to the operation behavior, for example, the judging module 580 can mark the corresponding operation behavior information in the browser, and mark the There is a problem with the operational behavior information.
  • the marking may be performed using, for example, color, text, etc.
  • the judging module 580 marks the operation behavior information that is not normally executed as red, or the judging module 580 adds an unnaturally executed character symbol to mark the operation behavior information.
  • the determining module 580 can also return an error message corresponding to the prompt. The error message indicates that the moving position is incorrect, the corresponding control is not opened, and the thinking time exceeds the set time.
  • the determining module 580 determines that the operation behavior is not performed normally when the terminal device is not normally executed, and may further perform analysis according to the returned error information, and then perform corresponding modification operation behavior information, for example, the deleting module 551 deletes the original operation behavior information, and adds the module 552. Re-add a new information about the operation time of the parameter that thinks about time, and so on. Further, after the modification module 550 performs the modification, the transmission module 560 may be re-executed to transmit the operation behavior information to the terminal device, and the receiving module 570 and the determining module 580 are executed to test whether the operation behavior information can be normally executed by the terminal device.
  • the transmission module 560 may further transmit at least one of the operation behavior information of the recorded operation behavior information obtained by the deletion module 551 and/or the addition module 552 in the execution recording module 530 or the modification module 550 to the terminal device.
  • the transmission module 560 sequentially transmits the operation behavior information recorded by the recording module 530 or the modification module 550 to the terminal device during transmission. If the determination module 580 determines that the operation behavior is performed normally after the terminal device is executed, the transmission module 560 sequentially performs the operation behavior information.
  • the latter operation behavior information is continuously transmitted to the terminal device, and the receiving module 570 and the determining module 580 are repeatedly executed to test whether the recorded operation behavior information can be normally executed in the terminal device.
  • the judging module 580 judges that the operation behavior is not performed normally in the terminal device, the analysis is performed according to the returned error information, and after the modification module 550 performs the modification, the operation behavior is deleted. Continue to execute the transmission module 560 and subsequent modules for testing.
  • At least one piece of operation behavior information is transmitted to the terminal device for the terminal device to perform a corresponding operation behavior according to the operation behavior information.
  • the operation behavior result information it is judged whether the operation behavior is performed normally in the terminal device. If the operation behavior is not performed normally in the terminal device, the analysis may be performed according to the returned error information, and the operation behavior information may be modified. Therefore, it is tested whether the recorded operation behavior information is reasonable, and whether it can be used for testing the terminal device UI interface. Moreover, it is also reasonable to test the user operation behavior information in an overall order.
  • the record operation behavior information can also be modified and adjusted according to the actual situation, which is more flexible, so that the UI tester does not need to manually write the script file.
  • the technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
  • FIG. 7 schematically illustrates a block diagram of a computing device for executing a script generation method in accordance with an embodiment of the present disclosure.
  • the computing device traditionally includes a processor 710 and a computer program product or computer readable medium in the form of a storage device 720.
  • Storage device 720 can be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • Storage device 720 has a storage space 730 that stores program code 731 for performing any of the method steps described above.
  • storage space 730 storing program code may include various program code 731 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • include program code carriers such as a hard disk, a compact disk (CD), a memory card, or a floppy disk.
  • a computer program product is typically a portable or fixed storage unit such as that shown in FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to storage device 720 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • a storage unit includes computer readable code 731' for performing the steps of the method in accordance with the present disclosure, ie, code that can be read by a processor, such as 710, that when executed by a computing device causes the computing device Perform the various steps in the method described above.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • Various component embodiments of the present disclosure may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components of the script generating apparatus in accordance with embodiments of the present disclosure.
  • the present disclosure may also be implemented as a device or device program (eg, a computer program and a computer program product) for performing some or all of the methods described herein.
  • Such a program implementing the present disclosure may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • User Interface Of Digital Computer (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure discloses a script generation method and device. The method comprises: displaying on a browser an image comprising all control element information of a user interface (UI) of a terminal apparatus; sequentially capturing behaviors of a user operating the image on the browser to obtain associated operation behavior information; recording, according to an order of operations performed by the user and on the browser, the operation behavior information; and generating, according to the recorded operation behavior information, a script file corresponding to the operation behavior information.

Description

脚本生成方法及装置Script generation method and device
相关申请的交叉参考Cross-reference to related applications
本申请要求于2016年12月28日提交中国专利局、申请号为201611236929.X、名称为“脚本生成方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application, filed on Dec. 28, 2016, the filing date of
技术领域Technical field
本公开涉及计算机软件领域,具体涉及一种脚本生成方法及装置。The present disclosure relates to the field of computer software, and in particular, to a script generation method and apparatus.
背景技术Background technique
终端设备的UI(User Interface,用户界面)界面包括了很多控件信息,如各种软件APP、天气信息、时间信息、电话快捷操作、主页Home键、返回键等等。在使用终端设备的UI界面时,通过点击、滑动、拖拽等操作,可以使终端设备执行相应的功能,方便用户的使用。为保障终端设备执行的功能的正确性,需要对这些操作及终端设备对这些操作执行的功能进行测试。The UI (User Interface) interface of the terminal device includes a lot of control information, such as various software APPs, weather information, time information, telephone shortcut operations, home page home keys, return keys, and the like. When the UI interface of the terminal device is used, the terminal device can perform corresponding functions by clicking, sliding, dragging, etc., which is convenient for the user to use. In order to ensure the correctness of the functions performed by the terminal devices, it is necessary to test these operations and the functions performed by the terminal devices on these operations.
对终端设备的UI界面的测试,需要UI测试人员编写专门的UI测试脚本。UI测试脚本需要使用其对应的脚本语言,这使得对UI测试人员的技术水平要求较高。同时,大量UI测试脚本的编写需要花费较长的时间和人力,这导致测试的效率不高。Testing the UI interface of the terminal device requires the UI tester to write a special UI test script. UI test scripts need to use their corresponding scripting language, which makes the technical level of UI testers more demanding. At the same time, the writing of a large number of UI test scripts takes a long time and manpower, which leads to inefficient testing.
发明内容Summary of the invention
鉴于上述问题,提出了本公开以便提供一种克服上述问题或者至少部分地解决上述问题的脚本生成方法及装置。In view of the above problems, the present disclosure has been made in order to provide a script generating method and apparatus that overcomes the above problems or at least partially solves the above problems.
根据本公开的一个方面,提供了一种脚本生成方法,其包括:According to an aspect of the present disclosure, a script generating method is provided, including:
在浏览器上显示包括终端设备UI界面各个控件信息的图片;Displaying a picture including information of each control of the terminal device UI interface on the browser;
依次捕捉用户在浏览器上操作图片的行为,获取相关的操作行为信息;Capturing the behavior of the user operating the image on the browser in turn, and obtaining related operational behavior information;
将操作行为信息按照用户在浏览器上操作的顺序进行记录;The operation behavior information is recorded in the order in which the user operates on the browser;
保存记录的操作行为信息,生成与操作行为信息对应的脚本文件。The recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
根据本公开的另一方面,提供了一种脚本生成装置,其包括:According to another aspect of the present disclosure, a script generating apparatus is provided, including:
同步模块,用于在浏览器上显示包括终端设备UI界面各个控件信息的图片;a synchronization module, configured to display, on the browser, a picture including information about each control of the UI interface of the terminal device;
捕捉模块,用于依次捕捉用户在浏览器上操作图片的行为,获取相关的操作行为信息;a capture module, configured to sequentially capture a behavior of a user operating a picture on a browser, and obtain related operation behavior information;
记录模块,用于将操作行为信息按照用户在浏览器上操作的顺序进行记录;a recording module, configured to record the operation behavior information in the order in which the user operates on the browser;
生成模块,用于保存记录的操作行为信息,生成与操作行为信息对应的脚本文件。The generating module is configured to save the recorded operation behavior information, and generate a script file corresponding to the operation behavior information.
根据本公开的另一方面,提供了一种计算机程序,包括:According to another aspect of the present disclosure, a computer program is provided, comprising:
计算机可读代码,当计算机可读代码在计算设备上运行时,导致计算设备执行上述脚本生成方法。Computer readable code, when the computer readable code is run on a computing device, causes the computing device to perform the script generation method described above.
根据本公开的又一方面,提供了一种计算机可读介质,包括:According to still another aspect of the present disclosure, a computer readable medium is provided, comprising:
存储了上述执行上述脚本生成方法。根据本公开提供的脚本生成方法及装置,在浏览器上显示包括终端设备UI界面各个控件信息的图片;依次捕捉用户在浏览器上操作图片的行为,获取相关的操作行为信息;将操作行为信息按照用户在浏览器上操作的顺序进行记录;保存记录的操作行为信息,生成与操作行为信息对应的脚本文件。利用本公开,可以通过对浏览器上显示的图片的操作,获取到对应的对终端设备UI界面的操作行为信息。并可以将操作行为信息按照操作顺序进行记录,并保存。对保存的操作行为信息可以直接生成对应的脚本文件,而不需要UI测试人员手动编写脚本文件。降低了对终端设备UI测试人员的技术要求,大大减轻了UI测试人员的工作量,节省了测试时花费的人力、时间,极大的提高了测试效率。The above-described execution of the script generation method is stored. According to the script generation method and apparatus provided by the present disclosure, a picture including each control information of the terminal device UI interface is displayed on the browser; the behavior of the user operating the picture on the browser is sequentially captured, and related operation behavior information is acquired; Recording is performed in the order in which the user operates on the browser; the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated. With the disclosure, the operation behavior information of the corresponding terminal device UI interface can be obtained through the operation of the picture displayed on the browser. The operation behavior information can be recorded and saved in the order of operation. The saved script information can directly generate the corresponding script file without requiring the UI tester to manually write the script file. The technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
上述说明仅是本公开技术方案的概述,为了能够更清楚了解本公开的技术手段,而可依照说明书的内容予以实施,并且为了让本公开的上述和其它目的、特征和优点能够更明显易懂,以下特举本公开的具体实施方式。The above description is only an overview of the technical solutions of the present disclosure, and the above-described and other objects, features and advantages of the present disclosure can be more clearly understood. Specific embodiments of the present disclosure are specifically described below.
附图概述BRIEF abstract
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本公开的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1示出了根据本公开一个实施例的脚本生成方法的流程图;FIG. 1 shows a flow chart of a script generation method according to an embodiment of the present disclosure;
图2示出了根据本公开另一个实施例的脚本生成方法的流程图;FIG. 2 shows a flowchart of a script generation method according to another embodiment of the present disclosure;
图3示出了根据本公开又一个实施例的脚本生成方法的流程图;FIG. 3 illustrates a flow chart of a script generation method according to still another embodiment of the present disclosure;
图4示出了根据本公开又一个实施例的脚本生成方法的流程图;FIG. 4 shows a flowchart of a script generation method according to still another embodiment of the present disclosure;
图5示出了根据本公开一个实施例的脚本生成装置的功能框图;FIG. 5 shows a functional block diagram of a script generating apparatus according to an embodiment of the present disclosure;
图6示出了根据本公开另一个实施例的脚本生成装置的功能框图;FIG. 6 shows a functional block diagram of a script generating apparatus according to another embodiment of the present disclosure;
图7示意性地示出了用于执行根据本公开实施例的脚本生成方法的计算设备的框图;以及FIG. 7 schematically illustrates a block diagram of a computing device for performing a script generation method in accordance with an embodiment of the present disclosure;
图8示意性地示出了用于保持或者携带实现根据本公开实施例的脚本生成方法的程序代码的存储单元。FIG. 8 schematically illustrates a storage unit for holding or carrying program code that implements a script generation method according to an embodiment of the present disclosure.
本公开的较佳实施方式Preferred embodiment of the present disclosure
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the embodiments of the present invention have been shown in the drawings, the embodiments Rather, these embodiments are provided so that this disclosure will be more fully understood and the scope of the disclosure will be fully disclosed.
图1示出了根据本公开一个实施例的脚本生成方法的流程图。如图1所示,脚本生成方法具体包括如下步骤:FIG. 1 shows a flow chart of a script generation method in accordance with one embodiment of the present disclosure. As shown in FIG. 1 , the script generation method specifically includes the following steps:
步骤S101,在浏览器上显示包括终端设备UI界面各个控件信息的图片。Step S101: Display a picture including each control information of the terminal device UI interface on the browser.
利用终端设备中的进程服务,将终端设备的UI界面与浏览器同步,并在浏览器上相应的显示与终端设备UI界面对应的图片。其中,图片中包括了终端设备UI界面各个控件信息。如终端设备UI界面上显示了包括如某软件APP、电话快捷操作图标、Home键、返回键等各个控件信息,相应的在浏览器上显示的图片也包括这些控件信息。The UI service of the terminal device is synchronized with the browser by using the process service in the terminal device, and the picture corresponding to the UI interface of the terminal device is displayed correspondingly on the browser. The picture includes various control information of the terminal device UI interface. For example, the terminal device UI interface displays various control information including a software APP, a phone shortcut operation icon, a Home button, a return button, and the like, and the corresponding image displayed on the browser also includes the control information.
进一步,对于在浏览器上显示的图片的操作,还可以对应的将其同步至终端设备的UI界面。Further, for the operation of the picture displayed on the browser, it may also be synchronized to the UI interface of the terminal device.
步骤S102,依次捕捉用户在浏览器上操作图片的行为,获取相关的操作行为信息。Step S102: sequentially capture the behavior of the user operating the picture on the browser, and obtain related operation behavior information.
依次捕捉用户在浏览器上操作与终端设备UI界面对应的图片的行为,获取相关的操作行为信息。The behavior of the user corresponding to the picture corresponding to the UI interface of the terminal device is sequentially captured by the user, and the related operation behavior information is acquired.
相关的操作行为信息包括如获取用户操作图片对应的终端设备UI界面的控件信息。图片中各个控件都有其对应的坐标位置,根据用户操作图片的行为作用在图片的坐标位置进行计算,可以得到该位置具体对应的图片中的控件,进而可以获取到对应的终端设备UI界面的该控件的信息。控件信息包括如控件在终端设备UI界面对应的控件Id、控件执行时的类名、控件名称对应的文字、控件在图片中的坐标位置等。The related operation behavior information includes, for example, obtaining control information of the terminal device UI interface corresponding to the user operation picture. Each control in the picture has its corresponding coordinate position. According to the action of the user's operation picture, the coordinate position of the picture is calculated, and the control in the picture corresponding to the position can be obtained, and the UI interface of the corresponding terminal device can be obtained. The information for this control. The control information includes, for example, the control Id corresponding to the control in the terminal device UI interface, the class name when the control is executed, the text corresponding to the control name, and the coordinate position of the control in the image.
相关的操作行为信息还包括如捕捉用户在浏览器上操作图片的行为,将其转换获取到对应的终端设备UI界面的操作行为的信息。转换后的操作行为包括如点击终端设备UI界面的控件、滑动终端设备UI界面、拖拽终端设备UI界面的控件、在终端设备UI界面输入文字、触碰终端设备UI界面的操作键如Home键、返回键等行为。操作行为的信息包括了如操作行为的名称、终端设备在执行操作行为时涉及的参数等。不同操作行为涉及不同的参数,参数可以为如时长、调用地址、传递参数、坐标位置等。如操作行为为点击控件时,涉及的参数为调用地址;操作行为为滑动界面时,涉及的参数为坐标地址,包括滑动开始和滑动结束的坐标位置;操作行为为两个操作行为间的等待时间时,涉及参数具体的时长,如1.2s等。The related operation behavior information further includes information such as capturing the behavior of the user operating the picture on the browser, and converting the operation behavior of the corresponding terminal device UI interface. The converted operation behavior includes a control such as clicking a terminal device UI interface, a sliding terminal device UI interface, a drag and drop terminal device UI interface control, a text input on the terminal device UI interface, and an operation key such as a Home button touching the terminal device UI interface. , return key and other behaviors. The information of the operation behavior includes, for example, the name of the operation behavior, parameters involved in the execution of the operation behavior of the terminal device, and the like. Different operational behaviors involve different parameters, such as duration, call address, transfer parameters, coordinate position, and so on. If the operation behavior is a click control, the parameters involved are the calling address; when the operation behavior is a sliding interface, the parameters involved are coordinate addresses, including the coordinate position of the sliding start and the sliding end; the operation behavior is the waiting time between the two operation behaviors. When it comes to the specific length of the parameters, such as 1.2s.
以上均为举例说明,实施时根据实际情况进行设置,此处不做具体限定。The above are examples. The implementation is based on the actual situation, and is not specifically limited here.
步骤S103,将操作行为信息按照用户在浏览器上操作的顺序进行记录。In step S103, the operation behavior information is recorded in the order in which the user operates on the browser.
步骤S104,保存记录的操作行为信息,生成与操作行为信息对应的脚本文件。Step S104, the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
将步骤S102获取到的操作行为信息按照用户在浏览器显示的图片上操作的顺序依次进行记录,将该记录的操作行为信息保存。对保存后的操作行为信息还可以生成与其对应的脚本文件,如json脚本文件。脚本文件可以适用 于对不同型号的终端设备进行测试,测试脚本文件中保存的操作行为信息可以在不同型号的终端设备上正常运行,以实现对终端设备的检测。The operation behavior information acquired in step S102 is sequentially recorded in the order in which the user operates on the picture displayed by the browser, and the operation behavior information of the record is saved. The saved operation behavior information can also generate a script file corresponding thereto, such as a json script file. The script file can be used to test different types of terminal devices. The operation behavior information saved in the test script file can be run normally on different types of terminal devices to detect the terminal device.
根据本公开提供的脚本生成方法,在浏览器上显示包括终端设备UI界面各个控件信息的图片;依次捕捉用户在浏览器上操作图片的行为,获取相关的操作行为信息;将操作行为信息按照用户在浏览器上操作的顺序进行记录;保存记录的操作行为信息,生成与操作行为信息对应的脚本文件。利用本公开,可以通过对浏览器上显示的图片的操作,获取到对应的对终端设备UI界面的操作行为信息。并可以将操作行为信息按照操作顺序进行记录,并保存。对保存的操作行为信息可以直接生成对应的脚本文件,而不需要UI测试人员手动编写脚本文件。降低了对终端设备UI测试人员的技术要求,大大减轻了UI测试人员的工作量,节省了测试时花费的人力、时间,极大的提高了测试效率。According to the script generation method provided by the present disclosure, a picture including each control information of the terminal device UI interface is displayed on the browser; the behavior of the user operating the picture on the browser is sequentially captured, and related operation behavior information is acquired; and the operation behavior information is according to the user. Recording is performed in the order of operations on the browser; the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated. With the disclosure, the operation behavior information of the corresponding terminal device UI interface can be obtained through the operation of the picture displayed on the browser. The operation behavior information can be recorded and saved in the order of operation. The saved script information can directly generate the corresponding script file without requiring the UI tester to manually write the script file. The technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
图2示出了根据本公开另一个实施例的脚本生成方法的流程图。如图2所示,脚本生成方法具体包括如下步骤:FIG. 2 shows a flow chart of a script generation method according to another embodiment of the present disclosure. As shown in FIG. 2, the script generation method specifically includes the following steps:
步骤S201,在浏览器上显示包括终端设备UI界面各个控件信息的图片。Step S201, displaying a picture including each control information of the terminal device UI interface on the browser.
步骤S202,依次捕捉用户在浏览器上操作图片的行为,获取相关的操作行为信息。Step S202: sequentially capture the behavior of the user operating the picture on the browser, and obtain related operation behavior information.
步骤S203,将操作行为信息按照用户在浏览器上操作的顺序进行记录。In step S203, the operation behavior information is recorded in the order in which the user operates on the browser.
以上步骤可参考图1实施例中步骤S101-S103,在此不再赘述。For the above steps, reference may be made to steps S101-S103 in the embodiment of FIG. 1 , and details are not described herein again.
步骤S204,修改操作行为信息的记录。Step S204, modifying the record of the operation behavior information.
根据测试需要,还可以对已经记录的操作行为信息进行修改。如当已经记录的操作行为信息中有些操作行为信息不需要再进行测试时,可以删除已经记录的操作行为信息中的对应的不再测试的至少一项操作行为信息;若已经记录的操作行为信息均不适用于测试时,还可以删除所有已经记录的操作行为信息,重新执行步骤S202-S203,记录新的操作行为信息。或者对于有些操作行为信息无法通过用户对图片的操作行为获取时,如输入文字查找控件等。可以将这些无法通过用户对图片的操作行为获取的操作行为信息保存在预设的操作行为信息中。从预设的操作行为信息中选择至少一项操作行为信息,将其添加至已记录的操作行为信息中。在添加后,还可以进一步调整添 加后的操作行为信息的顺序,将添加的操作行为信息调整至需要的顺序。According to the test requirements, the recorded operation behavior information can also be modified. For example, when some operation behavior information in the recorded operation behavior information does not need to be tested, at least one operation behavior information that is not tested in the recorded operation behavior information may be deleted; if the recorded operation behavior information is already recorded When it is not applicable to the test, all the recorded operation behavior information may also be deleted, and steps S202-S203 are re-executed to record the new operation behavior information. Or when some operation behavior information cannot be obtained by the user's operation behavior on the picture, such as inputting a text search control. The operation behavior information that cannot be obtained by the user's operation behavior on the picture can be saved in the preset operation behavior information. Select at least one operation behavior information from the preset operation behavior information and add it to the recorded operation behavior information. After the addition, the order of the added operational behavior information can be further adjusted, and the added operational behavior information can be adjusted to the required order.
步骤S205,保存记录的操作行为信息,生成与操作行为信息对应的脚本文件。Step S205, the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
保存记录的操作行为信息,对保存后的操作行为信息还可以生成与其对应的脚本文件,如json脚本文件。脚本文件可以适用于对不同型号的终端设备进行测试,测试脚本文件中保存的操作行为信息可以在不同型号的终端设备上正常运行,以实现对终端设备的检测。The operation behavior information of the record is saved, and the corresponding script file, such as a json script file, can also be generated for the saved operation behavior information. The script file can be used to test different types of terminal devices. The operation behavior information saved in the test script file can be run normally on different types of terminal devices to detect the terminal device.
根据本公开提供的脚本生成方法,在将操作行为信息按照用户在浏览器上操作的顺序进行记录后,还可以修改操作行为信息的记录顺序,删除至少一项操作行为信息,或从预设的操作行为信息中选择至少一项操作行为信息添加至已记录的操作行为信息中,使得操作行为信息可以根据测试需求进行修改调整,更加灵活、更方便应对不同的测试要求,使得UI测试人员不需要再手动编写脚本文件。降低了对终端设备UI测试人员的技术要求,大大减轻了UI测试人员的工作量,节省了测试时花费的人力、时间,极大的提高了测试效率。According to the script generation method provided by the present disclosure, after the operation behavior information is recorded in the order in which the user operates on the browser, the recording order of the operation behavior information may be modified, at least one operation behavior information may be deleted, or from a preset At least one operation behavior information is added to the recorded operation behavior information in the operation behavior information, so that the operation behavior information can be modified and adjusted according to the test requirement, which is more flexible and convenient to cope with different test requirements, so that the UI tester does not need Then write the script file manually. The technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
图3示出了根据本公开又一个实施例的脚本生成方法的流程图。如图3所示,脚本生成方法具体包括如下步骤:FIG. 3 illustrates a flow chart of a script generation method in accordance with yet another embodiment of the present disclosure. As shown in FIG. 3, the script generation method specifically includes the following steps:
步骤S301,在浏览器上显示包括终端设备UI界面各个控件信息的图片。Step S301, displaying a picture including each control information of the terminal device UI interface on the browser.
步骤S302,依次捕捉用户在浏览器上操作图片的行为,获取相关的操作行为信息。Step S302, sequentially capturing the behavior of the user operating the picture on the browser, and acquiring related operation behavior information.
步骤S303,将操作行为信息按照用户在浏览器上操作的顺序进行记录。In step S303, the operation behavior information is recorded in the order in which the user operates on the browser.
以上步骤可参考图1实施例中步骤S101-S103,在此不再赘述。For the above steps, reference may be made to steps S101-S103 in the embodiment of FIG. 1 , and details are not described herein again.
步骤S304,将一项操作行为信息传输给终端设备,以供终端设备根据操作行为信息,执行对应的操作行为。Step S304: The operation behavior information is transmitted to the terminal device, so that the terminal device performs the corresponding operation behavior according to the operation behavior information.
步骤S305,接收终端设备返回的对应的操作行为结果信息。Step S305, receiving corresponding operation behavior result information returned by the terminal device.
步骤S306,根据操作行为结果信息,判断操作行为是否在终端设备正常执行。Step S306: Determine, according to the operation behavior result information, whether the operation behavior is performed normally in the terminal device.
将获取的操作行为信息通过如网络请求等方式传输给终端设备,供终端 设备根据操作行为信息,执行对应的操作行为。之后,接收终端设备返回的对应的操作行为的结果信息。根据操作行为结果信息,结合操作行为信息,可以判断操作行为是否在终端设备正常执行。如操作行为信息为点击终端设备UI界面的某个控件,该控件为安装的某软件应用APP图标,接收的终端设备返回的对应的操作行为的结果信息为打开该软件应用,可以判断操作行为在终端设备正常执行;如操作行为信息为拖拽终端设备UI界面的某个控件至指定位置,该控件为安装的某软件应用APP图标,接收的终端设备返回的对应的操作行为的结果信息为该软件应用APP图标移动至指定为止,可以判断操作行为在终端设备正常执行等。以上均为举例说明,实施时根据实际情况进行设置,此处不做具体限定。The obtained operation behavior information is transmitted to the terminal device by means of a network request, for the terminal device to perform the corresponding operation behavior according to the operation behavior information. Thereafter, the result information of the corresponding operation behavior returned by the terminal device is received. According to the operation behavior result information, combined with the operation behavior information, it can be determined whether the operation behavior is performed normally in the terminal device. For example, the operation behavior information is a certain control of clicking the UI interface of the terminal device, and the control is an APP icon of the installed software application, and the result information of the corresponding operation behavior returned by the received terminal device is to open the software application, and the operation behavior can be judged The terminal device is normally executed; if the operation behavior information is dragging and dropping a certain control of the terminal device UI interface to a specified location, the control is an APP application icon of the installed software, and the result information of the corresponding operation behavior returned by the received terminal device is When the software application APP icon is moved to the designated, it can be judged that the operation behavior is performed normally in the terminal device. The above are examples. The implementation is based on the actual situation, and is not specifically limited here.
若判断操作行为在终端设备正常执行,执行步骤S307,否则,执行步骤S308。If it is determined that the operation behavior is normally performed in the terminal device, step S307 is performed; otherwise, step S308 is performed.
步骤S307,若操作行为在终端设备正常执行,将操作行为对应的操作行为信息的记录进行正常标记。Step S307: If the operation behavior is performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is normally marked.
操作行为在终端设备正常执行时,将该操作行为对应的操作行为信息的记录进行正常标记,如可以在浏览器中将对应的操作行为信息进行标记,标记该操作行为信息测试通过。标记时可以使用如颜色、文字等进行标记,将正常执行的操作行为信息标记为绿色、或在操作行为信息前添加正常执行的文字符号进行标记等。When the terminal device is normally executed, the record of the operation behavior information corresponding to the operation behavior is normally marked. For example, the corresponding operation behavior information may be marked in the browser, and the operation behavior information is marked and passed. When marking, it is possible to mark such as color, text, etc., mark the normally executed operation behavior information as green, or add a normally executed text symbol to mark the operation behavior information.
在正常标记后,执行步骤S310。After the normal flag, step S310 is performed.
步骤S308,若操作行为在终端设备不正常执行,将操作行为对应的操作行为信息的记录进行错误标记,返回错误信息提示。Step S308, if the operation behavior is not normally executed by the terminal device, the record of the operation behavior information corresponding to the operation behavior is erroneously marked, and an error message prompt is returned.
操作行为在终端设备不正常执行,将操作行为对应的操作行为信息的记录进行错误标记,如可以在浏览器中将对应的操作行为信息进行标记,标记该操作行为信息发生问题。标记时可以使用如颜色、文字等进行标记,将不正常执行的操作行为信息标记为红色、或在操作行为信息前添加不正常执行的文字符号进行标记等。还可以对应的返回错误信息提示。错误信息提示如移动位置不正确、未打开对应的控件、思考时间超过设置的时长等。The operation behavior is not performed normally in the terminal device, and the record of the operation behavior information corresponding to the operation behavior is incorrectly marked. For example, the corresponding operation behavior information may be marked in the browser, and the operation behavior information is marked. When marking, it is possible to mark such as color, text, etc., mark the operation behavior information that is not normally executed as red, or add an abnormally executed text symbol to mark the operation behavior information. It can also return an error message corresponding to it. The error message indicates that the moving position is incorrect, the corresponding control is not opened, and the thinking time exceeds the set time.
步骤S309,修改操作行为信息的记录。In step S309, the record of the operation behavior information is modified.
操作行为在终端设备不正常执行时,根据返回的错误信息提示进行分析,可以对应的修改操作行为信息的记录,如将原操作行为信息删除,重新添加一条新的关于思考时间的参数时长较长的操作行为信息等。When the terminal device is not properly executed, the terminal device analyzes according to the returned error information, and can modify the record of the operation behavior information correspondingly. If the original operation behavior information is deleted, a new parameter about the thinking time is added for a longer period of time. Operational behavior information, etc.
进一步,在修改后,还可以重新执行步骤S304(图中未示出),将修改的操作行为信息传输给终端设备,执行步骤S304-S309,以测试该操作行为信息是否能终端设备正常执行。Further, after the modification, step S304 (not shown) may be re-executed, and the modified operation behavior information is transmitted to the terminal device, and steps S304-S309 are performed to test whether the operation behavior information can be normally executed by the terminal device.
步骤S310,判断用户是否触发保存操作。In step S310, it is determined whether the user triggers the save operation.
判断用户是否触发了保存操作,若用户触发了保存操作,执行步骤S311,否则,执行步骤S302,继续捕捉用户在浏览器上操作图片的行为,获取相关的操作行为信息。If the user triggers the save operation, if the user triggers the save operation, step S311 is performed. Otherwise, step S302 is executed to continue capturing the behavior of the user operating the picture on the browser, and obtaining related operation behavior information.
步骤S311,保存记录的操作行为信息,生成与操作行为信息对应的脚本文件。Step S311, the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
该步骤可参考图1实施例中的步骤S104,在此不再赘述。For the step, refer to step S104 in the embodiment of FIG. 1 , and details are not described herein again.
进一步,由于步骤S303在浏览器执行,步骤S304传输给终端设备,两个步骤可以不限定具体的执行先后顺序,也可以同时执行。Further, since the step S303 is performed by the browser, and the step S304 is transmitted to the terminal device, the two steps may not be limited to a specific execution sequence, and may also be performed simultaneously.
根据本公开提供的脚本生成方法,将一项操作行为信息传输给终端设备,以供终端设备根据操作行为信息,执行对应的操作行为。接收终端设备返回的对应的操作行为结果信息。根据操作行为结果信息,判断操作行为是否在终端设备正常执行。若操作行为在终端设备不正常执行,还可以根据返回的错误信息提示进行分析,修改操作行为信息。从而测试记录的操作行为信息是否合理,是否可以用于对终端设备UI界面进行测试。同时,记录操作行为信息还可以根据实际情况进行修改调整,更加灵活,使得UI测试人员不需要再手动编写脚本文件。降低了对终端设备UI测试人员的技术要求,大大减轻了UI测试人员的工作量,节省了测试时花费的人力、时间,极大的提高了测试效率。According to the script generation method provided by the present disclosure, an operation behavior information is transmitted to the terminal device, so that the terminal device performs the corresponding operation behavior according to the operation behavior information. Receiving corresponding operation behavior result information returned by the terminal device. According to the operation behavior result information, it is judged whether the operation behavior is performed normally in the terminal device. If the operation behavior is not performed normally in the terminal device, the analysis may be performed according to the returned error information, and the operation behavior information may be modified. Therefore, it is tested whether the recorded operation behavior information is reasonable, and whether it can be used for testing the terminal device UI interface. At the same time, the record operation behavior information can also be modified and adjusted according to the actual situation, which is more flexible, so that the UI tester does not need to manually write the script file. The technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
图4示出了根据本公开又一个实施例的脚本生成方法的流程图。如图4所示,脚本生成方法具体包括如下步骤:FIG. 4 shows a flow chart of a script generation method according to still another embodiment of the present disclosure. As shown in FIG. 4, the script generation method specifically includes the following steps:
步骤S401,在浏览器上显示包括终端设备UI界面各个控件信息的图片。Step S401, displaying a picture including each control information of the terminal device UI interface on the browser.
步骤S402,依次捕捉用户在浏览器上操作图片的行为,获取相关的操作 行为信息。Step S402, sequentially capturing the behavior of the user operating the picture on the browser, and acquiring related operation behavior information.
步骤S403,将操作行为信息按照用户在浏览器上操作的顺序进行记录。In step S403, the operation behavior information is recorded in the order in which the user operates on the browser.
步骤S404,修改操作行为信息的记录顺序。Step S404, modifying the recording order of the operation behavior information.
以上步骤可参考图2实施例中步骤S201-S204,在此不再赘述。For the above steps, reference may be made to steps S201-S204 in the embodiment of FIG. 2, and details are not described herein again.
本实施例中步骤S404为可选步骤,若不需要修改操作行为信息的记录顺序时,可跳过该步骤。Step S404 in this embodiment is an optional step. If the recording order of the operation behavior information is not required to be modified, the step may be skipped.
步骤S405,将至少一项操作行为信息传输给终端设备,以供终端设备根据操作行为信息,执行对应的操作行为。Step S405: The at least one operation behavior information is transmitted to the terminal device, so that the terminal device performs the corresponding operation behavior according to the operation behavior information.
步骤S406,接收终端设备返回的对应的操作行为结果信息。Step S406, receiving corresponding operation behavior result information returned by the terminal device.
步骤S407,根据操作行为结果信息,判断操作行为是否在终端设备正常执行。Step S407: Determine, according to the operation behavior result information, whether the operation behavior is performed normally in the terminal device.
步骤S408,若操作行为在终端设备正常执行,将操作行为对应的操作行为信息的记录进行正常标记。Step S408: If the operation behavior is performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is normally marked.
在正常标记后,执行步骤S411。After the normal flag, step S411 is performed.
步骤S409,若操作行为在终端设备不正常执行,将操作行为对应的操作行为信息的记录进行错误标记,返回错误信息提示。Step S409, if the operation behavior is not performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is erroneously marked, and an error message prompt is returned.
步骤S410,修改操作行为信息的记录。Step S410, modifying the record of the operation behavior information.
步骤S405-S410可参考图3实施例中的步骤S303-S307的描述,在此不再赘述。For the steps S405-S410, reference may be made to the description of steps S303-S307 in the embodiment of FIG. 3, and details are not described herein again.
步骤S411,判断已记录的操作行为信息是否传输完毕。In step S411, it is determined whether the recorded operation behavior information is transmitted.
若已记录的操作行为信息均已经传输给终端设备,执行步骤S412。否则,执行步骤S405,将本次传输的记录的操作行为信息的后一操作行为信息继续传输给终端设备,继续执行步骤S405-S410,以测试记录的操作行为信息是否都能在终端设备正常执行。If the recorded operation behavior information has been transmitted to the terminal device, step S412 is performed. Otherwise, step S405 is executed to continue to transmit the subsequent operation behavior information of the recorded operation behavior information of the current transmission to the terminal device, and continue to perform steps S405-S410 to test whether the recorded operation behavior information can be normally executed in the terminal device. .
步骤S412,保存记录的操作行为信息,生成与操作行为信息对应的脚本文件。Step S412, the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
该步骤可参考图1实施例中的步骤S104,在此不再赘述。For the step, refer to step S104 in the embodiment of FIG. 1 , and details are not described herein again.
根据本公开提供的脚本生成方法,将记录的至少一项操作行为信息传输给终端设备,以供终端设备根据操作行为信息,执行对应的操作行为。接收终端设备返回的对应的操作行为结果信息。根据操作行为结果信息,判断操作行为是否在终端设备正常执行。可以整体的测试用户操作行为信息顺序设置的是否合理,是否可以用于对终端设备UI界面进行测试。同时,记录操作行为信息还可以根据实际情况进行修改调整,更加灵活,使得UI测试人员不需要再手动编写脚本文件。降低了对终端设备UI测试人员的技术要求,大大减轻了UI测试人员的工作量,节省了测试时花费的人力、时间,极大的提高了测试效率。According to the script generation method provided by the present disclosure, the recorded at least one operation behavior information is transmitted to the terminal device, so that the terminal device performs the corresponding operation behavior according to the operation behavior information. Receiving corresponding operation behavior result information returned by the terminal device. According to the operation behavior result information, it is judged whether the operation behavior is performed normally in the terminal device. It can be used to test whether the user operation behavior information is set in an orderly manner, and whether it can be used to test the terminal device UI interface. At the same time, the record operation behavior information can also be modified and adjusted according to the actual situation, which is more flexible, so that the UI tester does not need to manually write the script file. The technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
图5示出了根据本公开一个实施例的脚本生成装置的功能框图。如图5所示,脚本生成装置包括如下模块:FIG. 5 shows a functional block diagram of a script generating apparatus according to an embodiment of the present disclosure. As shown in FIG. 5, the script generating apparatus includes the following modules:
同步模块510,用于在浏览器上显示包括终端设备UI界面各个控件信息的图片。The synchronization module 510 is configured to display, on the browser, a picture including various control information of the terminal device UI interface.
同步模块510利用终端设备中的进程服务,将终端设备的UI界面与浏览器同步,并在浏览器上相应的显示与终端设备UI界面对应的图片。其中,图片中包括了终端设备UI界面各个控件信息。如终端设备UI界面上显示了包括如某软件APP、电话快捷操作图标、Home键、返回键等各个控件信息,相应的在浏览器上显示的图片也包括这些控件信息。The synchronization module 510 synchronizes the UI interface of the terminal device with the browser by using the process service in the terminal device, and correspondingly displays a picture corresponding to the terminal device UI interface on the browser. The picture includes various control information of the terminal device UI interface. For example, the terminal device UI interface displays various control information including a software APP, a phone shortcut operation icon, a Home button, a return button, and the like, and the corresponding image displayed on the browser also includes the control information.
进一步,同步模块510对于在浏览器上显示的图片的操作,还可以对应的将其同步至终端设备的UI界面。Further, the operation of the synchronization module 510 for the picture displayed on the browser may also be synchronously synchronized to the UI interface of the terminal device.
捕捉模块520,用于依次捕捉用户在浏览器上操作图片的行为,获取相关的操作行为信息。The capturing module 520 is configured to sequentially capture the behavior of the user operating the picture on the browser, and obtain related operation behavior information.
捕捉模块520依次捕捉用户在浏览器上操作与终端设备UI界面对应的图片的行为,获取相关的操作行为信息。The capturing module 520 sequentially captures the behavior of the user operating the picture corresponding to the terminal device UI interface on the browser, and acquires related operation behavior information.
相关的操作行为信息包括如捕捉模块520获取用户操作图片对应的终端设备UI界面的控件信息。图片中各个控件都有其对应的坐标位置,捕捉模块520根据用户操作图片的行为作用在图片的坐标位置进行计算,可以得到该位置具体对应的图片中的控件,进而捕捉模块520可以获取到对应的终端设备UI界面的该控件的信息。控件信息包括如控件在终端设备UI界面对应的控件 Id、控件执行时的类名、控件名称对应的文字、控件在图片中的坐标位置等。The related operation behavior information includes control information such as the capture module 520 acquiring the terminal device UI interface corresponding to the user operation picture. Each control in the picture has its corresponding coordinate position, and the capture module 520 performs calculation according to the behavior of the user's operation picture in the coordinate position of the picture, and can obtain the control in the picture corresponding to the position, and the capture module 520 can obtain the corresponding The information of the control of the terminal device UI interface. The control information includes a control Id corresponding to the control in the terminal device UI interface, a class name when the control is executed, a text corresponding to the control name, and a coordinate position of the control in the image.
相关的操作行为信息还包括如捕捉模块520捕捉用户在浏览器上操作图片的行为,将其转换获取到对应的终端设备UI界面的操作行为的信息。转换后的操作行为包括如点击终端设备UI界面的控件、滑动终端设备UI界面、拖拽终端设备UI界面的控件、在终端设备UI界面输入文字、触碰终端设备UI界面的操作键如Home键、返回键等行为。操作行为的信息包括了如操作行为的名称、终端设备在执行操作行为时涉及的参数等。不同操作行为涉及不同的参数,参数可以为如时长、调用地址、传递参数、坐标位置等。如操作行为为点击控件时,涉及的参数为调用地址;操作行为为滑动界面时,涉及的参数为坐标地址,包括滑动开始和滑动结束的坐标位置;操作行为为两个操作行为间的等待时间时,涉及参数具体的时长,如1.2s等。The related operational behavior information further includes information such as the capture module 520 capturing the behavior of the user operating the image on the browser, and converting the acquired operational behavior of the corresponding terminal device UI interface. The converted operation behavior includes a control such as clicking a terminal device UI interface, a sliding terminal device UI interface, a drag and drop terminal device UI interface control, a text input on the terminal device UI interface, and an operation key such as a Home button touching the terminal device UI interface. , return key and other behaviors. The information of the operation behavior includes, for example, the name of the operation behavior, parameters involved in the execution of the operation behavior of the terminal device, and the like. Different operational behaviors involve different parameters, such as duration, call address, transfer parameters, coordinate position, and so on. If the operation behavior is a click control, the parameters involved are the calling address; when the operation behavior is a sliding interface, the parameters involved are coordinate addresses, including the coordinate position of the sliding start and the sliding end; the operation behavior is the waiting time between the two operation behaviors. When it comes to the specific length of the parameters, such as 1.2s.
以上均为举例说明,实施时根据实际情况进行设置,此处不做具体限定。The above are examples. The implementation is based on the actual situation, and is not specifically limited here.
记录模块530,用于将操作行为信息按照用户在浏览器上操作的顺序进行记录。The recording module 530 is configured to record the operation behavior information in the order in which the user operates on the browser.
生成模块540,用于保存记录的操作行为信息,生成与操作行为信息对应的脚本文件。The generating module 540 is configured to save the recorded operation behavior information, and generate a script file corresponding to the operation behavior information.
记录模块530将捕捉模块520获取到的操作行为信息按照用户在浏览器显示的图片上操作的顺序依次进行记录,生成模块540将该记录的操作行为信息保存。生成模块540对保存后的操作行为信息还可以生成与其对应的脚本文件,如json脚本文件。脚本文件可以适用于对不同型号的终端设备进行测试,测试脚本文件中保存的操作行为信息可以在不同型号的终端设备上正常运行,以实现对终端设备的检测。The recording module 530 sequentially records the operation behavior information acquired by the capture module 520 in the order in which the user operates on the picture displayed by the browser, and the generation module 540 saves the recorded operation behavior information. The generating module 540 can also generate a script file corresponding to the saved operation behavior information, such as a json script file. The script file can be used to test different types of terminal devices. The operation behavior information saved in the test script file can be run normally on different types of terminal devices to detect the terminal device.
根据本公开提供的脚本生成装置,在浏览器上显示包括终端设备UI界面各个控件信息的图片;依次捕捉用户在浏览器上操作图片的行为,获取相关的操作行为信息;将操作行为信息按照用户在浏览器上操作的顺序进行记录;保存记录的操作行为信息,生成与操作行为信息对应的脚本文件。利用本公开,可以通过对浏览器上显示的图片的操作,获取到对应的对终端设备UI界面的操作行为信息。并可以将操作行为信息按照操作顺序进行记录,并保存。对保存的操作行为信息可以直接生成对应的脚本文件,而不需要UI测试人员 手动编写脚本文件。降低了对终端设备UI测试人员的技术要求,大大减轻了UI测试人员的工作量,节省了测试时花费的人力、时间,极大的提高了测试效率。According to the script generating apparatus provided by the present disclosure, a picture including various control information of the terminal device UI interface is displayed on the browser; the behavior of the user operating the picture on the browser is sequentially captured, and related operation behavior information is acquired; and the operation behavior information is according to the user. Recording is performed in the order of operations on the browser; the recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated. With the disclosure, the operation behavior information of the corresponding terminal device UI interface can be obtained through the operation of the picture displayed on the browser. The operation behavior information can be recorded and saved in the order of operation. The saved script information can directly generate the corresponding script file without requiring the UI tester to manually write the script file. The technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
图6示出了根据本公开另一个实施例的脚本生成装置的功能框图。如图6所示,与图5不同之处在于,脚本生成装置还包括如下模块:FIG. 6 shows a functional block diagram of a script generating apparatus according to another embodiment of the present disclosure. As shown in FIG. 6, the difference from FIG. 5 is that the script generating apparatus further includes the following modules:
修改模块550,用于修改操作行为信息的记录顺序。The modification module 550 is configured to modify the recording order of the operation behavior information.
根据测试需要,修改模块550还可以对已经记录的操作行为信息进行修改,修改操作行为信息的记录顺序。如当已经记录的操作行为信息中有些操作行为信息不需要再进行测试时,修改模块550进一步包括删除模块551。删除模块551可以删除已经记录的操作行为信息中的对应的不再测试的至少一项操作行为信息;若已经记录的操作行为信息均不适用于测试时,删除模块551还可以删除所有已经记录的操作行为信息,重新执行捕捉模块520和记录模块530,重新记录新的操作行为信息。或者对于有些操作行为信息无法通过用户对图片的操作行为获取时,如输入文字查找控件等。修改模块550进一步包括添加模块552。添加模块552可以将这些无法通过用户对图片的操作行为获取的操作行为信息先保存在预设的操作行为信息中。添加模块552从预设的操作行为信息中选择至少一项操作行为信息,将其添加至已记录的操作行为信息中。添加模块552在添加后,还可以进一步调整添加后的操作行为信息的顺序,将添加的操作行为信息调整至需要的顺序。According to the test requirements, the modification module 550 can also modify the recorded operation behavior information and modify the recording order of the operation behavior information. The modification module 550 further includes a deletion module 551, as some operational behavior information in the already recorded operational behavior information does not need to be tested again. The deleting module 551 may delete corresponding at least one operation behavior information that is not tested in the recorded operation behavior information; if the recorded operation behavior information is not applicable to the test, the deleting module 551 may delete all the recorded records. The behavior information is re-executed, and the capture module 520 and the record module 530 are re-executed to re-record new operational behavior information. Or when some operation behavior information cannot be obtained by the user's operation behavior on the picture, such as inputting a text search control. The modification module 550 further includes an add module 552. The adding module 552 can save the operation behavior information that cannot be obtained by the user's operation behavior on the picture in the preset operation behavior information. The adding module 552 selects at least one piece of operation behavior information from the preset operation behavior information and adds it to the recorded operation behavior information. After the adding module 552 is added, the order of the added operational behavior information may be further adjusted, and the added operational behavior information is adjusted to the required order.
传输模块560,用于将至少一项操作行为信息传输给终端设备,以供终端设备根据操作行为信息,执行对应的操作行为。The transmission module 560 is configured to transmit the at least one operation behavior information to the terminal device, so that the terminal device performs the corresponding operation behavior according to the operation behavior information.
接收模块570,用于接收终端设备返回的对应的操作行为结果信息。The receiving module 570 is configured to receive corresponding operation behavior result information returned by the terminal device.
判断模块580,用于根据操作行为结果信息,判断操作行为是否在终端设备正常执行;若操作行为在终端设备正常执行,将操作行为对应的操作行为信息的记录进行正常标记,继续下一操作行为;若操作行为在终端设备不正常执行,将操作行为对应的操作行为信息的记录进行错误标记,返回错误信息提示。The determining module 580 is configured to determine, according to the operation behavior result information, whether the operation behavior is performed normally in the terminal device; if the operation behavior is performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is normally marked, and the next operation behavior is continued. If the operation behavior is not performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is erroneously marked, and an error message prompt is returned.
传输模块560将捕捉模块520获取的操作行为信息通过如网络请求等方式传输给终端设备,供终端设备根据操作行为信息,执行对应的操作行为。 之后,接收模块570接收终端设备返回的对应的操作行为的结果信息。判断模块580根据操作行为结果信息,结合操作行为信息,可以判断操作行为是否在终端设备正常执行。如传输模块560传输的操作行为信息为点击终端设备UI界面的某个控件,该控件为安装的某软件应用APP图标,接收模块570接收的终端设备返回的对应的操作行为的结果信息为打开该软件应用,判断模块580可以判断操作行为在终端设备正常执行;如传输模块560传输的操作行为信息为拖拽终端设备UI界面的某个控件至指定位置,该控件为安装的某软件应用APP图标,接收模块570接收的终端设备返回的对应的操作行为的结果信息为该软件应用APP图标移动至指定为止,判断模块580可以判断操作行为在终端设备正常执行等。以上均为举例说明,实施时根据实际情况进行设置,此处不做具体限定。The transmission module 560 transmits the operation behavior information acquired by the capture module 520 to the terminal device by using a method such as a network request, and the terminal device performs the corresponding operation behavior according to the operation behavior information. Thereafter, the receiving module 570 receives result information of the corresponding operational behavior returned by the terminal device. The determining module 580 can determine whether the operation behavior is performed normally in the terminal device according to the operation behavior result information and the operation behavior information. For example, the operation behavior information transmitted by the transmission module 560 is a certain control of the UI device of the terminal device, and the control is a software application APP icon installed by the terminal module, and the result information of the corresponding operation behavior returned by the terminal device received by the receiving module 570 is opened. The software application, the determining module 580 can determine that the operation behavior is performed normally in the terminal device; for example, the operation behavior information transmitted by the transmission module 560 is to drag a certain control of the terminal device UI interface to a specified location, and the control is an installed software application APP icon. The result information of the corresponding operation behavior returned by the terminal device received by the receiving module 570 is that the software application APP icon moves to the designation, and the determining module 580 can determine that the operation behavior is performed normally in the terminal device. The above are examples. The implementation is based on the actual situation, and is not specifically limited here.
判断模块580判断操作行为在终端设备正常执行时,判断模块580将该操作行为对应的操作行为信息的记录进行正常标记,如判断模块580可以在浏览器中将对应的操作行为信息进行标记,标记该操作行为信息测试通过。判断模块580标记时可以使用如颜色、文字等进行标记,判断模块580将正常执行的操作行为信息标记为绿色、或判断模块580在操作行为信息前添加正常执行的文字符号进行标记等。The determining module 580 determines that the operation behavior is normally performed by the terminal device, and the determining module 580 performs normal marking of the operation behavior information corresponding to the operation behavior, for example, the determining module 580 can mark the corresponding operation behavior information in the browser, and mark The operational behavior information test passed. When the judging module 580 marks, the marking can be performed using, for example, color, text, etc., the judging module 580 marks the normally executed operation behavior information as green, or the judging module 580 adds a normally executed character symbol to mark or the like before the operation behavior information.
判断模块580判断操作行为在终端设备不正常执行,判断模块580将操作行为对应的操作行为信息的记录进行错误标记,如判断模块580可以在浏览器中将对应的操作行为信息进行标记,标记该操作行为信息发生问题。判断模块580标记时可以使用如颜色、文字等进行标记,判断模块580将不正常执行的操作行为信息标记为红色、或判断模块580在操作行为信息前添加不正常执行的文字符号进行标记等。判断模块580还可以对应的返回错误信息提示。错误信息提示如移动位置不正确、未打开对应的控件、思考时间超过设置的时长等。The judging module 580 judges that the operation behavior is not performed normally in the terminal device, and the judging module 580 mismarks the record of the operation behavior information corresponding to the operation behavior, for example, the judging module 580 can mark the corresponding operation behavior information in the browser, and mark the There is a problem with the operational behavior information. When the judging module 580 marks, the marking may be performed using, for example, color, text, etc., the judging module 580 marks the operation behavior information that is not normally executed as red, or the judging module 580 adds an unnaturally executed character symbol to mark the operation behavior information. The determining module 580 can also return an error message corresponding to the prompt. The error message indicates that the moving position is incorrect, the corresponding control is not opened, and the thinking time exceeds the set time.
进一步,判断模块580判断操作行为在终端设备不正常执行时,还可以根据返回的错误信息提示进行分析,进而执行对应的修改操作行为信息,如删除模块551将原操作行为信息删除,添加模块552重新添加一条新的关于思考时间的参数时长较长的操作行为信息等。进一步,在执行修改模块550进行修改后,还可以重新执行传输模块560将该操作行为信息传输给终端设 备,执行接收模块570和判断模块580,以测试该操作行为信息是否能终端设备正常执行。Further, the determining module 580 determines that the operation behavior is not performed normally when the terminal device is not normally executed, and may further perform analysis according to the returned error information, and then perform corresponding modification operation behavior information, for example, the deleting module 551 deletes the original operation behavior information, and adds the module 552. Re-add a new information about the operation time of the parameter that thinks about time, and so on. Further, after the modification module 550 performs the modification, the transmission module 560 may be re-executed to transmit the operation behavior information to the terminal device, and the receiving module 570 and the determining module 580 are executed to test whether the operation behavior information can be normally executed by the terminal device.
进一步,传输模块560还可以将执行记录模块530或修改模块550中删除模块551和/或添加模块552得到的已经记录的操作行为信息中的至少一项操作行为信息传输给终端设备。传输模块560在传输时将记录模块530或修改模块550记录的操作行为信息依次传输给终端设备,若判断模块580判断操作行为在终端设备正常执行后,传输模块560按照顺序将该操作行为信息的后一操作行为信息继续传输给终端设备,重复执行接收模块570和判断模块580,以测试记录的操作行为信息是否都能在终端设备正常执行。若判断模块580判断操作行为在终端设备不正常执行,根据返回的错误信息提示进行分析,执行修改模块550进行修改后,如删除了该操作行为。继续执行传输模块560及后续模块,进行测试。Further, the transmission module 560 may further transmit at least one of the operation behavior information of the recorded operation behavior information obtained by the deletion module 551 and/or the addition module 552 in the execution recording module 530 or the modification module 550 to the terminal device. The transmission module 560 sequentially transmits the operation behavior information recorded by the recording module 530 or the modification module 550 to the terminal device during transmission. If the determination module 580 determines that the operation behavior is performed normally after the terminal device is executed, the transmission module 560 sequentially performs the operation behavior information. The latter operation behavior information is continuously transmitted to the terminal device, and the receiving module 570 and the determining module 580 are repeatedly executed to test whether the recorded operation behavior information can be normally executed in the terminal device. If the judging module 580 judges that the operation behavior is not performed normally in the terminal device, the analysis is performed according to the returned error information, and after the modification module 550 performs the modification, the operation behavior is deleted. Continue to execute the transmission module 560 and subsequent modules for testing.
根据本公开提供的脚本生成装置,将至少一项操作行为信息传输给终端设备,以供终端设备根据操作行为信息,执行对应的操作行为。接收终端设备返回的对应的操作行为结果信息。根据操作行为结果信息,判断操作行为是否在终端设备正常执行。若操作行为在终端设备不正常执行,还可以根据返回的错误信息提示进行分析,修改操作行为信息。从而测试记录的操作行为信息是否合理,是否可以用于对终端设备UI界面进行测试。而且还可以整体的测试用户操作行为信息顺序设置的是否合理。同时,记录操作行为信息还可以根据实际情况进行修改调整,更加灵活,使得UI测试人员不需要再手动编写脚本文件。降低了对终端设备UI测试人员的技术要求,大大减轻了UI测试人员的工作量,节省了测试时花费的人力、时间,极大的提高了测试效率。According to the script generating apparatus provided by the present disclosure, at least one piece of operation behavior information is transmitted to the terminal device for the terminal device to perform a corresponding operation behavior according to the operation behavior information. Receiving corresponding operation behavior result information returned by the terminal device. According to the operation behavior result information, it is judged whether the operation behavior is performed normally in the terminal device. If the operation behavior is not performed normally in the terminal device, the analysis may be performed according to the returned error information, and the operation behavior information may be modified. Therefore, it is tested whether the recorded operation behavior information is reasonable, and whether it can be used for testing the terminal device UI interface. Moreover, it is also reasonable to test the user operation behavior information in an overall order. At the same time, the record operation behavior information can also be modified and adjusted according to the actual situation, which is more flexible, so that the UI tester does not need to manually write the script file. The technical requirements of the terminal device UI tester are reduced, the workload of the UI tester is greatly reduced, the manpower and time spent on the test are saved, and the test efficiency is greatly improved.
图7示意性地示出了用于执行根据本公开实施例的脚本生成方法的计算设备的框图。该计算设备传统上包括处理器710和以存储设备720形式的计算机程序产品或者计算机可读介质。存储设备720可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储设备720具有存储用于执行上述方法中的任何方法步骤的程序代码731的存储空间730。例如,存储程序代码的存储空间730可以包括分别用于实现上面的方法中的各种步骤的各个程序代码731。这些程序代码可以从一个 或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘、紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为例如图8所示的便携式或者固定存储单元。该存储单元可以具有与图7的计算设备中的存储设备720类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括用于执行根据本公开的方法步骤的计算机可读代码731',即可以由诸如710之类的处理器读取的代码,当这些代码由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。FIG. 7 schematically illustrates a block diagram of a computing device for executing a script generation method in accordance with an embodiment of the present disclosure. The computing device traditionally includes a processor 710 and a computer program product or computer readable medium in the form of a storage device 720. Storage device 720 can be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Storage device 720 has a storage space 730 that stores program code 731 for performing any of the method steps described above. For example, storage space 730 storing program code may include various program code 731 for implementing various steps in the above methods, respectively. The program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as a hard disk, a compact disk (CD), a memory card, or a floppy disk. Such a computer program product is typically a portable or fixed storage unit such as that shown in FIG. The storage unit may have storage segments, storage spaces, and the like that are similarly arranged to storage device 720 in the computing device of FIG. The program code can be compressed, for example, in an appropriate form. Generally, a storage unit includes computer readable code 731' for performing the steps of the method in accordance with the present disclosure, ie, code that can be read by a processor, such as 710, that when executed by a computing device causes the computing device Perform the various steps in the method described above.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本公开也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本公开的内容,并且上面对特定语言所做的描述是为了披露本公开的最佳实施方式。The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general purpose systems can also be used with the teaching based on the teachings herein. The structure required to construct such a system is apparent from the above description. Moreover, the present disclosure is not directed to any particular programming language. It is to be understood that the subject matter of the present disclosure, which is described herein, may be described in a particular language.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本公开的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the present disclosure may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of the description.
类似地,应当理解,为了精简本公开并帮助理解各个公开方面中的一个或多个,在上面对本公开的示例性实施例的描述中,本公开的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本公开要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,公开方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本公开的单独实施例。In the description of the exemplary embodiments of the present disclosure, the various features of the present disclosure are sometimes grouped together into a single embodiment, Figure, or a description of it. However, the method disclosed is not to be interpreted as reflecting the intention that the claimed invention requires more features than those recited in the claims. Rather, as disclosed in the following claims, the disclosed aspects are less than all features of the single embodiments disclosed herein. Therefore, the claims following the specific embodiments are hereby explicitly incorporated into the specific embodiments, and each of the claims as a separate embodiment of the present disclosure.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或 者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components. In addition to such features and/or at least some of the processes or units being mutually exclusive, any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined. Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本公开的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features that are included in other embodiments and not in other features, combinations of features of different embodiments are intended to be within the scope of the present disclosure. Different embodiments are formed and formed. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
本公开的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本公开实施例的脚本生成装置中的一些或者全部部件的一些或者全部功能。本公开还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本公开的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。Various component embodiments of the present disclosure may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of the script generating apparatus in accordance with embodiments of the present disclosure. The present disclosure may also be implemented as a device or device program (eg, a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the present disclosure may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本公开进行说明而不是对本公开进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本公开可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-described embodiments are illustrative of the present disclosure and are not intended to limit the scope of the disclosure, and those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not recited in the claims. The word "a" or "an" The present disclosure can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item. The use of the words first, second, and third does not indicate any order. These words can be interpreted as names.

Claims (18)

  1. 一种脚本生成方法,其包括:A script generation method includes:
    在浏览器上显示包括所述终端设备UI界面各个控件信息的图片;Displaying, on the browser, a picture including information about each control of the terminal device UI interface;
    依次捕捉用户在浏览器上操作所述图片的行为,获取相关的操作行为信息;Capturing the behavior of the user operating the picture on the browser in turn, and obtaining related operation behavior information;
    将所述操作行为信息按照用户在浏览器上操作的顺序进行记录;Recording the operation behavior information in the order in which the user operates on the browser;
    保存所述记录的操作行为信息,生成与所述操作行为信息对应的脚本文件。The recorded operation behavior information is saved, and a script file corresponding to the operation behavior information is generated.
  2. 根据权利要求1所述的方法,其中,所述依次捕捉用户在浏览器上操作所述图片的行为,获取相关的操作行为信息进一步包括:The method of claim 1, wherein the sequentially capturing the behavior of the user operating the picture on the browser, and obtaining the related operational behavior information further comprises:
    依次捕捉用户在浏览器上操作所述图片的行为,获取用户操作所述图片对应的终端设备UI界面的控件信息及用户对所述图片对应的终端设备UI界面的操作行为的信息。The action of the user to operate the picture on the browser is sequentially captured, and the information about the control of the terminal device UI interface corresponding to the picture and the operation behavior of the terminal device UI interface corresponding to the picture are obtained.
  3. 根据权利要求2所述的方法,其中,所述依次捕捉用户在浏览器上操作所述图片的行为,获取用户操作所述图片对应的终端设备UI界面的控件信息进一步包括:The method according to claim 2, wherein the sequentially capturing the behavior of the user operating the picture on the browser, and acquiring the control information of the terminal device UI interface corresponding to the picture by the user further comprises:
    依次捕捉用户在浏览器上操作所述图片的行为,根据作用在所述图片的位置进行计算,得到所述位置对应的终端设备UI界面的控件信息。The behavior of the user operating the picture on the browser is sequentially captured, and the control information of the terminal device UI interface corresponding to the location is obtained according to the position of the picture.
  4. 根据权利要求2所述的方法,其中,所述用户对所述图片对应的终端设备UI界面的操作行为包括:点击终端设备UI界面的控件、滑动终端设备UI界面、拖拽终端设备UI界面的控件、在终端设备UI界面输入文字和/或触碰终端设备UI界面操作键。The method according to claim 2, wherein the operation behavior of the terminal device UI interface corresponding to the picture by the user comprises: clicking a control of a terminal device UI interface, sliding a UI device of a terminal device, and dragging a UI interface of the terminal device Controls, inputting text on the terminal device UI interface and/or touching the terminal device UI interface operation keys.
  5. 根据权利要求1所述的方法,其中,在所述将所述操作行为信息按照用户在浏览器上操作的顺序进行记录之后,所述方法还包括:The method of claim 1, wherein after the recording of the operational behavior information in the order in which the user operates on the browser, the method further comprises:
    修改所述操作行为信息的记录。Modify the record of the operational behavior information.
  6. 根据权利要求5所述的方法,其中,所述修改所述操作行为信息进一 步包括:The method of claim 5 wherein said modifying said operational behavior information further comprises:
    删除其中至少一项所述操作行为信息。Delete at least one of the operational behavior information.
  7. 根据权利要求5所述的方法,其中,所述修改所述操作行为信息进一步包括:The method of claim 5, wherein the modifying the operational behavior information further comprises:
    从预设的操作行为信息中选择至少一项添加至所述操作行为信息中,并调整添加后的所述操作行为信息的顺序。Selecting at least one item from the preset operation behavior information is added to the operation behavior information, and adjusting the order of the added operation behavior information.
  8. 根据权利要求1-7任一项所述的方法,其中,所述方法还包括:The method of any of claims 1-7, wherein the method further comprises:
    将至少一项所述操作行为信息传输给终端设备,以供终端设备根据所述操作行为信息,执行对应的操作行为;Transmitting at least one of the operation behavior information to the terminal device, so that the terminal device performs a corresponding operation behavior according to the operation behavior information;
    接收所述终端设备返回的对应的操作行为结果信息;Receiving corresponding operation behavior result information returned by the terminal device;
    根据所述操作行为结果信息,判断所述操作行为是否在终端设备正常执行;若所述操作行为在终端设备正常执行,将所述操作行为对应的操作行为信息的记录进行正常标记;若所述操作行为在终端设备不正常执行,将所述操作行为对应的操作行为信息的记录进行错误标记,返回错误信息提示。Determining, according to the operation behavior result information, whether the operation behavior is performed normally in the terminal device; if the operation behavior is performed normally in the terminal device, the recording of the operation behavior information corresponding to the operation behavior is normally marked; The operation behavior is not performed normally in the terminal device, and the record of the operation behavior information corresponding to the operation behavior is erroneously marked, and an error message prompt is returned.
  9. 一种脚本生成装置,其包括:A script generating device includes:
    同步模块,用于在浏览器上显示包括所述终端设备UI界面各个控件信息的图片;a synchronization module, configured to display, on the browser, a picture that includes information about each control of the terminal device UI interface;
    捕捉模块,用于依次捕捉用户在浏览器上操作所述图片的行为,获取相关的操作行为信息;a capture module, configured to sequentially capture the behavior of the user operating the image on the browser, and obtain related operation behavior information;
    记录模块,用于将所述操作行为信息按照用户在浏览器上操作的顺序进行记录;a recording module, configured to record the operation behavior information according to an order in which the user operates on the browser;
    生成模块,用于保存所述记录的操作行为信息,生成与所述操作行为信息对应的脚本文件。And a generating module, configured to save the recorded operation behavior information, and generate a script file corresponding to the operation behavior information.
  10. 根据权利要求9所述的装置,其中,所述捕捉模块进一步用于:The apparatus of claim 9 wherein said capture module is further for:
    依次捕捉用户在浏览器上操作所述图片的行为,获取用户操作所述图片对应的终端设备UI界面的控件信息及用户对所述图片对应的终端设备UI界面的操作行为的信息。The action of the user to operate the picture on the browser is sequentially captured, and the information about the control of the terminal device UI interface corresponding to the picture and the operation behavior of the terminal device UI interface corresponding to the picture are obtained.
  11. 根据权利要求10所述的装置,其中,所述捕捉模块进一步用于:The apparatus of claim 10 wherein said capture module is further for:
    依次捕捉用户在浏览器上操作所述图片的行为,根据作用在所述图片的位置进行计算,得到所述位置对应的终端设备UI界面的控件信息。The behavior of the user operating the picture on the browser is sequentially captured, and the control information of the terminal device UI interface corresponding to the location is obtained according to the position of the picture.
  12. 根据权利要求10所述的装置,其中,所述用户对所述图片对应的终端设备UI界面的操作行为包括:点击终端设备UI界面的控件、滑动终端设备UI界面、拖拽终端设备UI界面的控件、在终端设备UI界面输入文字和/或触碰终端设备UI界面操作键。The device according to claim 10, wherein the operation behavior of the terminal device UI interface corresponding to the picture by the user comprises: clicking a control of a terminal device UI interface, sliding a UI device of a terminal device, and dragging a UI interface of the terminal device Controls, inputting text on the terminal device UI interface and/or touching the terminal device UI interface operation keys.
  13. 根据权利要求10所述的装置,其中,所述装置还包括:The device of claim 10, wherein the device further comprises:
    修改模块,用于修改所述操作行为信息的记录。A modification module is configured to modify the record of the operation behavior information.
  14. 根据权利要求13所述的装置,其中,所述修改模块进一步包括:The apparatus of claim 13 wherein said modifying module further comprises:
    删除模块,用于删除其中至少一项所述操作行为信息。And deleting a module, configured to delete at least one of the operation behavior information.
  15. 根据权利要求13所述的装置,其中,所述修改模块进一步包括:The apparatus of claim 13 wherein said modifying module further comprises:
    添加模块,用于从预设的操作行为信息中选择至少一项添加至所述操作行为信息中,并调整添加后的所述操作行为信息的顺序。And an adding module, configured to select at least one item from the preset operation behavior information to be added to the operation behavior information, and adjust an order of the added operation behavior information.
  16. 根据权利要求9-15任一项所述的装置,其中,所述装置还包括:The device of any of claims 9-15, wherein the device further comprises:
    传输模块,用于将至少一项所述操作行为信息传输给终端设备,以供终端设备根据所述操作行为信息,执行对应的操作行为;a transmission module, configured to transmit, by the terminal device, the operation behavior information to the terminal device, to perform, by the terminal device, the corresponding operation behavior according to the operation behavior information;
    接收模块,用于接收所述终端设备返回的对应的操作行为结果信息;a receiving module, configured to receive corresponding operation behavior result information returned by the terminal device;
    判断模块,用于根据所述操作行为结果信息,判断所述操作行为是否在终端设备正常执行;若所述操作行为在终端设备正常执行,将所述操作行为对应的操作行为信息的记录进行正常标记;若所述操作行为在终端设备不正常执行,将所述操作行为对应的操作行为信息的记录进行错误标记,返回错误信息提示。a determining module, configured to determine, according to the operation behavior result information, whether the operation behavior is performed normally in the terminal device; if the operation behavior is performed normally in the terminal device, the recording of the operation behavior information corresponding to the operation behavior is performed normally Marking; if the operation behavior is not performed normally in the terminal device, the record of the operation behavior information corresponding to the operation behavior is erroneously marked, and an error message prompt is returned.
  17. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-8中的任一项所述的脚本生成方法。A computer program comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to perform the script generation method of any one of claims 1-8.
  18. 一种计算机可读介质,其中存储了如权利要求17所述的计算机程序。A computer readable medium storing the computer program of claim 17.
PCT/CN2017/118906 2016-12-28 2017-12-27 Script generation method and device WO2018121582A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611236929.X 2016-12-28
CN201611236929.XA CN106708528A (en) 2016-12-28 2016-12-28 Script generating method and device

Publications (1)

Publication Number Publication Date
WO2018121582A1 true WO2018121582A1 (en) 2018-07-05

Family

ID=58903637

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/118906 WO2018121582A1 (en) 2016-12-28 2017-12-27 Script generation method and device

Country Status (2)

Country Link
CN (1) CN106708528A (en)
WO (1) WO2018121582A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783755A (en) * 2018-12-20 2019-05-21 平安科技(深圳)有限公司 Browser operation analogy method, device, readable storage medium storing program for executing and terminal device

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708528A (en) * 2016-12-28 2017-05-24 北京奇虎科技有限公司 Script generating method and device
CN107729223A (en) * 2017-08-31 2018-02-23 福建天晴数码有限公司 A kind of method and device of recording user operation on mobile terminals
CN112866312A (en) * 2019-11-27 2021-05-28 北京奇艺世纪科技有限公司 Script generation method, remote operation method and related equipment
CN113282502A (en) * 2021-06-04 2021-08-20 青岛海尔科技有限公司 Script generation method, device, storage medium and electronic device
CN113590092A (en) * 2021-07-15 2021-11-02 远光软件股份有限公司 Script generation method and device and computer readable storage medium
CN115982024A (en) * 2022-12-26 2023-04-18 中国人民财产保险股份有限公司 Test script generation method, device, storage medium and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006268666A (en) * 2005-03-25 2006-10-05 Fujitsu Ltd Automatic test system, automatic test method and program having correction function
CN101241466A (en) * 2007-02-08 2008-08-13 深圳迈瑞生物医疗电子股份有限公司 Embedded software test method and system
CN102419732A (en) * 2011-12-27 2012-04-18 Tcl集团股份有限公司 Android platform-based automatic test method and test tool
CN104951393A (en) * 2014-03-25 2015-09-30 中国电信股份有限公司 Testing method and device
CN105955881A (en) * 2016-04-22 2016-09-21 百度在线网络技术(北京)有限公司 Automated test step recording and playback method and apparatus
CN106708528A (en) * 2016-12-28 2017-05-24 北京奇虎科技有限公司 Script generating method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006268666A (en) * 2005-03-25 2006-10-05 Fujitsu Ltd Automatic test system, automatic test method and program having correction function
CN101241466A (en) * 2007-02-08 2008-08-13 深圳迈瑞生物医疗电子股份有限公司 Embedded software test method and system
CN102419732A (en) * 2011-12-27 2012-04-18 Tcl集团股份有限公司 Android platform-based automatic test method and test tool
CN104951393A (en) * 2014-03-25 2015-09-30 中国电信股份有限公司 Testing method and device
CN105955881A (en) * 2016-04-22 2016-09-21 百度在线网络技术(北京)有限公司 Automated test step recording and playback method and apparatus
CN106708528A (en) * 2016-12-28 2017-05-24 北京奇虎科技有限公司 Script generating method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783755A (en) * 2018-12-20 2019-05-21 平安科技(深圳)有限公司 Browser operation analogy method, device, readable storage medium storing program for executing and terminal device

Also Published As

Publication number Publication date
CN106708528A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
WO2018121582A1 (en) Script generation method and device
US10853232B2 (en) Adaptive system for mobile device testing
CN102904996B (en) The method and device of a kind of handset touch panel performance test, system
US9369823B2 (en) System and method for transferring software applications and data between two mobile devices with different operating systems
CN110147320A (en) Interface test method, device and electronic equipment
CN103518393A (en) Systems and methods for testing content of mobile communication devices
CN110879777A (en) Control testing method and device for application interface, computer equipment and storage medium
CN108874268B (en) User behavior data acquisition method and device
CN105512033B (en) A kind of automated testing method of mobile terminal, device and mobile terminal
CN106126424A (en) A kind of visual automated testing method of script, device and mobile terminal
CN105824755A (en) Automation test method, automation test device and mobile terminal
CN104915297B (en) A kind of automated testing method of the APP power consumption of android equipment
CN113138925A (en) Function test method and device of application program, computer equipment and storage medium
CN111414309A (en) Automatic test method of application program, computer equipment and storage medium
TWI476587B (en) Testing method and testing apparatus for testing function of electronic apparatus
CN115982024A (en) Test script generation method, device, storage medium and program product
CN104991857B (en) Trace debug method and device
CN113849415A (en) Control test method, device, storage medium and electronic equipment
US9749397B2 (en) Methods, systems, and computer-readable media for testing applications on a handheld device
US10169216B2 (en) Simulating sensors
CN111611162A (en) A test method, device, electronic device and storage medium
CN114004915B (en) Image editing method, device, equipment and storage medium
JP7202571B2 (en) Screen transition information generation device, screen transition information generation method, screen transition information generation program, screen transition information generation system
CN106407222B (en) picture processing method and equipment
JP2014092881A (en) Test system and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17885672

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17885672

Country of ref document: EP

Kind code of ref document: A1

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载