CN116662193A - Page testing method and device - Google Patents

Page testing method and device Download PDF

Info

Publication number
CN116662193A
CN116662193A CN202310684712.9A CN202310684712A CN116662193A CN 116662193 A CN116662193 A CN 116662193A CN 202310684712 A CN202310684712 A CN 202310684712A CN 116662193 A CN116662193 A CN 116662193A
Authority
CN
China
Prior art keywords
test
interface
target page
page
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310684712.9A
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.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding 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 Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202310684712.9A priority Critical patent/CN116662193A/en
Publication of CN116662193A publication Critical patent/CN116662193A/en
Pending legal-status Critical Current

Links

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/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/3692Test management for test results analysis

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 embodiment of the disclosure provides a page testing method and device. The page testing method comprises the following steps: firstly, responding to a test request corresponding to a target page, displaying an editing interface of an automatic test script, responding to test data input in the editing interface, generating the automatic test script corresponding to the target page, then acquiring a first interface parameter corresponding to the target page based on a reverse proxy mode and the automatic test script, and finally carrying out interface test on the target page based on the first interface parameter.

Description

Page testing method and device
Technical Field
Embodiments of the present disclosure relate to the field of computer technology and the field of internet technology, and in particular, to a page testing method and apparatus.
Background
With the continuous rapid development of the Internet, the method has the advantages of quick iteration, multiple demands, tight online work period and no complete interface document for many projects, which clearly brings great challenges for test classmates. In the traditional web end test, the method mainly comprises two aspects of web interface test and page test.
Existing technologies such as interface test platform and front-end web page test platform are all tested separately. For web interface testing such as postman, etc., a large number of requests, parameters, etc., for each interface need to be entered manually. If the interface file is missing, the browser is used for capturing packets to copy and paste the information such as the interface request, the parameters and the like used one by one and then import the information into the tool platform such as postman and the like, so that time and labor are wasted; while for page testing, automated testing is often accomplished by manual verification, or by writing java, python scripts, etc. Therefore, the tester needs to perform the interface test by performing the complex input program, and then performs the page test, and the test task is heavy.
Disclosure of Invention
Embodiments of the present disclosure provide a page testing method, apparatus, electronic device, and computer readable medium.
In a first aspect, embodiments of the present disclosure provide a page testing method, including: responding to the received test request corresponding to the target page, and displaying an editing interface of the automatic test script; responding to the received test data input in the editing interface, and generating an automatic test script corresponding to the target page; acquiring a first interface parameter corresponding to a target page based on a reverse proxy mode and an automatic test script; and performing interface test on the target page based on the first interface parameters.
In some embodiments, performing an interface test on the target page based on the first interface parameter includes: based on the first interface parameters, acquiring interface test tasks corresponding to the first interface parameters; generating an interface test case corresponding to the target page based on the interface test task corresponding to the first interface parameter; and carrying out interface test on the target page based on the interface test case corresponding to the target page.
In some embodiments, based on the interface test case corresponding to the target page, performing the interface test on the target page includes: leading the first interface parameters into an interface test platform; and performing interface test on the target page by using the interface test platform and the interface test case.
In some embodiments, the method further comprises: obtaining a test mode corresponding to a target webpage; responding to the determination that the test mode is a first preset mode, and acquiring an interface test result of the target page; based on the automatic test script and the first interface parameter, performing page test on the target page to obtain a page test result of the target page; and generating a test result of the target page based on the interface test result and the page test result.
In some embodiments, the method further comprises: responding to the determination that the test mode is a second preset mode, and acquiring historical interface parameters corresponding to the target page; comparing the first interface parameter with the historical interface parameter to generate interface comparison information; obtaining an interface test result of the target page; based on the automatic test script and the first interface parameter, performing page test on the target page to obtain a page test result of the target page; and generating a test result of the target page based on the interface test result and the page test result.
In some embodiments, the method further comprises: based on the automatic test script, monitoring a test process corresponding to the target page; judging whether the testing process of the target page is abnormal or not based on the testing data of the target page; and generating first prompt information for prompting the test abnormality of the target page in response to the determination that the test process of the target page is abnormal.
In some embodiments, the method further comprises: and generating second prompt information for prompting the target page to test normally in response to the fact that the test process of the target page is determined to be normal.
In a second aspect, embodiments of the present disclosure provide a page testing apparatus, the apparatus comprising: the display module is configured to display an editing interface of the automatic test script in response to receiving a test request corresponding to the target page; the generation module is configured to respond to the received test data input in the editing interface and generate an automatic test script corresponding to the target page; the acquisition module is configured to acquire a first interface parameter corresponding to the target page based on a reverse proxy mode and an automatic test script; and the testing module is configured to perform interface testing on the target page based on the first interface parameters.
In some embodiments, a test module includes: the acquisition unit is configured to acquire an interface test task corresponding to the first interface parameter based on the first interface parameter; the generating unit is configured to generate an interface test case corresponding to the target page based on the interface test task corresponding to the first interface parameter; and the testing unit is configured to perform interface testing on the target page based on the interface testing case corresponding to the target page.
In some embodiments, the test unit is further configured to: leading the first interface parameters into an interface test platform; and performing interface test on the target page by using the interface test platform and the interface test case.
In some embodiments, the acquisition module is further configured to: obtaining a test mode corresponding to a target webpage; responding to the determination that the test mode is a first preset mode, and acquiring an interface test result of the target page; based on the automatic test script and the first interface parameter, performing page test on the target page to obtain a page test result of the target page; and a generation module further configured to: and generating a test result of the target page based on the interface test result and the page test result.
In some embodiments, the acquisition module is further configured to: responding to the determination that the test mode is a second preset mode, and acquiring historical interface parameters corresponding to the target page; a generation module further configured to: comparing the first interface parameter with the historical interface parameter to generate interface comparison information; and an acquisition module further configured to: obtaining a test mode corresponding to a target webpage; responding to the determination that the test mode is a first preset mode, and acquiring an interface test result of the target page; based on the automatic test script and the first interface parameter, performing page test on the target page to obtain a page test result of the target page; and a generation module further configured to: and generating a test result of the target page based on the interface test result and the page test result.
In some embodiments, the apparatus further comprises: the monitoring module and the judging module; a monitoring module configured to: based on the automatic test script, monitoring a test process corresponding to the target page; a judgment module configured to: judging whether the testing process of the target page is abnormal or not based on the testing data of the target page; a generation module further configured to: and generating first prompt information for prompting the test abnormality of the target page in response to the determination that the test process of the target page is abnormal.
In some embodiments, the generation module is further configured to: and generating second prompt information for prompting the target page to test normally in response to the fact that the test process of the target page is determined to be normal.
In a third aspect, embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the page testing method as described in any of the embodiments of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a page testing method as described in any of the embodiments of the first aspect.
According to the page test method provided by the embodiment of the disclosure, the execution main body firstly responds to the received test request corresponding to the target page, displays the editing interface of the automatic test script, responds to the received test data input in the editing interface, generates the automatic test script corresponding to the target page, then obtains the first interface parameter corresponding to the target page based on the reverse proxy mode and the automatic test script, and finally performs the interface test on the target page based on the first interface parameter.
Drawings
Other features, objects and advantages of the present disclosure will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings:
FIG. 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;
FIG. 2 is a flow chart of one embodiment of a page testing method according to the present disclosure;
FIG. 3 is a flow chart of one embodiment of interface testing a target page according to the present disclosure;
FIG. 4 is a flow chart of another embodiment of a page testing method according to the present disclosure;
FIG. 5 is a schematic diagram of the structure of one embodiment of a page testing apparatus according to the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the related disclosure and not limiting thereof. It should be further noted that, for convenience of description, only the portions related to the disclosure are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present disclosure and features of the embodiments may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
FIG. 1 illustrates an exemplary system architecture 100 in which embodiments of a page testing method or page testing apparatus of the present application may be applied.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. The terminal devices 101, 102, 103 may be user terminal devices on which various client applications, such as e-commerce platform applications, image class applications, video class applications, search class applications, financial class applications, etc., may be installed.
The terminal devices 101, 102, 103 may be a variety of electronic devices having a display screen and supporting receipt of server messages, including but not limited to smartphones, tablets, electronic book readers, electronic players, laptop and desktop computers, and the like.
The terminal devices 101, 102, 103 may be hardware or software. When the terminal apparatuses 101, 102, 103 are hardware, various electronic apparatuses are possible, and when the terminal apparatuses 101, 102, 103 are software, they are installed in the above-listed electronic apparatuses. Which may be implemented as multiple software or software modules (e.g., multiple software modules for providing distributed services), or as a single software or software module. The present application is not particularly limited herein.
The terminal device 101, 102, 103 may receive a test request corresponding to the target page, display an editing interface of the automated test script, and then the terminal device 101, 102, 103 may receive test data input by a tester at the editing interface, where the test data may be data associated with the test request of the target page, and generate the automated test script corresponding to the target page based on the test data. The terminal devices 101, 102, 103 may then obtain the first interface parameter corresponding to the target page based on the reverse proxy mode and the automated test script, and finally perform the interface test on the target page based on the first interface parameter.
The server 105 may be a server providing various services, such as a background server receiving a request transmitted from a terminal device with which a communication connection is established. The background server can receive and analyze the request sent by the terminal equipment and generate a processing result.
The server may be hardware or software. When the server is hardware, it may be various electronic devices that provide various services to the terminal device. When the server is software, a plurality of software or software modules providing various services to the terminal device may be realized, or a single software or software module providing various services to the terminal device may be realized. The present invention is not particularly limited herein.
It should be noted that, the page testing method provided by the embodiments of the present disclosure may be performed by the terminal devices 101, 102, 103, and accordingly, the page testing apparatus may be disposed in the terminal devices 101, 102, 103.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring to FIG. 2, a flow chart 200 of one embodiment of a page testing method according to the present disclosure is shown. The page testing method comprises the following steps:
and 210, responding to the received test request corresponding to the target page, and displaying an editing interface of the automatic test script.
In this step, the execution subject (e.g., terminal devices 101, 102, 103 in fig. 1) on which the page test method is run may present a test interface to a tester through a screen, and a worker may input a test request corresponding to a target page in the test interface, the test request being for interface test and page test requests for the target page.
After receiving the test request corresponding to the target page, the executing body may display an editing interface of the automated test script to the tester through a screen, where the editing interface may include an input control of test data, where the input control is used to receive test data related to the test request of the target page, where the test data may include data related to a task to be tested of the target page, and may include a screenshot, a keyword, and the like related to the target page.
And 220, responding to the received test data input in the editing interface, and generating an automatic test script corresponding to the target page.
In this step, the executing body may use a conventional selenium grammar or an automation test script editor based on opencv image recognition algorithm and the like to package, after receiving test data input by a tester in an editing interface, process the test data by using the packaged automation test script editor, and automatically generate an automation test script corresponding to a target page in modes of page screenshot, keywords, function dragging, recording and the like, where the automation test script may be used as a script for performing an automation test on the target page to implement interface test and page test on the target page.
Step 230, based on the reverse proxy mode and the automated test script, acquiring a first interface parameter corresponding to the target page.
In this step, after the execution subject generates the automation test script corresponding to the target page, the browser may be evoked to run the automation test script by playing back the automation test script. Then before the browser initiates an interface request to the server based on the automated test script, the execution subject may utilize a reverse proxy mode, that is, an API Gateway system, and may intercept the interface request initiated by the browser to the server by using technologies such as mintproxy. And then the executing body acquires interface information corresponding to the interface request according to the acquired interface request, wherein the interface information can comprise url (uniform resource locator ), parameter entering, parameter exiting, request head and other key information, and determines the interface information as a first interface parameter corresponding to the target page, and the first interface parameter is the interface information of the target page for sending a request to the server side and acquiring corresponding data in the testing process.
Step 240, performing interface test on the target page based on the first interface parameter.
In this step, after the executing body obtains the first interface parameter corresponding to the target page, the executing body may locally perform data encapsulation on the first interface parameter based on the automated test script corresponding to the target page, so as to obtain a test task corresponding to the first interface parameter. And then the execution main body can carry out interface test on the target page locally according to the test task corresponding to the first interface parameter.
According to the page test method provided by the embodiment of the disclosure, the execution main body firstly responds to the received test request corresponding to the target page, displays the editing interface of the automatic test script, responds to the received test data input in the editing interface, generates the automatic test script corresponding to the target page, then obtains the first interface parameter corresponding to the target page based on the reverse proxy mode and the automatic test script, and finally performs the interface test on the target page based on the first interface parameter.
Referring to fig. 3, fig. 3 shows a flowchart 300 of one embodiment of performing interface testing on a target page, that is, step 240 described above, based on first interface parameters, the performing interface testing on the target page may include the steps of:
step 310, based on the first interface parameter, obtaining an interface test task corresponding to the first interface parameter.
In this step, the executing body may acquire the first interface parameter, where the first interface parameter may include interface parameters of a plurality of different interfaces, and different interfaces may correspond to different interface test tasks, and then may further acquire the interface test task corresponding to the different interfaces according to the first interface parameter, where the interface test task may include interface parameterization and so on.
Step 320, based on the interface test task corresponding to the first interface parameter, generating an interface test case corresponding to the target page.
In this step, after the executing body obtains the interface test task corresponding to the first interface parameter, the executing body may edit the attribute information of the test case such as the case number, the case name, the parameter value, the expected value, the timeout assertion, etc. according to the interface test task, so as to generate an interface test case corresponding to the target page, where the interface test case may be used to perform the interface test on the target page.
And 330, performing interface test on the target page based on the interface test case corresponding to the target page.
In this step, after the execution body generates the interface test case corresponding to the target page, the interface test may be performed on the target page by locally using the interface test case, that is, the interface test program may be written and obtained locally, and the interface test program is used to perform execution processing on the interface test case, so as to implement the interface test on the target page.
As an optional implementation manner, the step 330, based on the interface test case corresponding to the target page, of performing the interface test on the target page may include the following steps: leading the first interface parameters into an interface test platform; and performing interface test on the target page by using the interface test platform and the interface test case.
Specifically, after the execution body generates the interface test case corresponding to the target page, the obtained first interface parameter may be imported into an interface test platform, where the interface test platform may include tools such as httpouner (interface automation test tool), python code, and the like. And then the execution main body can execute the interface test case by using the interface test platform, and call the first interface parameter to carry out the interface test on the target page.
In the implementation mode, the interface test is carried out on the target page by utilizing the interface test platform, so that the automatic test of the interface can be realized, the parameters are directly imported into the interface test platform, the direct multiplexing of the interface parameters is facilitated, and the efficiency of the interface test is improved.
In the implementation manner, the interface test cases corresponding to the target pages are generated based on the first interface parameters, and the interface test is performed on the target pages by utilizing the interface test cases corresponding to the target pages, so that after the first interface parameters are acquired, batch testing of the interfaces can be realized, the interface test is more accurate, and the interface test efficiency can be improved.
Referring to fig. 4, fig. 4 shows a flow chart 400 of another embodiment of a page test method, which may include the steps of:
step 410, in response to receiving the test request corresponding to the target page, displaying an editing interface of the automated test script.
In this step, step 410 is the same as step 210 in the embodiment shown in fig. 2, and is not described here.
And step 420, generating an automatic test script corresponding to the target page in response to receiving the test data input in the editing interface.
In this step, step 420 is the same as step 220 in the embodiment shown in fig. 2, and is not repeated here.
Step 430, acquiring a first interface parameter corresponding to the target page based on the reverse proxy mode and the automated test script.
In this step, step 430 is the same as step 230 in the embodiment shown in fig. 2, and is not repeated here.
Step 440, performing interface test on the target page based on the first interface parameter.
In this step, step 440 is the same as step 240 in the embodiment shown in fig. 2, and is not described here.
Step 450, obtaining a test mode corresponding to the target webpage.
In this step, the executing body may read the automation test script, determine a state of a recording interface switch preset in the automation test script, and obtain a test mode corresponding to the target webpage according to the state of the recording interface switch. If the switch of the recording interface is in a closed state, the test mode corresponding to the target webpage is a first preset mode; if the switch of the recording interface is in an on state, the test mode corresponding to the target webpage is a second preset mode.
Step 460, in response to determining that the test mode is the first preset mode, obtaining an interface test result of the target page.
In this step, the executing body determines that the switch of the recording interface is in the off state through judgment, and determines that the test mode is a first preset mode, where the first preset mode may be a working mode that only performs interface test and page test without recording interface information in the test process. And then the execution body can acquire an interface test result of the target page according to the interface test, wherein the interface test result can comprise the number of success and failure, a response state, response time and the like.
And 470, performing page test on the target page based on the automatic test script and the first interface parameter, and obtaining a page test result of the target page.
In this step, the executing body may determine a page test task according to the generated automation test script and the first interface parameter, so that the executing body may perform a page test on the target page according to the page test task, and obtain a page test result of the target page, where the page test result may include a specified element test result, a page screenshot, and the like.
Step 480, generating a test result of the target page based on the interface test result and the page test result.
In this step, after the execution body obtains the interface test result and the page test result, the test result of the target page may be generated according to the interface test result and the page test result.
In this embodiment, by determining that the test mode is the first preset mode, the interface test and the page test are performed on the target page, and the page test and the interface test of the target page are combined to complete a one-stop test scheme from the page to the interface, so that the test efficiency is improved, and the project quality is ensured.
With continued reference to fig. 4, the page test method may further include the steps of:
step 490, in response to determining that the test mode is the second preset mode, obtaining the historical interface parameters corresponding to the target page.
In this step, the executing body determines that the switch of the recording interface is in an on state through judgment, and determines that the test mode is a second preset mode, where the second preset mode may be a working mode in which interface information in a test process needs to be recorded, and interface test and page test are performed at the same time. And then the execution main body acquires the first interface parameters in the process of carrying out interface test on the target page, and reads the locally stored historical interface parameters corresponding to the target page.
In step 4100, the first interface parameter is compared with the historical interface parameter to generate interface comparison information.
In this step, the executing body may compare the first interface parameter with the historical interface parameter, determine whether the interface corresponding to the target page changes, and generate interface comparison information.
Thereafter, the step of "get interface test results for target page" in step 460, step 480, is continued.
In this embodiment, by determining that the test mode is the second preset mode, on the basis of performing the interface test and the page test on the target page, the interface comparison information is generated, so that the interface change of the target page can be recorded, and regression comparison can be performed when the requirement of the target page is changed.
As an optional implementation manner, the above page testing method may further include the following steps:
first, based on an automatic test script, monitoring a test process corresponding to a target page.
Specifically, when the execution body executes the test process of the target page according to the automatic test script, the execution body can monitor the test process corresponding to the target page in real time or at intervals of preset time, and monitor the page test process and the interface test process of the target page.
And secondly, judging whether the testing process of the target page is abnormal or not based on the testing data of the target page.
Specifically, the execution subject monitors and judges the testing process of the target page by using the testing data of the target page, and determines whether the testing process of the target page is abnormal or not.
And executing a third step in response to determining that the testing process of the target page is abnormal, and generating first prompt information for prompting the testing process of the target page to be abnormal in response to determining that the testing process of the target page is abnormal.
Specifically, the executing body determines that the test process of the target page is abnormal, and generates first prompt information according to the abnormal position of the abnormal, wherein the first prompt information can represent the test abnormality of the target page and prompt the abnormal position. The executing body can send the first prompt information to the test personnel through mail, short message and the like.
And executing a fourth step in response to determining that the testing process of the target page is normal, and generating second prompt information for prompting that the testing process of the target page is normal in response to determining that the testing process of the target page is normal.
Specifically, the executing body determines that the testing process of the target page is normal through judgment, and generates second prompt information, wherein the second prompt information can represent that the testing process of the target page is normal. The executing body can send the second prompt information to the tester in a mail or short message mode and the like, and continues to monitor the testing process of the target page.
In the implementation manner, the test process of the target page is monitored, so that the timing inspection of the test process of the target page can be realized under the condition that operation and maintenance are not needed, the abnormality is found in the first time, and the test process of the target page can be maintained.
Referring to fig. 5, as an implementation of the method shown in the above figures, the present disclosure provides one embodiment of a page testing apparatus. This embodiment of the device corresponds to the embodiment of the method shown in fig. 2.
As shown in fig. 5, the page testing apparatus 500 of the present embodiment may include: a presentation module 510, a generation module 520, an acquisition module 530, and a test module 540.
Wherein, the display module 510 is configured to display an editing interface of the automated test script in response to receiving the test request corresponding to the target page;
the generating module 520 is configured to generate an automated test script corresponding to the target page in response to receiving the test data input at the editing interface;
an obtaining module 530, configured to obtain a first interface parameter corresponding to the target page based on the reverse proxy mode and the automated test script;
the testing module 540 is configured to perform an interface test on the target page based on the first interface parameter.
In some alternative implementations of the present implementation, the testing module 540 includes: the acquisition unit is configured to acquire an interface test task corresponding to the first interface parameter based on the first interface parameter; the generating unit is configured to generate an interface test case corresponding to the target page based on the interface test task corresponding to the first interface parameter; and the testing unit is configured to perform interface testing on the target page based on the interface testing case corresponding to the target page.
In some optional implementations of the present implementation, the test unit is further configured to: leading the first interface parameters into an interface test platform; and performing interface test on the target page by using the interface test platform and the interface test case.
In some optional implementations of the present implementation, the obtaining module 530 is further configured to: obtaining a test mode corresponding to a target webpage; responding to the determination that the test mode is a first preset mode, and acquiring an interface test result of the target page; based on the automatic test script and the first interface parameter, performing page test on the target page to obtain a page test result of the target page; and, a generation module 520 further configured to: and generating a test result of the target page based on the interface test result and the page test result.
In some optional implementations of the present implementation, the obtaining module 530 is further configured to: responding to the determination that the test mode is a second preset mode, and acquiring historical interface parameters corresponding to the target page; the generation module 520 is further configured to: comparing the first interface parameter with the historical interface parameter to generate interface comparison information; and, an acquisition module 530 further configured to: obtaining a test mode corresponding to a target webpage; responding to the determination that the test mode is a first preset mode, and acquiring an interface test result of the target page; based on the automatic test script and the first interface parameter, performing page test on the target page to obtain a page test result of the target page; and, a generation module 520 further configured to: and generating a test result of the target page based on the interface test result and the page test result.
In some optional implementations of the present implementation, the apparatus further includes: the monitoring module and the judging module; a monitoring module configured to: based on the automatic test script, monitoring a test process corresponding to the target page; a judgment module configured to: judging whether the testing process of the target page is abnormal or not based on the testing data of the target page; the generation module 520 is further configured to: and generating first prompt information for prompting the test abnormality of the target page in response to the determination that the test process of the target page is abnormal.
In some optional implementations of the present implementation, the generating module 520 is further configured to: and generating second prompt information for prompting the target page to test normally in response to the fact that the test process of the target page is determined to be normal.
According to the page test device provided by the embodiment of the disclosure, the execution main body firstly responds to the received test request corresponding to the target page, displays the editing interface of the automatic test script, responds to the received test data input in the editing interface, generates the automatic test script corresponding to the target page, then obtains the first interface parameter corresponding to the target page based on the reverse proxy mode and the automatic test script, and finally performs the interface test on the target page based on the first interface parameter.
Those skilled in the art will appreciate that the above-described apparatus also includes some other well-known structures, such as a processor, memory, etc., which are not shown in fig. 5 in order to unnecessarily obscure embodiments of the present disclosure.
It should be noted that, in the technical solution of the present disclosure, the related aspects of collecting, updating, analyzing, processing, using, transmitting, storing, etc. of the personal information of the user all conform to the rules of the related laws and regulations, and are used for legal purposes without violating the public order colloquial. Necessary measures are taken for the personal information of the user, illegal access to the personal information data of the user is prevented, and the personal information security, network security and national security of the user are maintained.
Referring now to fig. 6, a schematic diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a smart screen, a notebook computer, a PAD (tablet), a PMP (portable multimedia player), an in-vehicle terminal (e.g., in-vehicle navigation terminal), etc., a fixed terminal such as a digital TV, a desktop computer, etc. The terminal device shown in fig. 6 is only one example, and should not impose any limitation on the functions and scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 6 may represent one device or a plurality of devices as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing means 601. It should be noted that the computer readable medium of the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In an embodiment of the present disclosure, 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. Whereas in embodiments of the present disclosure, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented in software or in hardware. The described units may also be provided in a processor, for example, described as: a processor includes a presentation module, a generation module, an acquisition module, and a test module, where the names of the modules do not constitute a limitation on the module itself in some cases.
As another aspect, the present application also provides a computer readable medium, which may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: responding to the received test request corresponding to the target page, and displaying an editing interface of the automatic test script; responding to the received test data input in the editing interface, and generating an automatic test script corresponding to the target page; acquiring a first interface parameter corresponding to a target page based on a reverse proxy mode and an automatic test script; and performing interface test on the target page based on the first interface parameters.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (16)

