CN115617638A - Test script generation method and device, storage medium and equipment - Google Patents

Test script generation method and device, storage medium and equipment Download PDF

Info

Publication number
CN115617638A
CN115617638A CN202110730868.7A CN202110730868A CN115617638A CN 115617638 A CN115617638 A CN 115617638A CN 202110730868 A CN202110730868 A CN 202110730868A CN 115617638 A CN115617638 A CN 115617638A
Authority
CN
China
Prior art keywords
test script
page
determining
operating system
specified
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110730868.7A
Other languages
Chinese (zh)
Inventor
郝林巍
张毅然
王程远
刘楠
司丹华
单丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202110730868.7A priority Critical patent/CN115617638A/en
Publication of CN115617638A publication Critical patent/CN115617638A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Abstract

The method determines an operated object and an operation behavior in an original test script under a first operating system, and determines an object matched with the attribute of the operated object in a tested page corresponding to the original test script in a second operating system as a specified object according to the attribute of the operated object. And generating a target test script under a second operating system according to the determined specified object and the operation behavior. It can be seen from the above method that the method automatically converts the test script under one operating system into the test script under another operating system, so that the tester avoids the repeated script writing work, thereby saving time and resources.

Description

Test script generation method and device, storage medium and equipment
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method, an apparatus, a storage medium, and a device for generating a test script.
Background
With the development of internet technology, the client in the smart phone gradually becomes the mainstream internet access mode of the user. Before any client is brought online, the client needs to be tested in order to ensure that the client can be normally used by a user.
In the prior art, there are two mainstream smart phone operating systems: IOS operating system and android operating system. Before the client is on-line, the client can be ensured to be normally used in the two different mobile phone operating systems. However, because a test script written under one operating system cannot be directly run under another operating system, a tester needs to perform test work on clients respectively under the two different mobile phone operating systems, and specifically, the tester needs to write and run the test script for the client under the android operating system, and also needs to write and run the test script for the same client under the IOS operating system again.
In actual operation, the above-mentioned work of writing test scripts repeatedly performed at both ends wastes both time and resources.
Disclosure of Invention
The present specification provides a test script generation method and apparatus, so as to partially solve the above problems in the prior art.
The technical scheme adopted by the specification is as follows:
the present specification provides a test script generation method, including:
acquiring an original test script under a first operating system; determining a tested page corresponding to the original test script in a second operating system as an appointed page;
determining an operated object and an operation behavior in the original test script;
according to the attribute of the operated object, an object which is determined to be matched with the attribute of the operated object in the specified page is taken as a specified object;
and generating a target test script according to the specified object and the operation behavior, wherein the target test script is a test script under a second operating system.
Optionally, according to the attribute of the operated object, determining an object matching the attribute of the operated object in the specified page, as a specified object, specifically including:
determining the identification of the operated object; determining a tested page corresponding to the original test script in a first operating system as an original page;
determining the file of the operated object in the original page as a first file according to the identification of the operated object;
according to the first file, determining an object corresponding to the file matched with the first file in the specified page as an object to be identified;
when the object to be recognized is unique, the object to be recognized is taken as a specified object.
Optionally, but when the object to be identified is not unique, the method further comprises:
determining the attribute of the operated object except for the file as a standard attribute; determining the attributes of each object to be identified except the file as the attributes to be identified;
and determining the object to be identified corresponding to the attribute to be identified matched with the standard attribute as a specified object.
Optionally, according to the attribute of the operated object, determining an object matching the attribute of the operated object in the specified page, as a specified object, specifically including:
determining a tested page corresponding to the original test script in the first operating system as an original page;
determining an image corresponding to the operated object in the original page as a standard image;
and determining an object corresponding to the image with the highest similarity, which has the similarity not less than a specified threshold value with the standard image, in the specified page as a specified object.
Optionally, when there is no image in the designated page whose similarity with the standard image is not less than a designated threshold, the method further includes:
converting the standard image into a character corresponding to the standard image;
and taking the character as a specified object.
Optionally, after generating the target test script, the method further includes:
determining an object corresponding to the image with the highest similarity of the converted images in the specified page as an operated object in the target test script;
and operating the operated object in the target test script according to the operation behavior.
Optionally, before determining, in the designated page, that the similarity with the standard image is not less than a designated threshold and an object corresponding to an image with the highest similarity is used as a designated object, the method further includes:
determining the identification of the operated object; determining a test page corresponding to the original test script in a first operating system as an original page;
determining the file of the operated object in the original page as a first file according to the identifier of the operated object;
and according to the first file, determining that no object corresponding to the file matched with the first file exists in the specified page.
The present specification provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described test script generation method.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the test script generation method when executing the program.
The technical scheme adopted by the specification can achieve the following beneficial effects:
in the test script generation method provided by this specification, an operated object and an operation behavior are determined in an original test script under a first operating system, and an object matching with the attribute of the operated object is determined as a designated object in a tested page corresponding to the original test script in a second operating system according to the attribute of the operated object. And generating a target test script under a second operating system according to the determined specified object and the operation behavior.
It can be seen from the above method that the method automatically converts the test script under one operating system into the test script under another operating system, so that the tester avoids the repeated script writing work, thereby saving time and resources. Meanwhile, the original code of the tested client cannot be changed when the test script is generated, namely the method is non-intrusive.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the principles of the specification and not to limit the specification in a limiting sense. In the drawings:
FIG. 1 is a flow chart of a test script generation method in the present specification;
FIG. 2 is a schematic diagram of an original page and a designated page in the present specification;
FIG. 3 is a schematic diagram of a test script generating apparatus provided in the present specification;
fig. 4 is a schematic diagram of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a test script generation method in this specification, which specifically includes the following steps:
s100: acquiring an original test script under a first operating system; and determining the tested page corresponding to the original test script in a second operating system as a designated page.
In the prior art, a tester can test a client to be on-line, and because hardware and software supporting the operation of each operating system are different, a test script written under one operating system cannot be directly used under another operating system, so that the tester needs to write and operate the test script for each operating system, but the work of repeatedly writing the test script wastes time and resources, and even the time for the client to be on-line can be delayed.
The method can automatically convert a test script written under one operating system into a test script directly executed under another operating system, wherein an execution main body of the method can be a client or a server, the description is not limited, the operating system can be a mobile phone operating system or a computer operating system, the description is not limited, and only the operating system is taken as a mobile phone operating system for example for description.
Specifically, after a server writes a test script under one operating system, in order to obtain a test script under another operating system, the test script under the first operating system may be obtained first as an original test script, and meanwhile, a tested page corresponding to the original test script in the second operating system is determined as an assigned page.
S102: and determining the operated object and the operation behavior in the original test script.
The server has obtained the original test script under the first operating system and the designated page under the second operating system in step S100, and the operated object and the operation behavior are two elements in a complete test script, so in order to be able to accurately and automatically convert the original test script into a test script under another operation, the server may first determine the operated object and the operation behavior executed for the operated object in the original test script.
It is noted that the target test script is obtained by automatically converting the original test script, but the original test script is obtained in advance by a recording operation of a tester. Specifically, the tester may first determine the operated object and the operation behavior executed for the operated object under the first operating system, and then, according to the operated object and the operation behavior, the tester may use a non-code recording and playback tool under the first operating system to obtain the test script as the original test script.
For example, the first operating system is an android operating system, the second operating system is an IOS operating system, the test content is to determine whether the key 1 of the calculator can be clicked normally, so the key 1 is an operated object, and the operation behavior is clicking. A recording tool is used under an android operating system, a test script obtained by clicking a key 1 in a calculator is an original test script, and a calculator page of an IOS operating system is a designated page.
S104: and according to the attribute of the operated object, determining an object matched with the attribute of the operated object in the specified page as a specified object.
As can be seen from the above description, two elements in the test script are the object to be tested and the operation behavior, and in order to ensure the consistency of the content of the test under each operating system, it is necessary to ensure that the object to be tested and the operation behavior included in the test script under each operating system are consistent. Therefore, the operated object under the second operating system matched with the operated object under the first operating system is determined, and the same operation behavior as that in the original test script, that is, the operation behavior determined in step S102, is combined, so that the server can automatically generate the target test script under the second operating system.
Specifically, the server may find, according to the attribute of the operated object, for example, the attribute such as the coordinate, the type, and the like, an object corresponding to the attribute matching the attribute of the operated object in the specified page as the specified object, that is, the operated object in the test script under the second operating system.
According to the attribute of the operated object, the following method can be adopted for determining the specified object in the specified page:
the server can determine a tested page corresponding to the original test script under the first operating system as an original page, and determine the identification of the operated object, and then the server can determine the file of the operated object in the original page according to the identification of the operated object as a first file. The identifier of the operated object can be understood as an id (identity document) of the operated object in the original test script, and the file of the operated object can be understood as a name of the operated object displayed in the original page.
The server can determine an object corresponding to the file matched with the first file in the designated page as a designated object according to the first file.
Specifically, the server may find an object corresponding to a name matching the name of the operated object in the designated page as the object to be identified according to the name of the operated object in the original page.
When the object to be recognized determined by the server is unique, taking the object to be recognized as a specified object; when the to-be-identified object determined by the server is not unique, that is, the number of the to-be-identified objects is multiple, the server needs to screen out the unique to-be-identified object matched with the operated object from the multiple to-be-identified objects, specifically, the server can determine the attributes of the operated object except for the file, such as other attributes such as coordinates and types, as standard attributes; similarly, for each object to be identified, determining attributes of the object to be identified except for the pattern, such as coordinates, types and other attributes, as the attributes to be identified; and determining the object to be recognized corresponding to the attribute to be recognized matched with the standard attribute as a specified object in the plurality of objects to be recognized.
In addition, when the object to be recognized determined by the server is unique, the server may also determine other attributes of the operated object and the object to be recognized except for the file, and respectively serve as the standard attribute and the attribute to be recognized, and determine the object to be recognized as the designated object required by the server again by matching the standard attribute and the attribute to be recognized.
The server may obtain the total attribute of the operated object from the android operating system, but only a part of the attributes of the operated object may be obtained under the IOS operating system, so when the object to be identified is not unique, the server may match the standard attribute with the attribute of the same kind as that in the attribute to be identified, for example, the standard attribute includes coordinates and types, and the attribute to be identified only includes coordinates, so the server may determine the object to be identified corresponding to the coordinates matching the coordinates of the operated object in the designated page as the designated object.
As shown in fig. 2, following the above example, the server may determine that a test page corresponding to an original test script under the android operating system is a calculator page, the identifier of the operated object key 1 is 001, determine that the case of the key 1 is 1 in the calculator page under the android operating system according to the identifier 001 of the key 1, and use the case as a first case, and the server may find an object corresponding to the case matched with the first case according to the calculator page under the IOS operation of the first case 1, that is, the object corresponding to the case 1 in the calculator page in the IOS operating system is the key 1 in the calculator page of the IOS operating system, and use the object as an object to be recognized.
Thereafter, the server may determine that the operated object: coordinate information of a key 1 in an android operating system is matched with coordinate information of an object to be identified, and coordinate information of the key 1 under an IOS operating system, namely coordinate information of the key 1 in the IOS operating system, so that the object to be identified: key 1 under the IOS operating system is the designated object.
In addition, when the server cannot obtain the document attribute in the second operating system, text Recognition may be performed on the designated page, for example, the document in the designated page is obtained through OCR (Optical Character Recognition), and at the same time, the coordinates of each document in the designated page may also be determined. The server can adopt the method, in each case obtained through OCR recognition, an object corresponding to the case matched with the first case is determined to serve as a designated object, when a plurality of cases are matched with the first case, the server can match the coordinates in the standard attribute of the operated object with the coordinates of each case, and finally, an object corresponding to the unique case is obtained through screening from the plurality of cases and serves as the designated object.
When the document matching the first document does not exist in the designated page, the server may convert the operated object into an image in the original page, and determine an object corresponding to the image matching the operated object in the designated page as the designated object based on the converted image.
Specifically, the server may determine, in an original page, an image corresponding to an operated object as a standard image, and then determine, in a designated page, an object corresponding to an image whose similarity to the standard image is not less than a designated threshold.
It should be noted that the standard image is an image corresponding to a screenshot of the image corresponding to the operated object in the original page, for example, if the operated object is a determination button, the standard image is an image corresponding to the screenshot corresponding to the determination button in the original page.
After the designated object is determined, the server can determine other attributes of the designated object besides the file, such as coordinates, types and other attributes, and the server can match the other attributes of the designated object with the other attributes of the operated object again to ensure the accuracy of the designated object determined by the server on the designated page.
In order to increase the speed and accuracy of searching for the designated object, the server may first specify the coordinates of the object to be operated, narrow the search range based on the coordinate information of the object to be operated, and specify, as the designated object, an object corresponding to an image whose standard image has a similarity greater than a designated threshold and a highest similarity on a designated page in the narrowed range.
When the image with the similarity not smaller than the specified threshold value with the standard image does not exist in the specified page, the server can convert the standard image into the corresponding character, and the converted character is used as the specified object. For example, a base64 value of the standard image is determined and set as a specified object.
Following the above example, the server may: the method comprises the steps that a key 1 under an android operating system is converted into an image corresponding to a screenshot of the key 1 in an original page, the image is used as a standard image, a server searches an image which is larger than a specified threshold in similarity with the standard image and has the maximum similarity with the standard image in a calculator page in the IOS operating system through an image recognition method, namely the image of the key 1 in the calculator in the IOS operating system, and an object corresponding to the image of the key 1, namely the key 1 under the IOS operating system is determined and used as a specified object.
It should be noted that the server may also directly use the above method of using the image of the operated object in the original page to determine the specified object in the specified page, that is, the method of determining the specified object by using the file and the method of determining the specified object by using the image are in a parallel relationship, and the server may arbitrarily select one of the two methods to determine the specified object.
S106: and generating a target test script according to the specified object and the operation behavior, wherein the target test script is a test script under the second operating system.
In step S104, the server determines the designated object, i.e. the operated object under the second operating system, and the server may automatically generate the target test script according to the determined designated object and the operation behavior.
After the target test script is obtained, the server may run the obtained target test script under the second operating system to ensure that the obtained target test script may be used normally.
It should be noted that, when the designated object in the target test script under the second operating system is a character, and the target test script is executed under the second operating system, the server may convert the character into an image corresponding to the character, find an image corresponding to an image with the highest similarity to the converted image in the designated page as the operated object in the target test script, and then the server may operate to determine the operated object in the obtained target test script according to the operation behavior.
When the obtained target test script cannot be normally executed under the second operating system, the server can determine that the original test script is automatically converted into the target test script at this time and fails.
Based on the same idea, the test script generating method provided in one or more embodiments of the present specification further provides a corresponding test script generating apparatus, as shown in fig. 3.
Fig. 3 is a schematic diagram of a test script generating device provided in this specification, which specifically includes:
a confirmation module 301, a matching module 302, and a script generation module 303, wherein:
a confirmation module 301, configured to obtain an original test script under a first operating system; determining a tested page corresponding to the original test script in a second operating system as an appointed page; determining an operated object and an operation behavior in the original test script;
a matching module 302, configured to determine, according to the attribute of the operated object, an object that matches the attribute of the operated object in the designated page as a designated object;
and a script generating module 303, configured to generate a target test script according to the specified object and the operation behavior, where the target test script is a test script under the second operating system.
Optionally, the matching module 302 is specifically configured to determine an identifier of the operated object; determining a tested page corresponding to the original test script in a first operating system as an original page; determining the file of the operated object in the original page as a first file according to the identifier of the operated object; according to the first file, determining an object corresponding to the file matched with the first file in the specified page as an object to be identified; when the object to be recognized is unique, the object to be recognized is taken as a specified object.
Optionally, the matching module 302 is further configured to determine an attribute of the operated object, other than the file, as a standard attribute; determining the attributes of each object to be identified except the file as the attributes to be identified; and determining the object to be identified corresponding to the attribute to be identified matched with the standard attribute as a specified object.
Optionally, the matching module 302 is specifically configured to determine, in the first operating system, a tested page corresponding to the original test script as an original page; determining an image corresponding to the operated object in the original page as a standard image; and determining an object corresponding to the image with the highest similarity, which has the similarity not less than a specified threshold value with the standard image, in the specified page as a specified object.
Optionally, the matching module 302 is further configured to convert the standard image into a character corresponding to the standard image; and taking the character as a specified object.
Optionally, the script generating module 303 is further configured to convert the character as the specified object into an image when the target test script is executed in the second operating system; determining an object corresponding to the image with the highest similarity of the converted images in the specified page as an operated object in the target test script; and operating the operated object in the target test script according to the operation behavior.
Optionally, the matching module 302 is further configured to determine an identifier of the operated object; determining a tested page corresponding to the original test script in a first operating system as an original page; determining the file of the operated object in the original page as a first file according to the identifier of the operated object; and according to the first file, determining that no object corresponding to the file matched with the first file exists in the specified page.
The present specification also provides a computer-readable storage medium storing a computer program, which can be used to execute the test script generating method provided in fig. 1.
This specification also provides a schematic block diagram of the electronic device shown in fig. 4. As shown in fig. 4, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required for other services. The processor reads a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to implement the test script generating method described in fig. 1. Of course, besides the software implementation, this specification does not exclude other implementations, such as logic devices or combination of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is an integrated circuit whose Logic functions are determined by a user programming the Device. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as ABEL (Advanced Boolean Expression Language), AHDL (alternate Hardware Description Language), traffic, CUPL (core universal Programming Language), HDCal, jhddl (Java Hardware Description Language), lava, lola, HDL, PALASM, rhyd (Hardware Description Language), and vhigh-Language (Hardware Description Language), which is currently used in most popular applications. It will also be apparent to those skilled in the art that hardware circuitry for implementing the logical method flows can be readily obtained by a mere need to program the method flows with some of the hardware description languages described above and into an integrated circuit.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium that stores computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in purely computer readable program code means, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be regarded as a hardware component and the means for performing the various functions included therein may also be regarded as structures within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus comprising the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (10)

