CN113656304A - Method and device for testing front-end application program and storage medium - Google Patents

Method and device for testing front-end application program and storage medium Download PDF

Info

Publication number
CN113656304A
CN113656304A CN202110936697.3A CN202110936697A CN113656304A CN 113656304 A CN113656304 A CN 113656304A CN 202110936697 A CN202110936697 A CN 202110936697A CN 113656304 A CN113656304 A CN 113656304A
Authority
CN
China
Prior art keywords
api
target
tool
application program
test case
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.)
Granted
Application number
CN202110936697.3A
Other languages
Chinese (zh)
Other versions
CN113656304B (en
Inventor
汤亮
雷鹏
马瑞宁
韦虹宇
邵文舒峤
范磊
卢韶强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Pudong Development Bank Co Ltd
Original Assignee
Shanghai Pudong Development Bank 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 Shanghai Pudong Development Bank Co Ltd filed Critical Shanghai Pudong Development Bank Co Ltd
Priority to CN202110936697.3A priority Critical patent/CN113656304B/en
Publication of CN113656304A publication Critical patent/CN113656304A/en
Application granted granted Critical
Publication of CN113656304B publication Critical patent/CN113656304B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3696Methods or tools to render software testable
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method and a device for testing a front-end application program and a storage medium. The method comprises the following steps: calling a target page operation API corresponding to a target test case when a test starting instruction of the target test case corresponding to an application program to be tested is received; and automatically testing the application program to be tested by adopting the target page operation API. According to the embodiment of the invention, the basic API is packaged for the second time to obtain the corresponding target page operation API; when a test starting instruction for the target test case is received, the target page operation API corresponding to the target test case is scheduled, and the target page operation API is adopted to automatically test the application program to be tested, so that test codes are reduced, the test efficiency is improved, and meanwhile, standardized management is facilitated.

Description

Method and device for testing front-end application program and storage medium
Technical Field
The embodiment of the invention relates to the field of computers, in particular to a method, equipment and a storage medium for testing a front-end application program.
Background
Currently, automated testing tools for Web applications include the tools of Selenium, RoboFramework, and the like. Among them, the Selenium tool is characterized by being comprehensive: the method supports operating systems such as Windows, Linux and Mac, browsers such as Firefox, Safari, Chrome, Opera, Edge and IE, and various programming languages such as Python, Java and Ruby; the RobotFramework tool is characterized by keywords: the automatic test case compiling driven by the keywords is carried out by using built-in keywords, library keywords led in a test library and user-defined keywords.
The Selenium tool provides a large number of basic Application Programming Interfaces (APIs) for the tester to call, so that the tester can quickly write the automated test case code in a simple front-end page. However, in a complex front-end framework, for a single step, a tester needs to repeatedly call a plurality of basic APIs, and a large amount of redundant codes are formed after a plurality of steps, so that the whole test case is difficult to read, maintain and standardize; meanwhile, the basic API requires a tester to pay attention to a specific path of each front-end element, so that an automated test aiming at reducing a test burden becomes a burden on the tester. Moreover, the Selenium tool can only operate on front-end pages, but the whole process of automated testing not only includes page operations, but also includes functions of data preparation, process assertion, test report generation and the like, which cannot be realized by the Selenium tool. The RobotFramework tool uses keywords as a core programming mode, has a higher threshold for testers, and is not beneficial to quick use of Java testers.
Disclosure of Invention
In view of this, the present invention provides a method, a device and a storage medium for testing a front-end application, which reduce test codes, improve test efficiency and facilitate standardized management.
In a first aspect, an embodiment of the present invention provides a method for testing a front-end application program, including:
when a test starting instruction of a target test case corresponding to an application program to be tested is received,
calling a target page corresponding to the target test case to operate an Application Program Interface (API);
and automatically testing the application program to be tested by adopting the target page operation API.
In a second aspect, an embodiment of the present invention further provides a device for testing a front-end application, including:
the system comprises a calling module, a test starting module and a test starting module, wherein the calling module is used for calling a target page operation application program interface API corresponding to a target test case when a test starting instruction of the target test case corresponding to an application program to be tested is received;
and the testing module is used for automatically testing the application program to be tested by adopting the target page operation API.
In a third aspect, an embodiment of the present invention further provides a device for testing a front-end application, where the device includes: a memory, and one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method for testing a front-end application program as in any of the embodiments described above.
In a fourth aspect, a computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements a method for testing a front-end application as in any of the above embodiments.
According to the embodiment of the invention, the basic API is packaged for the second time to obtain the corresponding target page operation API; when a test starting instruction of a target test case corresponding to the application program to be tested is received, a target page operation API corresponding to the target test case is scheduled, so that the target page operation API is adopted to automatically test the application program to be tested, thereby reducing test codes, improving test efficiency and facilitating standardized management.
Drawings
Fig. 1 is a flowchart of a method for testing a front-end application according to an embodiment of the present invention;
FIG. 2 is a flow chart of another method for testing a front-end application according to an embodiment of the present invention;
FIG. 3 is an architecture diagram of a target page operations API provided by an embodiment of the present invention;
fig. 4 is a block diagram of a testing apparatus for front-end applications according to an embodiment of the present invention;
fig. 5 is a schematic hardware structure diagram of a device for testing a front-end application according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
In an embodiment, fig. 1 is a flowchart of a method for testing a front-end application according to an embodiment of the present invention, which is applicable to a case where an encapsulated target page operation API is used to perform an automated test on an application to be tested. This embodiment may be performed by a test device of a front-end application. The testing device of the front-end application program can be a computer device. As shown in fig. 1, the present embodiment includes the following steps:
s110, when a test starting instruction of a target test case corresponding to the application program to be tested is received, calling a target page corresponding to the target test case as an API.
The application program to be tested refers to a Web application program which needs to be tested, and can also be understood as a test on all operation pages on a Web interface. Illustratively, the application to be tested may include one of: menu bar selection, button click, drop-down box selection, single-check box selection, form value reading, input box entry, scroll bar operation, text box entry, date box entry, drop-down box selection option. It should be noted that after the writing of the test code corresponding to the application program to be tested is completed and before the Web interface corresponding to the application program to be tested is on line, the running condition of the application program to be tested is tested, so as to avoid the occurrence of an abnormality in the running process of the Web interface. In the embodiment, each application program to be tested corresponds to one target test case, that is, only one application program to be tested can be tested when one target test case is started. Of course, a plurality of application programs to be tested may correspond to one target test case, which is not limited to this and is related to the writing of test codes in the target test case.
In an embodiment, before the target test case is run, whether a test framework corresponding to the target test case is started is determined, where one case is: when the test frame is not started, the target test case informs the corresponding test frame of starting, and the target case is operated after the test frame is started; in another case, the target test case is directly started when the test framework is in a running state. It can be understood that the page operation API is adapted for different types of front-end technologies, that is, in the process of writing the test case, a relationship between the front-end technology of the target system and the target page operation API is determined, that is, according to the front-end technology, the target page operation API corresponding to the front-end technology is called in the target test case. Illustratively, the front-end technology may be Unieap, Vue, easy UI, or the like
In one embodiment, the target page operation API includes one of: a menu bar selection API; clicking an API by a button; drop-down box selection API; single check checkbox select API; a table value reading API; an input box inputs an API; a scroll bar operation API; a textbox input API; a date box input API; the drop-down box selects the options API. The target page operation API is configured and named according to the realized function or the executed operation. Illustratively, the button-click API refers to an interface that tests the click operation of a button on a Web page. It should be noted that the target page operation API is obtained by performing secondary encapsulation by using a basic API in the corresponding test framework. In the embodiment, each application program to be tested corresponds to one target test case, and each target test case corresponds to one target page operation API.
And S120, automatically testing the application program to be tested by adopting the target page operation API.
In the embodiment, after the target page operation API corresponding to the application program to be tested is determined, the test code in the target page operation API is used for carrying out automatic test on the application program to be tested.
According to the technical scheme of the embodiment, the corresponding target page operation API is obtained by carrying out secondary packaging on the basic API; when a test starting instruction of a target test case corresponding to the application program to be tested is received, a target page operation API corresponding to the target test case is scheduled, so that the application program to be tested is automatically tested by adopting the target page operation API, thereby reducing test codes, improving test efficiency and facilitating standardized management.
In an embodiment, fig. 2 is a flowchart of another front-end application testing method provided in the embodiment of the present invention. This embodiment is further described with respect to a method for testing a front-end application on the basis of the above embodiment. As shown in fig. 2, the method for testing a front-end application program in this embodiment includes:
s210, determining a target keyword in the application program to be tested.
The target keyword can be used to characterize the function that can be realized or the operation that can be executed by the application program to be tested. It is understood that the functions that can be realized or the operations that can be executed by each application program to be tested are summarized as corresponding target keywords.
S220, starting a corresponding target test case in the RobotFramework tool according to the target keyword.
Wherein, S220 includes: S2201-S2202:
s2201, determining the class name and the method name of the target test case according to the target keyword.
In an embodiment, in the RobotFramework tool, the class name and the method name of the corresponding target test case may be determined by using the target keyword. It can be understood that the class name and the method name of the corresponding target test case are named by using the target keyword.
S2202, calling the class name and the method name of the target test case in the RobotFramework tool to start the corresponding target test case.
In the embodiment, the class name and the method name of the target test case are searched and called in a RobotFramework tool so as to directly start the target test case in the Java engineering.
And S230, calling a target page operation API corresponding to the target test case.
And S240, automatically testing the application program to be tested by adopting the target page operation API.
And S250, performing packaging operation on the target test case to obtain a corresponding target Jar package.
In the embodiment, the target page operation API is automatically tested on the test platform, and after the to-be-tested application program corresponding to the target page operation API is determined to normally run, the packaging operation can be executed on the target test case to obtain the corresponding target Jar package.
S260, configuring the server address and the port of the running environment of each remote server through a RobotFramework tool.
The remote server may refer to a business server, i.e., a business system to which the target test case is applied. In an embodiment, server addresses and ports of environments where different remote servers run are configured in a local robotframe tool to realize communication with the remote servers, and different target test cases can be specified in the robotframe tool to run on different remote servers.
S270, the target Jar packet is sent to a remote server according to the server address and the port, so that the target Jar packet is subjected to automatic testing in the remote server.
In the embodiment, the target Jar packet is sent to the remote server through SSH, and is deployed in the remote server, so that the rapid packaging and deployment function is realized, and the target Jar packet is subjected to automatic testing in the remote server.
Of course, a plurality of target Jar packages may also be sent to the remote server, so that the target test case corresponding to each target Jar package is concurrently executed in different remote servers.
In an embodiment, the method for testing a front-end application further includes: and when a starting instruction of the target tool API is received, executing a corresponding function by adopting the target tool API. Wherein the tool API comprises one of: a data preparation tool API; a test report generation tool API; a screenshot tool API; a picture assertion tool API; uploading a file downloading tool API; a pop-up box authentication tool API; switching a browser tool API; the page execution step prompts the tool API. In the embodiment, in the whole life cycle of the target test case automatic test corresponding to the application program to be tested, the operation corresponding to the matched target tool API can be called, so that the automatic operation is realized, and the complicated operation of a tester is reduced.
In one embodiment, fig. 3 is an architecture diagram of a target page operation API provided by an embodiment of the present invention. In this embodiment, the test framework is a Unieap framework, an Vue framework, and an easy ui framework, and the Java language is used as a core to provide a front-end page operation API (i.e., the target page operation API in the above embodiment).
As shown in FIG. 3, the architecture diagram of the front-end page operations API includes the following:
aiming at the characteristics that the Unieap framework is developed based on an IE browser and the Vue and easy UI frameworks are developed based on a Chrome browser, secondary packaging is respectively carried out on the basic APIs of an internet Exolorer driver and a Chrome driver. Meanwhile, the API is used as a front end page operation exposed to the outside through the Explorer operator.
In an embodiment, the front-end page operations APIs include, but are not limited to: a menu bar selection API, a button click API, a drop-down box selection API, a single check box selection API, a form value reading API, an input box input API, a scroll bar operation API, a text box input API, a date box input API, and a drop-down box selection option API. In the process of writing the test case by the tester, the front-end technology used by the front-end page is not required to be considered, the specific path of the operated element is not required to be concerned, and the corresponding related operation can be completed only by calling the target page operation API provided in the embodiment, so that the test codes can be reduced, the test efficiency is improved, and the standardized management is facilitated.
Throughout the life cycle of automated testing of an application under test, matching tool APIs are provided, including but not limited to: a data preparation tool API; a test report generation tool API; a screenshot tool API; a picture assertion tool API; uploading a file downloading tool API; a pop-up box authentication tool API; switching a browser tool API; the page execution step prompts the tool API. When some basic data are used in part of target test cases (namely front-end test cases), data can be quickly inserted into the database through a data preparation tool API (application programming interface) so as to reduce the workload of data preparation; in the automatic test of part of target test cases, a test report can be provided, and a test report generation tool API can add data to a test report template file according to the requirement so as to automatically generate the test report; in the automatic test process of part of target test cases, when a screenshot needs to be provided for a test report, the screenshot function can be automatically executed on the test report through a screenshot tool API; in the automatic test process of the target test case, when the automatic test result needs to be predicated, the screenshots of multiple automatic tests can be compared through a picture predication tool API so as to predicate the automatic test result; when part of target test cases relate to the file uploading and downloading functions of Windows which are irrelevant to the front-end technology, an uploading and downloading file tool API can be adopted to operate the part of interfaces; when part of target test cases relate to the account login function which is irrelevant to the front-end technology and is carried by Windows, an API (application program interface) for uploading and downloading files can be adopted to operate the part of interfaces; when part of target test cases relate to operating a plurality of browsers simultaneously, adopting a browser switching tool API for switching among the plurality of browsers; in the automatic test process of the target test case, a page execution step prompting tool API can be adopted to display the current automatic test steps on a front-end page. It can be understood that in the whole life cycle of the automated testing of the target test case, the comprehensive support is improved, namely, corresponding target tool APIs are provided from data preparation, process assertion, test report generation and the like. In the process of writing the test case, the tester only needs to call the provided target tool API, and the required automatic operation can be completed.
In the RobotFramework tool, a target keyword is designed, so that the server address and the port of a Java engineering starting environment are determined on one hand, and the class name and the method name of a target test case are determined on the other hand. In the embodiment, the target test case in the Java engineering is directly started in the RobotFramework tool through the target keyword. It can be understood that the target test case in the Java engineering can be directly managed in the RobotFramework tool. Moreover, the tester only needs to know how to use the target keyword and call the class and the method of the target test case. Meanwhile, when the target test case is driven in a memorability mode, the unit test tools such as Junit and TestNG are directly used for driving, and the execution is directly used in an Integrated Development Environment (IDE) of Java. The IDE refers to a test platform of a running environment where a target test case is located. In the embodiment, the RobotFramework tool is used as a use case organization tool, but not a use case writing tool, and the test cases in the Java engineering are called through the RF tool by using a self-defined communication method. The tester only needs to know the grammar of class and method in Java engineering called by RF tool; if a special use case organization manager is provided in the tester, other testers may not need to know the RF tool at all. Meanwhile, the present embodiment also provides a method such as Junit to call the test case.
In addition, since the RF and Java engineering adopt a customized communication mode, the present embodiment is not limited to the robotframe as an external driving tool, and also supports adapting other external interface testing tools by adapting a communication protocol.
In the embodiment, the target test case can be packaged into the target Jar through Maven or Ant, the target Jar packet is sent to the remote server through SSH, and the target Jar packet is deployed on the remote server, so that the rapid packaging and deployment function is realized. Server addresses and ports of environments where different remote servers are located are configured in a local RobotFramework tool, and different target test cases can be specified to run on different remote servers in an RF tool through communication with the remote servers, and the target test cases can also be executed on different remote servers concurrently. The automated testing framework provided in this embodiment may be packaged into a target Jar package by Maven, and the target Jar package is directly sent and deployed to a remote execution machine (i.e., the remote server in the above embodiment) through SSH. The method comprises the steps of organizing test cases locally through a RobotFramework tool, and performing concurrent execution of the test cases on a plurality of remote execution machines through communication with the remote execution machines. It is to be understood that the selection of the remote execution engine is done in the RF tool, and the tester does not need to consider the selection of the remote execution engine in the process of writing the test case.
It should be noted that the automated testing framework in this embodiment may support not only the RobotFramework tool to organize the test cases, but also support scheduling of other test case organizing tools by adapting the communication protocol.
In an embodiment, fig. 4 is a block diagram of a structure of a testing apparatus for a front-end application according to an embodiment of the present invention, where the testing apparatus is suitable for performing an automated test on an application to be tested by using a packaged target page operation API, and the testing apparatus may be implemented by hardware/software. As shown in fig. 4, the apparatus includes: a calling module 410 and a testing module 420.
The calling module 410 is configured to, when receiving a test start instruction of a target test case corresponding to an application program to be tested, call a target page operation application program interface API corresponding to the target test case;
and the test module 420 is configured to perform an automated test on the application to be tested by using the target page operation API.
According to the technical scheme of the embodiment, the corresponding target page operation API is obtained by carrying out secondary packaging on the basic API; when a test starting instruction of a target test case corresponding to the application program to be tested is received, a target page operation API corresponding to the target test case is scheduled, so that the application program to be tested is automatically tested by adopting the target page operation API, thereby reducing test codes, improving test efficiency and facilitating standardized management.
In an embodiment, the apparatus for testing a front-end application further includes:
the determining module is used for determining a target keyword in the application program to be tested before receiving a test starting instruction of a target test case corresponding to the application program to be tested;
and the starting module is used for starting the corresponding target test case in the RobotFramework tool according to the target keyword.
In an embodiment, the apparatus for testing a front-end application further includes:
the packaging module is used for executing packaging operation on the target test case to obtain a corresponding target Jar package;
and the sending module is used for sending the target Jar package to the remote server so as to enable the target Jar package to carry out automatic testing in the remote server.
In one embodiment, the start module includes:
the determining unit is used for determining the class name and the method name of the target test case according to the target keyword;
and the calling starting unit is used for calling the class name and the method name of the target test case in the RobotFramework tool so as to start the corresponding target test case.
In an embodiment, the apparatus for testing a front-end application further includes:
and the configuration module is used for configuring the server address and the port of the running environment of each remote server through a RobotFramework tool before the target Jar packet is sent to the remote server.
In an embodiment, the apparatus for testing a front-end application further includes:
and the execution module is used for executing the corresponding function by adopting the target tool API when receiving the starting instruction of the target tool API.
In one embodiment, the tool API includes one of: a data preparation tool API; a test report generation tool API; a screenshot tool API; a picture assertion tool API; uploading a file downloading tool API; a pop-up box authentication tool API; switching a browser tool API; the page execution step prompts the tool API.
In one embodiment, the target page operation API includes one of: a menu bar selection API; clicking an API by a button; drop-down box selection API; single check checkbox select API; a table value reading API; an input box inputs an API; a scroll bar operation API; a textbox input API; a date box input API; the drop-down box selects the options API.
The testing device of the front-end application program can execute the testing method of the front-end application program provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the testing method of the front-end application program.
Fig. 5 is a schematic hardware structure diagram of a device for testing a front-end application according to an embodiment of the present invention. The testing device of the front-end application program in the embodiment of the invention is described by taking a computer as an example. As shown in fig. 5, the testing apparatus for front-end application provided in the embodiment of the present invention includes: a processor 510, a memory 520, an input device 530, and an output device 540. The processor 510 in the computer may be one or more, one processor 510 is taken as an example in fig. 5, the processor 510, the memory 520, the input device 530 and the output device 540 in the computer may be connected by a bus or in other ways, and the connection by the bus is taken as an example in fig. 5.
The memory 520 in the computer is used as a computer-readable storage medium for storing one or more programs, which may be software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the testing method of the front-end application program (for example, the modules in the testing device of the front-end application program shown in fig. 4, including the calling module 410 and the testing module 420) according to the embodiment of the present invention or provided. The processor 510 executes various functional applications and data processing of the computer by executing software programs, instructions and modules stored in the memory 520, namely, implements the testing method of the front-end application program in the above method embodiments.
The memory 520 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the device, and the like. Further, the memory 520 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 520 may further include memory located remotely from processor 510, which may be connected to devices through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 530 may be used to receive numeric or character information input by a user to generate key signal inputs related to user settings and function control of the terminal device. The output device 540 may include a display device such as a display screen.
And, when one or more programs included in the testing device of the aforementioned front-end application program are executed by the one or more processors 510, the programs perform the following operations: when a test starting instruction of a target test case corresponding to an application program to be tested is received, calling a target page corresponding to the target test case to operate an Application Program Interface (API); and automatically testing the application program to be tested by adopting the target page operation API.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for testing a front-end application program provided in an embodiment of the present invention, and the method includes: when a test starting instruction of a target test case corresponding to an application program to be tested is received, calling a target page corresponding to the target test case to operate an Application Program Interface (API); and automatically testing the application program to be tested by adopting the target page operation API.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM or flash Memory), an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for testing a front-end application program is characterized by comprising the following steps:
when a test starting instruction of a target test case corresponding to an application program to be tested is received,
calling a target page corresponding to the target test case to operate an Application Program Interface (API);
and automatically testing the application program to be tested by adopting the target page operation API.
2. The method according to claim 1, before the receiving a test start instruction of a target test case corresponding to an application program to be tested, further comprising:
determining a target keyword in an application program to be tested;
and starting a corresponding target test case in a RobotFramework tool according to the target keyword.
3. The method of claim 1, further comprising:
performing packaging operation on the target test case to obtain a corresponding target Jar package;
and sending the target Jar package to a remote server so that the target Jar package is subjected to automatic testing in the remote server.
4. The method of claim 2, wherein the launching of the corresponding target test case in a RobotFramework tool according to the target keyword comprises:
determining the class name and the method name of the target test case according to the target keyword;
and calling the class name and the method name of the target test case in a RobotFramework tool to start the corresponding target test case.
5. The method according to claim 3, prior to said sending said target Jar package to a remote server, further comprising:
and configuring the server address and the port of the environment in which each remote server runs through a RobotFramework tool.
6. The method of claim 1, further comprising:
and when a starting instruction of the target tool API is received, executing a corresponding function by adopting the target tool API.
7. The method of claim 6, wherein the tool API comprises one of: a data preparation tool API; a test report generation tool API; a screenshot tool API; a picture assertion tool API; uploading a file downloading tool API; a pop-up box authentication tool API; switching a browser tool API; the page execution step prompts the tool API.
8. The method of any of claims 1-6, wherein the target page operations API comprises one of: a menu bar selection API; clicking an API by a button; drop-down box selection API; single check checkbox select API; a table value reading API; an input box inputs an API; a scroll bar operation API; a textbox input API; a date box input API; the drop-down box selects the options API.
9. An apparatus for testing a front-end application, the apparatus comprising: a memory, and one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method of testing a front-end application program as recited in any of claims 1-8.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for testing a front-end application according to any one of claims 1 to 8.
CN202110936697.3A 2021-08-16 2021-08-16 Testing method, device and storage medium of front-end application program Active CN113656304B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110936697.3A CN113656304B (en) 2021-08-16 2021-08-16 Testing method, device and storage medium of front-end application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110936697.3A CN113656304B (en) 2021-08-16 2021-08-16 Testing method, device and storage medium of front-end application program