1. A method of page testing, the method comprising:
responding to the received test request corresponding to the target page, and displaying an editing interface of the automatic test script;
responding to the received test data input in the editing interface, and generating an automatic test script corresponding to the target page;
acquiring a first interface parameter corresponding to the target page based on a reverse proxy mode and the automatic test script;
and carrying out interface test on the target page based on the first interface parameter.
2. The method of claim 1, wherein the interface testing the target page based on the first interface parameter comprises:
Based on the first interface parameters, acquiring interface test tasks corresponding to the first interface parameters;
generating an interface test case corresponding to the target page based on the interface test task corresponding to the first interface parameter;
and carrying out interface test on the target page based on the interface test case corresponding to the target page.
3. The method of claim 2, wherein the performing the interface test on the target page based on the interface test case corresponding to the target page comprises:
importing the first interface parameters into an interface test platform;
and carrying out interface test on the target page by utilizing the interface test platform and the interface test case.
4. The method of claim 1, the method further comprising:
obtaining a test mode corresponding to the target webpage;
responding to the determination that the test mode is a first preset mode, and acquiring an interface test result of the target page;
based on the automatic test script and the first interface parameter, performing page test on the target page to obtain a page test result of the target page;
and generating a test result of the target page based on the interface test result and the page test result.
5. The method of claim 4, the method further comprising:
responding to the fact that the test mode is a second preset mode, and acquiring historical interface parameters corresponding to the target page;
comparing the first interface parameter with the historical interface parameter to generate interface comparison information; the method comprises the steps of,
obtaining an interface test result of the target page;
based on the automatic test script and the first interface parameter, performing page test on the target page to obtain a page test result of the target page;
and generating a test result of the target page based on the interface test result and the page test result.
6. The method of any of claims 1-5, the method further comprising:
based on the automatic test script, monitoring a test process corresponding to the target page;
judging whether the testing process of the target page is abnormal or not based on the testing data of the target page;
and generating first prompt information for prompting the target page to test abnormality in response to determining that the abnormality exists in the test process of the target page.
7. The method of claim 6, the method further comprising:
And generating second prompt information for prompting that the target page tests normally in response to the fact that the testing process of the target page is normal.
8. A page testing apparatus, the apparatus comprising:
the display module is configured to display an editing interface of the automatic test script in response to receiving a test request corresponding to the target page;
the generation module is configured to respond to the received test data input in the editing interface and generate an automatic test script corresponding to the target page;
the acquisition module is configured to acquire a first interface parameter corresponding to the target page based on a reverse proxy mode and the automatic test script;
and the testing module is configured to perform interface testing on the target page based on the first interface parameter.
9. The apparatus of claim 8, wherein the test module comprises:
the acquisition unit is configured to acquire an interface test task corresponding to the first interface parameter based on the first interface parameter;
the generating unit is configured to generate an interface test case corresponding to the target page based on the interface test task corresponding to the first interface parameter;
And the testing unit is configured to perform interface testing on the target page based on the interface testing case corresponding to the target page.
10. The apparatus of claim 9, wherein the test unit is further configured to:
importing the first interface parameters into an interface test platform;
and carrying out interface test on the target page by utilizing the interface test platform and the interface test case.
11. The apparatus of claim 8, wherein the acquisition module is further configured to:
obtaining a test mode corresponding to the target webpage;
responding to the determination that the test mode is a first preset mode, and acquiring an interface test result of the target page;
based on the automatic test script and the first interface parameter, performing page test on the target page to obtain a page test result of the target page; the method comprises the steps of,
the generation module is further configured to: and generating a test result of the target page based on the interface test result and the page test result.
12. The apparatus of claim 11, the acquisition module further configured to: responding to the fact that the test mode is a second preset mode, and acquiring historical interface parameters corresponding to the target page;
The generation module is further configured to: comparing the first interface parameter with the historical interface parameter to generate interface comparison information; the method comprises the steps of,
the acquisition module is further configured to:
obtaining a test mode corresponding to the target webpage;
responding to the determination that the test mode is a first preset mode, and acquiring an interface test result of the target page;
based on the automatic test script and the first interface parameter, performing page test on the target page to obtain a page test result of the target page; the method comprises the steps of,
the generation module is further configured to: and generating a test result of the target page based on the interface test result and the page test result.
13. The apparatus according to any one of claims 8-12, the apparatus further comprising: the monitoring module and the judging module;
the monitoring module is configured to: based on the automatic test script, monitoring a test process corresponding to the target page;
the judging module is configured to: judging whether the testing process of the target page is abnormal or not based on the testing data of the target page;
The generation module is further configured to: and generating first prompt information for prompting the target page to test abnormality in response to determining that the abnormality exists in the test process of the target page.
14. The apparatus of claim 13, wherein the generation module is further configured to:
and generating second prompt information for prompting that the target page tests normally in response to the fact that the testing process of the target page is normal.
15. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-7.
16. A computer readable medium on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any one of claims 1-7.
CN202310684712.9A 2023-06-09 2023-06-09 Page testing method and device Pending CN116662193A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310684712.9A CN116662193A (en) 2023-06-09 2023-06-09 Page testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310684712.9A CN116662193A (en) 2023-06-09 2023-06-09 Page testing method and device