1. A test script generation method, comprising:
acquiring an original test script under a first operating system; determining a tested page corresponding to the original test script in a second operating system as an appointed page;
determining an operated object and an operation behavior in the original test script;
according to the attribute of the operated object, determining an object matched with the attribute of the operated object in the specified page as a specified object;
and generating a target test script according to the specified object and the operation behavior, wherein the target test script is a test script under the second operating system.
2. The method according to claim 1, wherein determining, as the designated object, an object in the designated page that matches the attribute of the operated object according to the attribute of the operated object specifically includes:
determining the identification of the operated object; determining a tested page corresponding to the original test script in a first operating system as an original page;
determining the file of the operated object in the original page as a first file according to the identifier of the operated object;
according to the first file, determining an object corresponding to the file matched with the first file in the designated page as an object to be identified;
when the object to be recognized is unique, the object to be recognized is taken as a specified object.
3. The method of claim 2, wherein when the object to be identified is not unique, the method further comprises:
determining the attribute of the operated object except for the file as a standard attribute; determining the attributes of each object to be identified except the file as the attributes to be identified;
and determining the object to be identified corresponding to the attribute to be identified matched with the standard attribute as a specified object.
4. The method according to claim 1, wherein determining, as the designated object, an object in the designated page that matches the attribute of the operated object according to the attribute of the operated object specifically includes:
determining a tested page corresponding to the original test script in the first operating system as an original page;
determining an image corresponding to the operated object in the original page as a standard image;
and determining an object corresponding to the image with the highest similarity, which has the similarity not less than a specified threshold value with the standard image, in the specified page as a specified object.
5. The method of claim 4, wherein when there is no image in the specified page that has a similarity to the standard image that is not less than a specified threshold, the method further comprises:
converting the standard image into a character corresponding to the standard image;
and taking the character as a specified object.
6. The method of claim 5, wherein after generating the target test script, the method further comprises:
converting characters as the designated objects into images when the target test script is executed in the second operating system;
determining an object corresponding to the image with the highest similarity of the converted images in the designated page as an operated object in the target test script;
and operating the operated object in the target test script according to the operation behavior.
7. The method according to claim 4, wherein before determining, in the specified page, that the similarity with the standard image is not less than a specified threshold and the object corresponding to the image with the highest similarity is the specified object, the method further comprises:
determining the identification of the operated object; determining a tested page corresponding to the original test script in a first operating system as an original page;
determining the file of the operated object in the original page as a first file according to the identifier of the operated object;
and according to the first file, determining that no object corresponding to the file matched with the first file exists in the specified page.
8. A test script generating apparatus, comprising:
the confirming module is used for acquiring an original test script under the first operating system; determining a tested page corresponding to the original test script in a second operating system as an appointed page; determining an operated object and an operation behavior in the original test script;
the matching module is used for determining an object matched with the attribute of the operated object in the specified page as a specified object according to the attribute of the operated object;
and the script generation module is used for generating a target test script according to the specified object and the operation behavior, wherein the target test script is a test script under the second operating system.
9. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when being executed by a processor, carries out the method of any one of the preceding claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 7 when executing the program.
CN202110730868.7A 2021-06-30 2021-06-30 Test script generation method and device, storage medium and equipment Pending CN115617638A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110730868.7A CN115617638A (en) 2021-06-30 2021-06-30 Test script generation method and device, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110730868.7A CN115617638A (en) 2021-06-30 2021-06-30 Test script generation method and device, storage medium and equipment