Publications (2)

Publication Number Publication Date
CN113656304A true CN113656304A (en) 2021-11-16
CN113656304B CN113656304B (en) 2024-04-30

Family

ID=78479207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110936697.3A Active CN113656304B (en) 2021-08-16 2021-08-16 Testing method, device and storage medium of front-end application program

Country Status (1)

Country Link
CN (1) CN113656304B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116049020A (en) * 2023-04-03 2023-05-02 深圳市明源云科技有限公司 Automatic test method, device and equipment for software products and readable storage medium
CN116795723A (en) * 2023-08-21 2023-09-22 建信金融科技有限责任公司 Chain unit test processing method and device and computer equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096631A (en) * 2009-12-11 2011-06-15 华为技术有限公司 Interface testing method and device
US20130042222A1 (en) * 2011-08-08 2013-02-14 Computer Associates Think, Inc. Automating functionality test cases
US20140245070A1 (en) * 2013-02-27 2014-08-28 International Business Machines Corporation Automated execution of functional test scripts on a remote system within a unit testing framework
CN106126411A (en) * 2016-06-13 2016-11-16 广州酷狗计算机科技有限公司 A kind of method and apparatus that tested program code is tested
CN108845940A (en) * 2018-06-14 2018-11-20 云南电网有限责任公司信息中心 A kind of enterprise information system automated function test method and system
CN110941546A (en) * 2019-10-12 2020-03-31 平安健康保险股份有限公司 Automatic test method, device, equipment and storage medium for WEB page case
CN111367802A (en) * 2020-02-29 2020-07-03 中国平安财产保险股份有限公司 Web automatic testing method and device and computer readable storage medium
CN111382084A (en) * 2020-05-08 2020-07-07 北京金山云网络技术有限公司 Test method and device and electronic equipment
CN112241373A (en) * 2020-10-30 2021-01-19 久瓴(江苏)数字智能科技有限公司 Automatic test method, test device, processor and test system
CN112783756A (en) * 2019-11-11 2021-05-11 深圳Tcl数字技术有限公司 Automatic test method, terminal, system and storage medium
WO2021135809A1 (en) * 2019-12-30 2021-07-08 北京金山云网络技术有限公司 Testing method, device, terminal apparatus, and storage medium
CN113127352A (en) * 2021-04-20 2021-07-16 成都新潮传媒集团有限公司 Automatic case statistical method and device and computer readable storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102096631A (en) * 2009-12-11 2011-06-15 华为技术有限公司 Interface testing method and device
US20130042222A1 (en) * 2011-08-08 2013-02-14 Computer Associates Think, Inc. Automating functionality test cases
US20140245070A1 (en) * 2013-02-27 2014-08-28 International Business Machines Corporation Automated execution of functional test scripts on a remote system within a unit testing framework
CN106126411A (en) * 2016-06-13 2016-11-16 广州酷狗计算机科技有限公司 A kind of method and apparatus that tested program code is tested
CN108845940A (en) * 2018-06-14 2018-11-20 云南电网有限责任公司信息中心 A kind of enterprise information system automated function test method and system
CN110941546A (en) * 2019-10-12 2020-03-31 平安健康保险股份有限公司 Automatic test method, device, equipment and storage medium for WEB page case
CN112783756A (en) * 2019-11-11 2021-05-11 深圳Tcl数字技术有限公司 Automatic test method, terminal, system and storage medium
WO2021135809A1 (en) * 2019-12-30 2021-07-08 北京金山云网络技术有限公司 Testing method, device, terminal apparatus, and storage medium
CN111367802A (en) * 2020-02-29 2020-07-03 中国平安财产保险股份有限公司 Web automatic testing method and device and computer readable storage medium
CN111382084A (en) * 2020-05-08 2020-07-07 北京金山云网络技术有限公司 Test method and device and electronic equipment
CN112241373A (en) * 2020-10-30 2021-01-19 久瓴(江苏)数字智能科技有限公司 Automatic test method, test device, processor and test system
CN113127352A (en) * 2021-04-20 2021-07-16 成都新潮传媒集团有限公司 Automatic case statistical method and device and computer readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116049020A (en) * 2023-04-03 2023-05-02 深圳市明源云科技有限公司 Automatic test method, device and equipment for software products and readable storage medium
CN116049020B (en) * 2023-04-03 2023-08-04 深圳市明源云科技有限公司 Automatic test method, device and equipment for software products and readable storage medium
CN116795723A (en) * 2023-08-21 2023-09-22 建信金融科技有限责任公司 Chain unit test processing method and device and computer equipment
CN116795723B (en) * 2023-08-21 2023-11-21 建信金融科技有限责任公司 Chain unit test processing method and device and computer equipment

