CN113760724A - Automatic testing method and device, electronic equipment and computer readable medium - Google Patents

Automatic testing method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN113760724A
CN113760724A CN202110057307.5A CN202110057307A CN113760724A CN 113760724 A CN113760724 A CN 113760724A CN 202110057307 A CN202110057307 A CN 202110057307A CN 113760724 A CN113760724 A CN 113760724A
Authority
CN
China
Prior art keywords
target
test
request
page
response
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
CN202110057307.5A
Other languages
Chinese (zh)
Inventor
岑俊伟
张翔
沙冥冥
桂永红
马剑
凌飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110057307.5A priority Critical patent/CN113760724A/en
Publication of CN113760724A publication Critical patent/CN113760724A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/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 discloses an automatic testing method, an automatic testing device, electronic equipment and a computer readable medium. One embodiment of the method comprises: according to the type of the target page, testing the target page by adopting one of the following testing methods: injecting a first test case into a target page to generate a test page image; comparing the test page image with the reference page image to generate a first test result; or injecting a second test case into the target page to generate a test page; and checking whether each element node included in the test page is displayed normally or not to generate a second test result. The method and the device improve reusability of the automatic test script and reduce test time and labor cost.

Description

Automatic testing method and device, electronic equipment and computer readable medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to an automatic testing method, an automatic testing device, electronic equipment and a computer readable medium.
Background
With the development of internet technology, technologies for development of web applications have emerged in a blowout manner, but testing technologies for web applications have not yet become mature. At present, different automatic test scripts are often required to be written to test the webpage application program.
However, when the automated test is performed in the above manner, there are often technical problems as follows:
the reusability of automated test scripts is poor and the time and labor costs of testing are increased.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose automated testing methods, apparatuses, electronic devices and computer readable media to address one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide an automated testing method, the method comprising: according to the type of the target page, testing the target page by adopting one of the following testing methods: injecting a first test case into the target page to generate a test page image; comparing the test page image with a reference page image to generate a first test result; or injecting a second test case into the target page to generate a test page; and checking whether each element node included in the test page is displayed normally or not to generate a second test result.
Optionally, the method further comprises: in response to the situation that a reference page image is not received and the situation that the reference page image is not stored in a target file is determined, injecting a reference test case into the target page to generate a reference page; performing screenshot operation on the reference page to generate the reference page image; and storing the reference page image into the target file.
Optionally, comparing the test page image with the reference page image to generate a first test result, including: and in response to receiving the reference page image, comparing the test page image with the reference page image to generate the first test result.
Optionally, comparing the test page image with the reference page image to generate a first test result, including: and in response to not receiving the reference page image and determining that the reference page image is stored in the target file, comparing the test page image with the reference page image to generate the first test result.
Optionally, the method further comprises: and jumping to the target page in response to determining that the adjustment of the simulator size is completed, wherein the simulator size is determined according to the size of the target display terminal.
Optionally, the method further comprises: verifying whether the local digital certificate is legal or not; generating a digital certificate in response to determining that the local digital certificate is not legitimate; and in response to determining that the target user executes the target operation on the control corresponding to the digital certificate, determining the digital certificate as the local digital certificate and starting a proxy server, wherein the proxy server is used for intercepting and replying the request of the target user.
Optionally, the method further comprises: and starting the proxy server in response to the fact that the local digital certificate is legal.
Optionally, comparing the test page image with the reference page image to generate a first test result, including: comparing the test page image with the reference page image through a preset image comparison algorithm to generate a similarity numerical value; generating the first test result in response to determining that the similarity value is within a predetermined range.
Optionally, the method further comprises: in response to determining that the current service type is the first service type, starting a preset tool engine and setting a proxy port; and in response to the fact that the preset tool engine is successfully started and the proxy port is successfully set, packaging the first target file.
Optionally, the method further comprises: and verifying the development environment in response to determining that the current service type is the second service type.
Optionally, the method further comprises: in response to determining that each first condition in a first condition group holds, sending a target request to a target server, wherein the target request is a request sent by a target terminal, and the first condition group comprises: the target address corresponding to the target request and the successful start of the proxy server are included in a white list information table.
Optionally, the method further comprises: in response to determining that each of a second set of conditions holds, adding the target request as a first request to a first request processing queue, wherein the second set of conditions includes: the proxy server is successfully started, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a first request type.
Optionally, the method further comprises: and in response to determining that each third condition in a third condition group is satisfied, adding the target request as a second request to a second request processing queue, wherein the third condition group comprises: the proxy server is successfully started, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a second request type.
Optionally, the method further comprises: and in response to determining that the first request exists in the first request processing queue, sequentially taking out the first requests from the first request processing queue, and executing a first business operation corresponding to the first request.
Optionally, the method further comprises: and in response to determining that the second request processing queue has the second request, sequentially taking out the second request from the second request processing queue, and executing a second business operation corresponding to the second request.
Optionally, the method further comprises: and analyzing the target configuration file in response to the fact that the development environment is verified.
Optionally, the method further comprises: and in response to determining that the target configuration file is successfully analyzed, packaging the second target file.
In a second aspect, some embodiments of the present disclosure provide an automated testing apparatus, the apparatus comprising: a test unit configured to: according to the type of the target page, testing the target page by adopting one of the following testing devices: injecting a first test case into the target page to generate a test page image; comparing the test page image with a reference page image to generate a first test result; or injecting a second test case into the target page to generate a test page; and checking whether each element node included in the test page is displayed normally or not to generate a second test result.
Optionally, the apparatus further comprises: in response to the situation that a reference page image is not received and the situation that the reference page image is not stored in a target file is determined, injecting a reference test case into the target page to generate a reference page; performing screenshot operation on the reference page to generate the reference page image; and storing the reference page image into the target file.
Optionally, the test unit is further configured to: and in response to receiving the reference page image, comparing the test page image with the reference page image to generate the first test result.
Optionally, the test unit is further configured to: and in response to not receiving the reference page image and determining that the reference page image is stored in the target file, comparing the test page image with the reference page image to generate the first test result.
Optionally, the apparatus further comprises: and jumping to the target page in response to determining that the adjustment of the simulator size is completed, wherein the simulator size is determined according to the size of the target display terminal.
Optionally, the apparatus further comprises: verifying whether the local digital certificate is legal or not; generating a digital certificate in response to determining that the local digital certificate is not legitimate; and in response to determining that the target user executes the target operation on the control corresponding to the digital certificate, determining the digital certificate as the local digital certificate and starting a proxy server, wherein the proxy server is used for intercepting and replying the request of the target user.
Optionally, the apparatus further comprises: and starting the proxy server in response to the fact that the local digital certificate is legal.
Optionally, the test unit is further configured to: comparing the test page image with the reference page image through a preset image comparison algorithm to generate a similarity numerical value; generating the first test result in response to determining that the similarity value is within a predetermined range.
Optionally, the apparatus further comprises: in response to determining that the current service type is the first service type, starting a preset tool engine and setting a proxy port; and in response to the fact that the preset tool engine is successfully started and the proxy port is successfully set, packaging the first target file.
Optionally, the apparatus further comprises: and verifying the development environment in response to determining that the current service type is the second service type.
Optionally, the apparatus further comprises: in response to determining that each first condition in a first condition group holds, sending a target request to a target server, wherein the target request is a request sent by a target terminal, and the first condition group comprises: the target address corresponding to the target request and the successful start of the proxy server are included in the white list information table
Optionally, the apparatus further comprises: in response to determining that each of a second set of conditions holds, adding the target request as a first request to a first request processing queue, wherein the second set of conditions includes: the proxy server is successfully started, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a first request type.
Optionally, the apparatus further comprises: and in response to determining that each third condition in a third condition group is satisfied, adding the target request as a second request to a second request processing queue, wherein the third condition group comprises: the proxy server is successfully started, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a second request type.
Optionally, the apparatus further comprises: and in response to determining that the first request exists in the first request processing queue, sequentially taking out the first requests from the first request processing queue, and executing a first business operation corresponding to the first request.
Optionally, the apparatus further comprises: and in response to determining that the second request processing queue has the second request, sequentially taking out the second request from the second request processing queue, and executing a second business operation corresponding to the second request.
Optionally, the apparatus further comprises: and analyzing the target configuration file in response to the fact that the development environment is verified.
Optionally, the apparatus further comprises: and in response to determining that the target configuration file is successfully analyzed, packaging the second target file.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following beneficial effects: by the aid of the automatic testing method, reusability of the automatic testing script is improved, and testing time and labor cost are reduced. Specifically, the reasons for poor reusability of the automated test scripts, long test time and high labor cost overhead are as follows: the automated test flow is not abstracted. Based on this, first, the automated testing method of some embodiments of the present disclosure tests the page by selecting different testing methods according to the type of the target page. In practical situations, pages are mainly divided into two main categories: the first category belongs to presentation class pages which contain fewer operation controls (e.g., button controls, input box controls, etc.), and the second category belongs to interaction class pages which contain more operation controls. For the first type of page, because the page is simpler, the page can be tested by checking whether the element nodes included in the page are normal or not. For the second type of page, because the page contains more operation controls and the positions of the operation controls in different interactive type pages are different, the page is difficult to test by a method of checking element nodes included in the page. Therefore, by adopting a mode of comparing with the reference page image, the method can well overcome the defects of the method for checking the element nodes included in the page. Finally, by abstracting the automatic test flow, the reusability of the automatic test script is improved, and the test time and the labor cost are reduced.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
1-2 are schematic diagrams of one application scenario of the automated testing method of some embodiments of the present disclosure;
FIG. 3 is a flow diagram of some embodiments of an automated testing method according to the present disclosure;
FIG. 4 is a flow diagram of further embodiments of an automated testing method according to the present disclosure;
FIG. 5 is a flow diagram of still further embodiments of automated testing methods according to the present disclosure;
FIG. 6 is a schematic block diagram of some embodiments of an automated test equipment according to the present disclosure;
FIG. 7 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1-2 are schematic diagrams of one application scenario of an automated testing method of some embodiments of the present disclosure.
In the application scenario of FIG. 1, the computing device 101 may be based on the type 102 of the target page. For example, the type 102 of the target page may be a web page type. The target page 103 is verified using the following test method: first, the computing device 101 may inject a first test case 104 into the target page 103 described above to generate a test page image 105. The computing device 101 may then compare the test page image 105 with the reference page image 106 to generate a first test result 107.
In the application scenario of FIG. 2, the computing device 101 may be based on the type 102 of the target page. For example, the type 102 of the target page may be a type corresponding to the mobile terminal page. The target page 103 is verified using the following test method: first, computing device 101 may inject second test case 108 into target page 103 described above to generate test page 109. The computing device 101 may then verify whether the various element nodes included in the test page 109 are properly displayed to generate a second test result 110.
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in FIG. 1 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 3, a flow 300 of some embodiments of an automated testing method according to the present disclosure is shown. The automatic testing method comprises the following steps:
according to the type of the target page, the target page is verified by adopting one of the following steps 3011-3012 or 3021-3022, where the type of the target page may be a web page type or an HTML5 page type, the HTML5 page type may be a type corresponding to a moving end page written in an HTML5 language, and when the type of the target page is a web page type, the testing method corresponding to the step 3011-3012 may be adopted. When the type of the target page is HTML5 page type, the test method corresponding to step 3021 and 3022 may be adopted:
step 3011, inject the first test case into the target page to generate a test page image.
In some embodiments, the executing agent of the automated testing method (e.g., computing device 101 shown in fig. 1) may: first, a first test case is injected into the target page. And then, performing screenshot operation on the target page injected with the first test case through a screenshot command to generate the test page image. The first test case may be a set of test data including input data and expected results corresponding to the target page type. The target page may be a page that needs to be tested.
As an example, the above-described screen Capture command may be "Capture full size screen shot".
Step 3012, compare the test page image with the reference page image to generate a first test result.
In some embodiments, the execution subject may compare the test page image with a reference page image to generate a first test result. The reference page image may be an image corresponding to a page into which the reference test case is injected. The first test result is used for representing the difference information between the test page image and the reference page image. The execution body may first convert the test page image and the reference page image into binary files, and then compare the binary file corresponding to the test page image and the binary file corresponding to the reference page image word by word, so as to determine a difference between the test page image and the reference page image, thereby generating the first test result.
Step 3021, injecting a second test case into the target page to generate a test page.
In some embodiments, the execution agent may inject a second test case into the target page to generate a test page. The second test case may be a set of test data including input data and expected results corresponding to the target page type. And the test page is used for representing a page generated by rendering after the second test case is injected.
Step 3022, checking whether each element node included in the test page is displayed normally, so as to generate a second test result.
In some embodiments, each page element corresponds to a page element number. Therefore, the execution main body can check whether each element node included in the test page is normally displayed or not by searching whether the page element number corresponding to the page element exists or not so as to generate a second test result. And the second test result is used for representing whether each element node included in the test page is displayed normally or not. The element node display normal may be characterized by a "1". An element node display exception may be characterized by a "0". The element node can also be characterized by "True" to show normal. Element nodes may also be characterized by "False" to show anomalies. The element nodes are used for representing page elements in the page.
As an example, the execution subject may find a page element corresponding to the page element number through a "document. The second test result can be { 'id 1': False; 'id 2' True }.
The above embodiments of the present disclosure have the following beneficial effects: by the aid of the automatic testing method, reusability of the automatic testing script is improved, and testing time and labor cost are reduced. Specifically, the reasons for poor reusability of the automated test scripts, long test time and high labor cost overhead are as follows: the automated test flow is not abstracted. Based on this, first, the automated testing method of some embodiments of the present disclosure tests the page by selecting different testing methods according to the type of the target page. In practical situations, pages are mainly divided into two main categories: the first category belongs to presentation class pages which contain fewer operation controls (e.g., button controls, input box controls, etc.), and the second category belongs to interaction class pages which contain more operation controls. For the first type of page, because the page is simpler, the page can be tested by checking whether the element nodes included in the page are normal or not. For the second type of page, because the page contains more operation controls and the positions of the operation controls in different interactive type pages are different, the page is difficult to test by a method of checking element nodes included in the page. Therefore, by adopting a mode of comparing with the reference page image, the method can well overcome the defects of the method for checking the element nodes included in the page. Finally, by abstracting the automatic test flow, the reusability of the automatic test script is improved, and the test time and the labor cost are reduced.
With further reference to fig. 4, a flow 400 of further embodiments of automated testing methods is illustrated. The process 400 of the automated testing method includes the following steps:
step 401, checking whether the local digital certificate is legal.
In some embodiments, an execution main body (for example, the computing device 101 shown in fig. 1) of the automated testing method may verify whether the local digital certificate is legal by verifying whether the local digital certificate is stored in the execution main body, and if the local digital certificate is stored in the execution main body, the local digital certificate is legal. If the local digital certificate is not stored in the execution main body, the local digital certificate is illegal. The executing entity may also use a CA (Certificate Authority) certification service to verify whether the local digital Certificate is legitimate.
In response to determining that the local digital certificate is legitimate, a proxy server is initiated, step 402.
In some embodiments, the executing agent may initiate the proxy server in response to determining that the local digital certificate is legitimate. The proxy server may be a virtual server operating inside the execution body. The proxy server may be used to intercept and reply to requests of target users.
Optionally, the executing entity starts the proxy server in response to determining that the local digital certificate is legal, and may further include the following steps:
in the first step, a tool presetting engine is started and a proxy port is set in response to the fact that the current business type is determined to be the first business type. The service type is used for representing the application type. The first service type may be used to characterize a web page type. The types of web pages include, but are not limited to, at least one of: static web page types and dynamic web page types. The preset tool engine may be a set of application programming interfaces for performing automated testing. The proxy port number is used to ensure that the communication connection can be performed normally.
As an example, the preset tool engine may be Puppeteer.
And secondly, in response to the fact that the preset tool engine is successfully started and the proxy port is successfully set, packaging the first target file. Wherein, the first target file may include, but is not limited to, at least one of the following: page element handles, browser programs, web pages. The page element handle may be an identifier for identifying a page element.
Optionally, the executing entity starts the proxy server in response to determining that the local digital certificate is legal, and may further include the following steps:
the first step, in response to determining that the current service type is the second service type, verifies the development environment. Wherein the second service type may be a type for characterizing the applet. Types of applets described above include, but are not limited to, at least one of: e-commerce type small program type, reservation type small program type and region service type small program type. The execution subject may verify the development environment by determining whether the development environment is activated.
And secondly, analyzing the target configuration file in response to the fact that the development environment is verified. The target configuration file may be a file containing configuration content corresponding to the applet.
And thirdly, in response to the fact that the target configuration file is successfully analyzed, packaging the second target file. The execution main body may determine whether the target configuration file is successfully parsed by determining whether an exception is thrown during parsing the target configuration file. As an example, when the execution main body finishes reading the target configuration file and does not throw an exception, it may be determined that the target configuration file is successfully parsed. The second object file may include, but is not limited to, at least one of: applet items, mobile pages, page element handles. The page element handle may be an identifier for identifying a page element.
Optionally, the executing entity starts the proxy server in response to determining that the local digital certificate is legal, and may further include the following steps:
in the first step, in response to determining that each first condition in a first condition group holds, a target request is sent to a target server, where the target request is a request sent by a target terminal, and the first condition group may include: the target address corresponding to the target request and the successful start of the proxy server are included in a white list information table. The target request may be a request during data communication between the execution main body and the target server. The white list information table may be an information table including a destination address. The target address may be an IP (Internet Protocol) address of a responder of the target request.
Optionally, the executing entity starts the proxy server in response to determining that the local digital certificate is legal, and may further include the following steps:
a first step of adding the target request as a first request to a first request processing queue in response to determining that each of second conditions in a second condition group holds, wherein the second condition group includes: the proxy server is successfully started, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a first request type. The first request type may be a type of a request packet corresponding to the target request. The first Request type may be a Request object type.
And a second step, in response to determining that a second request exists in the second request processing queue, sequentially taking out the second request from the second request processing queue, and executing a second service operation corresponding to the second request. The second service operation may be an operation of acquiring information that needs to be acquired by the second request. The second service operation may be an operation of responding to the second request transmission.
Optionally, the executing entity starts the proxy server in response to determining that the local digital certificate is legal, and may further include the following steps:
a first step of adding the target request as a second request to a second request processing queue in response to determining that each third condition in a third condition group is satisfied, wherein the third condition group includes: the proxy server is successfully started, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a second request type. The second request type may be a type of a response packet corresponding to the target request. The second request type may be a Response object type.
And a second step, in response to determining that a second request exists in the second request processing queue, sequentially taking out the second request from the second request processing queue, and executing a second service operation corresponding to the second request. The second service operation may be an operation of returning data corresponding to the acquired second request to the second request sender.
In response to determining that the local digital certificate is not legitimate, a digital certificate is generated, STEP 403.
In some embodiments, the enforcement agent may, in response to determining that the local digital Certificate is not legitimate, apply for a CA Certificate with a CA (Certificate Authority) and determine a CA Certificate issued by the Certificate Authority as the digital Certificate. The execution subject may also generate the digital certificate through OpenSSL (open secure socket layer protocol). The execution body may also generate the digital certificate by using a TLS (Transport Layer Security) encryption program implemented by JavaScript scripting language.
Step 404, in response to determining that the target user performs the target operation on the control corresponding to the digital certificate, determining the digital certificate as a local digital certificate and starting the proxy server.
In some embodiments, the executing agent may determine the digital certificate as the local digital certificate and start the proxy server in response to determining that the target user performs a target operation on a control corresponding to the digital certificate. The control corresponding to the digital certificate may be a "confirmation button" or a "sliding verification control". The target operation may be a "click operation" or a "slide operation".
As an example, the execution main body may execute "click operation" on a "confirmation button", and then, confirm the digital certificate as the local certificate and start the proxy server.
As another example, the execution principal may execute a "swipe operation" on a "swipe validation control," and then validate the digital certificate as the local certificate and start the proxy server.
In response to determining that the simulator size is adjusted, jump to the target page, step 405.
In some embodiments, the execution agent may jump to the target page in response to determining that the adjustment completes the simulator size. Wherein, the simulator size is determined according to the size of the target display terminal. The target display terminal can be a man-machine interaction system which presents pre-written codes on a screen in the forms of characters, voice and images. The target display terminal can be a mobile phone display terminal or a computer display terminal.
Step 406, injecting a first test case into the target page to generate a test page image.
In some embodiments, the execution body may: firstly, injecting a first test case into the target page, and then performing screenshot operation on the target page injected with the first test case through screenshot software to generate the test page image. Before injecting the first test case into the target page, the execution subject may also inject a global configuration file and a plug-in group. After injecting the first test case into the target page, the execution subject may mount an assertion tool function to the target page. The unit tool function is used for capturing the abnormity in the automatic test process.
Step 407, in response to that the reference page image is not received and it is determined that the reference page image is not stored in the target file, injecting a reference test case into the target page to generate a reference page.
In some embodiments, the execution subject may inject the benchmark test case into the target page in response to not receiving the benchmark page image and determining that the target file does not store the benchmark page image, so as to generate the benchmark page. The reference page image may be an image obtained by capturing a screen of a page into which a reference test case has been injected. The target file may be a file for storing the reference page image. The benchmark test case may be a test case used for conducting a benchmark test. The execution body may first search the target document by a relative address corresponding to the target document, and then determine whether the target document stores the reference page image by determining whether the target document includes an image having the same name as the reference page image. In addition, the execution body may first search for the target document by using the absolute address corresponding to the target document, and then determine whether or not the target document stores the reference page image by determining whether or not the target document includes an image of the same document type as the reference page image.
And step 408, performing screenshot operation on the reference page to generate a reference page image.
In some embodiments, the executing agent may perform a screenshot operation on the reference page through screenshot software to generate the reference page image.
Step 409, storing the reference page image into the target file.
In some embodiments, the execution subject may save the reference page image into the target document.
Step 410, comparing the test page image with the reference page image to generate a first test result.
In some embodiments, the executing entity may compare the test page image and the reference page image by a perceptual hash algorithm to generate the first test result.
In some optional implementations of some embodiments, the executing entity may compare, by using an SSIM (Structural SIMilarity) image processing algorithm, the test page image with the reference page image in response to receiving the reference page image, to generate the first test result.
In some optional implementation manners of some embodiments, the executing entity may compare, in response to that the reference page image is not received and that the reference page image is determined to be stored in the target file, the test page image with the reference page image by using a Scale-invariant feature transform (SIFT) image processing algorithm to generate the first test result.
In some optional implementations of some embodiments, the comparing, by the execution subject, the test page image with the reference page image to generate the first test result may include:
firstly, comparing the test page image with the reference page image through a preset image comparison algorithm to generate a similarity numerical value. The preset image comparison algorithm may be a CNN (Convolutional Neural Networks) algorithm, or may be an RNN (Recurrent Neural Networks) algorithm.
And a second step of generating the first test result in response to determining that the similarity value is within a predetermined range.
As can be seen from fig. 4, compared with the description of some embodiments corresponding to fig. 3, the flow 400 of the automated testing method in some embodiments corresponding to fig. 4 firstly verifies the local digital certificate, thereby ensuring the security during the data communication process. And secondly, intercepting the communication data in the automatic test process through the proxy server, so that the communication data required in the automatic test process can be acquired. In addition, when the local certificate is illegal, in order to ensure that the automatic test can be normally performed, a step of generating the digital certificate is added, and the digital certificate is determined as the local digital certificate after a user performs a target operation (for example, clicking a button operation for indicating that the target user trusts the digital certificate). Then, since the adaptation condition of the page to different display terminals is verified, the verification is an essential step in the automated testing, but since the display terminals on the market have various models and sizes. Therefore, the size of the display terminal is simulated through the simulator, and therefore the adaptation condition of the page in different display terminals can be verified efficiently and conveniently. In addition, when the reference page image is not received and the target document does not store the reference page image, the test page image cannot be compared with the reference page image, so that the automatic test process cannot be normally performed. Therefore, for the above situation, a step of injecting a benchmark test case into the target page to generate a benchmark page, and then performing screenshot on the benchmark page to generate a benchmark page image is added. The automatic testing process can be stably carried out.
With further reference to fig. 5, a flow 500 of further embodiments of an automated testing method is illustrated. The process 500 of the automated testing method includes the following steps:
step 501, checking whether the local digital certificate is legal.
In some embodiments, an execution main body (for example, the computing device 101 shown in fig. 1) of the automated testing method may verify whether the local digital certificate is legal by verifying whether the local digital certificate is stored in the execution main body, and if the local digital certificate is stored in the execution main body, the local digital certificate is legal. If the local digital certificate is not stored in the execution main body, the local digital certificate is illegal. The executing entity may also use a CA (Certificate Authority) certification service to verify whether the local digital Certificate is legitimate.
Step 502, in response to determining that the local digital certificate is legitimate, a proxy server is started.
In some embodiments, the executing agent may initiate the proxy server in response to determining that the local digital certificate is legitimate. The proxy server may be a virtual server operating inside the execution body. The proxy server may be used to intercept and reply to requests of target users.
Optionally, the executing entity starts the proxy server in response to determining that the local digital certificate is legal, and may further include the following steps:
in the first step, a tool presetting engine is started and a proxy port is set in response to the fact that the current business type is determined to be the first business type. The service type is used for representing the application type. The first service type may be used to characterize a web page type. The types of web pages include, but are not limited to, at least one of: static web page types and dynamic web page types. The preset tool engine may be a set of application programming interfaces for performing automated testing. The proxy port number is used to ensure that the communication connection can be performed normally.
As an example, the preset tool engine may be Puppeteer.
And secondly, in response to the fact that the preset tool engine is successfully started and the proxy port is successfully set, packaging the first target file. Wherein, the first target file may include, but is not limited to, at least one of the following: page element handles, browser programs, web pages. The page element handle may be an identifier for identifying a page element.
Optionally, the executing entity starts the proxy server in response to determining that the local digital certificate is legal, and may further include the following steps:
the first step, in response to determining that the current service type is the second service type, verifies the development environment. Wherein the second service type may be a type for characterizing the applet. Types of applets described above include, but are not limited to, at least one of: e-commerce type small program type, reservation type small program type and region service type small program type. The execution subject may verify the development environment by determining whether the development environment is activated.
And secondly, analyzing the target configuration file in response to the fact that the development environment is verified. The target configuration file may be a file including a configuration corresponding to the applet.
And thirdly, in response to the fact that the target configuration file is successfully analyzed, packaging the second target file. The execution subject may determine whether the target configuration file is successfully parsed by determining whether an exception is thrown during the process of interpreting the target configuration file. As an example, when the execution main body finishes reading the target configuration file and does not throw an exception, it may be determined that the target configuration file is successfully parsed. The second object file may include, but is not limited to, at least one of: applet items, mobile pages, page element handles. The page element handle may be an identifier for identifying a page element.
Optionally, the executing entity starts the proxy server in response to determining that the local digital certificate is legal, and may further include the following steps:
in the first step, in response to determining that each first condition in a first condition group holds, a target request is sent to a target server, where the target request is a request sent by a target terminal, and the first condition group may include: the target address corresponding to the target request and the successful start of the proxy server are included in a white list information table. The target request may be a request during data communication between the execution main body and the target server. The white list information table may be an information table including a destination address. The target address may be an IP (Internet Protocol) address of a request responder.
Optionally, the executing entity starts the proxy server in response to determining that the local digital certificate is legal, and may further include the following steps:
a first step of adding the target request as a first request to a first request processing queue in response to determining that each of second conditions in a second condition group holds, wherein the second condition group includes: the proxy server is successfully started, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a first request type. The first request type may be a type of a request packet corresponding to the target request. The first Request type may be a Request object type.
And a second step, in response to determining that a second request exists in the second request processing queue, sequentially taking out the second request from the second request processing queue, and executing a second service operation corresponding to the second request. The second service operation may be an operation of acquiring information that needs to be acquired by the second request. The second service operation may be an operation of responding to the second request transmission.
Optionally, the executing entity starts the proxy server in response to determining that the local digital certificate is legal, and may further include the following steps:
a first step of adding the target request as a second request to a second request processing queue in response to determining that each third condition in a third condition group is satisfied, wherein the third condition group includes: the proxy server is successfully started, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a second request type. The second request type may be a type of a response packet corresponding to the target request. The second request type may be a Response object type.
And a second step, in response to determining that a second request exists in the second request processing queue, sequentially taking out the second request from the second request processing queue, and executing a second service operation corresponding to the second request. The second service operation may be an operation of returning data corresponding to the acquired second request to the second request sender.
In response to determining that the local digital certificate is not legitimate, a digital certificate is generated, step 503.
In some embodiments, the enforcement agent may, in response to determining that the local digital Certificate is not legitimate, apply for a CA Certificate with a CA (Certificate Authority) and determine a CA Certificate issued by the Certificate Authority as the digital Certificate. The execution subject may also generate the digital certificate through OpenSSL (open secure socket layer protocol). The execution body may also generate the digital certificate by using a TLS (Transport Layer Security) encryption program implemented by JavaScript scripting language.
Step 504, in response to determining that the target user performs the target operation on the control corresponding to the digital certificate, determining the digital certificate as a local digital certificate and starting the proxy server.
In some embodiments, the executing agent may determine the digital certificate as the local digital certificate and start the proxy server in response to determining that the target user performs a target operation on a control corresponding to the digital certificate. The control corresponding to the digital certificate may be a "confirmation button" or a "sliding verification control". The target operation may be a "click operation" or a "slide operation".
As an example, the execution main body may execute "click operation" on a "confirmation button", and then, confirm the digital certificate as the local certificate and start the proxy server.
As another example, the execution principal may execute a "swipe operation" on a "swipe validation control," and then validate the digital certificate as the local certificate and start the proxy server.
And step 505, responding to the determination that the simulator size is adjusted, and jumping to a target page.
In some embodiments, the execution agent may jump to the target page in response to determining that the adjustment completes the simulator size. Wherein, the simulator size is determined according to the size of the target display terminal. The target display terminal can be a man-machine interaction system which presents pre-written codes on a screen in the forms of characters, voice and images. The target display terminal can be a mobile phone display terminal or a computer display terminal.
Step 506, injecting a second test case into the target page to generate a test page.
In some embodiments, the execution subject may inject the second test case into the target page to generate the test page. The execution main body can inject the second test case into the target page through an automatic test script.
Step 507, checking whether each element node included in the test page is displayed normally, so as to generate a second test result.
In some embodiments, the execution subject may verify whether each element node included in the test page is displayed normally by determining whether the number of the element nodes included in the test page reaches a predetermined number.
As can be seen from fig. 5, compared with the description of some embodiments corresponding to fig. 3, the flow 500 of the automated testing method in some embodiments corresponding to fig. 5 firstly verifies the local digital certificate, thereby ensuring the security during the data communication process. And secondly, intercepting the communication data in the automatic test process through the proxy server, so that the communication data required in the automatic test process can be acquired. In addition, when the local certificate is illegal, in order to ensure that the automatic test can be normally performed, a step of generating the digital certificate is added, and the digital certificate is determined as the local digital certificate after a user performs a target operation (for example, clicking a button operation for indicating that the target user trusts the digital certificate). Then, since the adaptation condition of the page to different display terminals is verified, the verification is an essential step in the automated testing, but since the display terminals on the market have various models and sizes. Therefore, the size of the display terminal is simulated through the simulator, and therefore the adaptation condition of the page in different display terminals can be verified efficiently and conveniently.
With further reference to fig. 6, as an implementation of the methods illustrated in the above figures, the present disclosure provides some embodiments of an automated testing apparatus, which correspond to those method embodiments illustrated in fig. 3, and which may be particularly applicable in various electronic devices.
As shown in fig. 6, the automated test equipment 600 of some embodiments includes: the test unit 601. Wherein the test unit 601 is configured to: according to the type of the target page, testing the target page by adopting one of the following testing devices: injecting a first test case into the target page to generate a test page image; comparing the test page image with a reference page image to generate a first test result; or injecting a second test case into the target page to generate a test page; and checking whether each element node included in the test page is displayed normally or not to generate a second test result.
In an optional implementation of some embodiments, the apparatus 600 further includes: in response to the situation that a reference page image is not received and the situation that the reference page image is not stored in a target file is determined, injecting a reference test case into the target page to generate a reference page; performing screenshot operation on the reference page to generate the reference page image; and storing the reference page image into the target file.
In an optional implementation of some embodiments, the test unit 601 is further configured to: and in response to receiving the reference page image, comparing the test page image with the reference page image to generate the first test result.
In an optional implementation of some embodiments, the test unit 601 is further configured to: and in response to not receiving the reference page image and determining that the reference page image is stored in the target file, comparing the test page image with the reference page image to generate the first test result.
In an optional implementation of some embodiments, the apparatus 600 further includes: and jumping to the target page in response to determining that the adjustment of the simulator size is completed, wherein the simulator size is determined according to the size of the target display terminal.
In an optional implementation of some embodiments, the apparatus 600 further includes: verifying whether the local digital certificate is legal or not; generating a digital certificate in response to determining that the local digital certificate is not legitimate; and in response to determining that the target user executes the target operation on the control corresponding to the digital certificate, determining the digital certificate as the local digital certificate and starting a proxy server, wherein the proxy server is used for intercepting and replying the request of the target user.
In an optional implementation of some embodiments, the apparatus 600 further includes: and starting the proxy server in response to the fact that the local digital certificate is legal.
In an optional implementation of some embodiments, the test unit 601 is further configured to: comparing the test page image with the reference page image through a preset image comparison algorithm to generate a similarity numerical value; generating the first test result in response to determining that the similarity value is within a predetermined range.
In an optional implementation of some embodiments, the apparatus 600 further includes: in response to determining that the current service type is the first service type, starting a preset tool engine and setting a proxy port; and in response to the fact that the preset tool engine is successfully started and the proxy port is successfully set, packaging the first target file.
In an optional implementation of some embodiments, the apparatus 600 further includes: and verifying the development environment in response to determining that the current service type is the second service type.
In an optional implementation of some embodiments, the apparatus 600 further includes: in response to determining that each first condition in a first condition group holds, sending a target request to a target server, wherein the target request is a request sent by a target terminal, and the first condition group comprises: the target address corresponding to the target request and the successful start of the proxy server are included in the white list information table
In an optional implementation of some embodiments, the apparatus 600 further includes: in response to determining that each of a second set of conditions holds, adding the target request as a first request to a first request processing queue, wherein the second set of conditions includes: the proxy server is successfully started, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a first request type.
In an optional implementation of some embodiments, the apparatus 600 further includes: and in response to determining that each third condition in a third condition group is satisfied, adding the target request as a second request to a second request processing queue, wherein the third condition group comprises: the proxy server is successfully started, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a second request type.
In an optional implementation of some embodiments, the apparatus 600 further includes: and in response to determining that the first request exists in the first request processing queue, sequentially taking out the first requests from the first request processing queue, and executing a first business operation corresponding to the first request.
In an optional implementation of some embodiments, the apparatus 600 further includes: and in response to determining that the second request processing queue has the second request, sequentially taking out the second request from the second request processing queue, and executing a second business operation corresponding to the second request.
In an optional implementation of some embodiments, the apparatus 600 further includes: and analyzing the target configuration file in response to the fact that the development environment is verified.
In an optional implementation of some embodiments, the apparatus 600 further includes: and in response to determining that the target configuration file is successfully analyzed, packaging the second target file.
Referring now to FIG. 7, a block diagram of an electronic device (such as computing device 101 shown in FIG. 1)700 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network via communications means 709, or may be installed from storage 708, or may be installed from ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the 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. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled 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: according to the type of the target page, testing the target page by adopting one of the following testing methods: injecting a first test case into the target page to generate a test page image; comparing the test page image with a reference page image to generate a first test result; or injecting a second test case into the target page to generate a test page; and checking whether each element node included in the test page is displayed normally or not to generate a second test result.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of 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 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).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. 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 described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a test unit. The names of the units do not form a limitation on the units themselves in some cases, for example, the test unit may also be described as "according to the type of the target page, the target page is tested by using one of the following test devices: injecting a first test case into the target page to generate a test page image; comparing the test page image with a reference page image to generate a first test result; or injecting a second test case into the target page to generate a test page; and a unit for verifying whether each element node included in the test page is displayed normally to generate a second test result.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology 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-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (20)