Publications (1)

Publication Number Publication Date
CN116662193A true CN116662193A (en) 2023-08-29

Family

ID=87713506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310684712.9A Pending CN116662193A (en) 2023-06-09 2023-06-09 Page testing method and device

Country Status (1)

Country Link
CN (1) CN116662193A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117609104A (en) * 2024-01-24 2024-02-27 盛威时代科技股份有限公司 Page exception processing method, system and equipment in client test process

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117609104A (en) * 2024-01-24 2024-02-27 盛威时代科技股份有限公司 Page exception processing method, system and equipment in client test process

Similar Documents

Publication Publication Date Title
JP6898968B2 (en) Methods and devices for determining response time
CN109614340A (en) Exploitation adjustment method, device, electronic equipment and the storage medium of application program
CN112311620A (en) Method, apparatus, electronic device and readable medium for diagnosing network
CN110908922A (en) Application program testing method and device
CN113806212A (en) Application program exception positioning method and device and electronic equipment
CN116662193A (en) Page testing method and device
CN110059064B (en) Log file processing method and device and computer readable storage medium
CN110084298B (en) Method and device for detecting image similarity
CN114840379A (en) Log generation method, device, server and storage medium
CN113608997B (en) Remote debugging method and device for embedded webpage of application program and electronic equipment
CN112954056B (en) Method and device for processing monitoring data, electronic equipment and storage medium
CN112084114B (en) Method and apparatus for testing interfaces
CN113362173A (en) Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium
CN111930629A (en) Page testing method and device, electronic equipment and storage medium
CN112882948A (en) Stability testing method, device and system for application and storage medium
CN116756016A (en) Multi-browser testing method, device, equipment, medium and program product
CN113407229B (en) Method and device for generating offline scripts
CN112445697B (en) Method and apparatus for testing applications
CN115422052A (en) Vehicle navigation app test system and method
CN113626301B (en) Method and device for generating test script
CN113849416A (en) Test method, test device, storage medium and electronic equipment
CN113835996A (en) Method and device for generating test script
CN109756393B (en) Information processing method, system, medium, and computing device
CN113127362A (en) Object testing method, object testing device, electronic device, and readable storage medium
CN111831530A (en) Test method and device

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