Also Published As

Publication number Publication date
CN113656304B (en) 2024-04-30

Similar Documents

Publication Publication Date Title
US10372600B2 (en) Systems and methods for automated web performance testing for cloud apps in use-case scenarios
CN111026645B (en) User interface automatic test method and device, storage medium and electronic equipment
CN101930400B (en) SDK (Software Development Kit) automatic test system and method
US8276123B1 (en) Adaptive regression test selection within testing environments
CN111538659B (en) Interface testing method, system, electronic equipment and storage medium of business scene
CN111124919A (en) User interface testing method, device, equipment and storage medium
CN113656304B (en) Testing method, device and storage medium of front-end application program
WO2019109553A1 (en) Functional and performance test script creation method, device, apparatus and storage medium
US20130067439A1 (en) Injecting faults into program for testing
CN112154420A (en) Automatic intelligent cloud service testing tool
CN107368420A (en) API method of testings, device and electronic equipment
CN108628739A (en) A kind of method that Lua scripts are debugged, client, server and debugger
CN113760763A (en) Software testing method, device, server and system
CN114064503A (en) UI automation test method and device, electronic equipment and storage medium
CN112199284A (en) Program automation testing method and corresponding device, equipment and medium
US20070245313A1 (en) Failure tagging
CN111290968A (en) Method, device, equipment and storage medium for realizing automatic test
CN117931219A (en) Front-end project implementation method and device, electronic equipment and storage medium
CN114328250A (en) Automatic self-checking method, medium and device for software system
CN116627850B (en) Function debugging method and device, storage medium and electronic equipment
CN113138937A (en) Test method and device
CN113127329B (en) Script debugging method and device and computer storage medium
CN117591368A (en) Automatic monitoring plug-in for server performance and working method thereof
CN112269739A (en) Webpage testing method and device, equipment and medium thereof
CN116166907A (en) Method and device for developing Web application by using WebAsssembly and service page compiling technology

Legal Events

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