1. An automated testing method, comprising:
according to the type of the target page, testing the target page by adopting one of the following testing methods:
injecting a first test case into the target page to generate a test page image;
comparing the test page image with a reference page image to generate a first test result; or
Injecting a second test case into the target page to generate a test page;
and checking whether each element node included in the test page is displayed normally or not to generate a second test result.
2. The method of claim 1, wherein prior to said comparing said test page image to a reference page image to generate a first test result, said method further comprises:
in response to the fact that a reference page image is not received and the fact that the reference page image is not stored in a target file is determined, injecting a reference test case into the target page to generate a reference page;
performing screenshot operation on the reference page to generate the reference page image;
and storing the reference page image into the target file.
3. The method of claim 1, wherein said comparing the test page image to a reference page image to generate a first test result comprises:
and responding to the received reference page image, and comparing the test page image with the reference page image to generate the first test result.
4. The method of claim 1, wherein said comparing the test page image to a reference page image to generate a first test result comprises:
and in response to not receiving the reference page image and determining that the reference page image is stored in the target file, comparing the test page image with the reference page image to generate the first test result.
5. The method of claim 1, wherein before the testing the target page according to the type of the target page by using one of the following testing methods, the method further comprises:
and jumping to the target page in response to determining that the adjustment of the simulator size is completed, wherein the simulator size is determined according to the size of the target display terminal.
6. The method of claim 5, wherein prior to said jumping to a target page in response to determining that adjusting the simulator size is complete, the method further comprises:
verifying whether the local digital certificate is legal or not;
generating a digital certificate in response to determining that the local digital certificate is not legitimate;
and in response to determining that a target user executes a target operation on a control corresponding to the digital certificate, determining the digital certificate as the local digital certificate and starting a proxy server, wherein the proxy server is used for intercepting and replying a request of the target user.
7. The method of claim 6, prior to said generating a digital certificate in response to determining that the local digital certificate is not legitimate, the method further comprising:
and starting the proxy server in response to determining that the local digital certificate is legal.
8. The method of claim 1, wherein said comparing the test page image to a reference page image to generate a first test result comprises:
comparing the test page image with the reference page image through a preset image comparison algorithm to generate a similarity numerical value;
generating the first test result in response to determining that the similarity value is within a predetermined range.
9. The method according to one of claims 6-7, wherein the method further comprises:
in response to determining that the current service type is the first service type, starting a preset tool engine and setting a proxy port;
and in response to the fact that the preset tool engine is successfully started and the proxy port is successfully set, packaging the first target file.
10. The method according to one of claims 6-7, wherein the method further comprises:
and verifying the development environment in response to determining that the current service type is the second service type.
11. The method according to one of claims 6-7, wherein the method further comprises:
in response to determining that each first condition in a first condition group holds, sending a target request to a target server, wherein the target request is a request sent by a target terminal, and the first condition group comprises: the target address corresponding to the target request and the successful start of the proxy server are included in a white list information table.
12. The method according to one of claims 6-7, wherein the method further comprises:
in response to determining that each of a second set of conditions holds, joining the target request as a first request to a first request processing queue, wherein the second set of conditions includes: the proxy server is started successfully, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a first request type.
13. The method according to one of claims 6-7, wherein the method further comprises:
in response to determining that each third condition in a third condition group holds, joining the target request as a second request to a second request processing queue, wherein the third condition group includes: the proxy server is started successfully, the target address corresponding to the target request is not contained in a white list information table, and the type of the target request is a second request type.
14. The method of claim 12, wherein the method further comprises:
and in response to determining that a first request exists in the first request processing queue, sequentially taking out the first request from the first request processing queue, and executing a first business operation corresponding to the first request.
15. The method of claim 13, wherein the method further comprises:
and in response to determining that a second request exists in the second request processing queue, sequentially taking out the second request from the second request processing queue, and executing a second business operation corresponding to the second request.
16. The method of claim 10, wherein the method further comprises:
in response to determining that the development environment is validated, parsing a target configuration file.
17. The method of claim 16, wherein the method further comprises:
and in response to determining that the target configuration file is successfully analyzed, packaging the second target file.
18. An automated test apparatus, comprising:
a test unit configured to: according to the type of the target page, testing the target page by adopting one of the following testing devices:
injecting a first test case into the target page to generate a test page image;
comparing the test page image with a reference page image to generate a first test result; or
Injecting a second test case into the target page to generate a test page;
and checking whether each element node included in the test page is displayed normally or not to generate a second test result.
19. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-17.
20. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-17.
CN202110057307.5A 2021-01-15 2021-01-15 Automatic testing method and device, electronic equipment and computer readable medium Pending CN113760724A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110057307.5A CN113760724A (en) 2021-01-15 2021-01-15 Automatic testing method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110057307.5A CN113760724A (en) 2021-01-15 2021-01-15 Automatic testing method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN113760724A true CN113760724A (en) 2021-12-07