Publications (1)

Publication Number Publication Date
CN115617638A true CN115617638A (en) 2023-01-17

Family

ID=84856123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110730868.7A Pending CN115617638A (en) 2021-06-30 2021-06-30 Test script generation method and device, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN115617638A (en)

Similar Documents

Publication Publication Date Title
CN109189682B (en) Script recording method and device
CN107274442B (en) Image identification method and device
CN107644286B (en) Workflow processing method and device
CN107066519B (en) Task detection method and device
CN108268289B (en) Parameter configuration method, device and system for web application
CN107479868B (en) Interface loading method, device and equipment
CN112347512A (en) Image processing method, device, equipment and storage medium
CN113079201B (en) Information processing system, method, device and equipment
CN115774552A (en) Configurated algorithm design method and device, electronic equipment and readable storage medium
CN111782328A (en) Application processing method and device
CN111694992A (en) Data processing method and device
CN113408254A (en) Page form information filling method, device, equipment and readable medium
CN111538667A (en) Page testing method and device
CN111209277A (en) Data processing method, device, equipment and medium
CN115221523A (en) Data processing method, device and equipment
CN110704742B (en) Feature extraction method and device
CN112307371B (en) Applet sub-service identification method, device, equipment and storage medium
CN115617638A (en) Test script generation method and device, storage medium and equipment
CN110968513B (en) Recording method and device of test script
CN112559346A (en) Service testing method and device
CN110874322A (en) Test method and test server for application program
CN115017915B (en) Model training and task execution method and device
CN109324966B (en) Test script generation and execution method and device
CN112711539A (en) Data processing method and device and data detection system
CN116431465A (en) Interface matching method and device, storage medium and electronic equipment

Legal Events

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