Family

ID=78786310

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110057307.5A Pending CN113760724A (en) 2021-01-15 2021-01-15 Automatic testing method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113760724A (en)

Similar Documents

Publication Publication Date Title
CN111045756B (en) Method, apparatus, computing device and medium for generating interface service
CN110442524B (en) Method and device for testing web service interface with authentication authorization
CN111177617A (en) Web direct operation and maintenance method and device based on operation and maintenance management system and electronic equipment
CN113938886B (en) Identity authentication platform testing method, device, equipment and storage medium
CN112597047A (en) Test method, test device, electronic equipment and computer readable medium
US10725751B2 (en) Generating a predictive data structure
CN111930709A (en) Data storage method and device, electronic equipment and computer readable medium
WO2014132145A1 (en) Web service black box testing
CN114189553B (en) Flow playback method, system and computing device
CN115102744A (en) Data access method and device
US11748238B2 (en) Model-based biased random system test through rest API
CN113360377B (en) Test method and device
CN111143650A (en) Method, device, medium and electronic equipment for acquiring page data
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
US9398041B2 (en) Identifying stored vulnerabilities in a web service
CN111767542A (en) Unauthorized detection method and device
CN107247661B (en) Method and system for supporting automatic verification of installation package of application
CN113760724A (en) Automatic testing method and device, electronic equipment and computer readable medium
CN110427745B (en) Verification code obtaining method and device, electronic equipment and computer readable medium
CN112579428B (en) Interface testing method, device, electronic equipment and storage medium
KR20180078764A (en) Method for providing validation procedure for automated test of application runnable on vehicle terminal, thereby supporting registeration of said application to market portal server, and developer portal server and application management server using the same
CN112330366A (en) Redemption code redemption request verification method, apparatus, device and computer readable medium
CN112379967A (en) Simulator detection method, device, equipment and medium
CN111371745B (en) Method and apparatus for determining SSRF vulnerability
CN111831531B (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