CN113268407A - Page testing method and device, computer storage medium and electronic equipment - Google Patents

Page testing method and device, computer storage medium and electronic equipment Download PDF

Info

Publication number
CN113268407A
CN113268407A CN202010095997.9A CN202010095997A CN113268407A CN 113268407 A CN113268407 A CN 113268407A CN 202010095997 A CN202010095997 A CN 202010095997A CN 113268407 A CN113268407 A CN 113268407A
Authority
CN
China
Prior art keywords
page
test
screenshot
standard
tested terminal
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
CN202010095997.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.)
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 CN202010095997.9A priority Critical patent/CN113268407A/en
Publication of CN113268407A publication Critical patent/CN113268407A/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/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure relates to the technical field of internet, and provides a page testing method, a page testing device, a computer storage medium and an electronic device, wherein the page testing method comprises the following steps: acquiring a standard screenshot corresponding to a preset standard display page; sending an installation package of the compiled page test script to a tested terminal so that the tested terminal runs the installation package to install the page test script; testing the display page of the tested terminal by the page test script after the installation of the secure shell protocol control to obtain a test screenshot; and if the test screenshot is consistent with the standard screenshot, determining that the page test result corresponding to the tested terminal is a test pass. The page testing method can automatically test the tested terminal, and improves the testing efficiency.

Description

Page testing method and device, computer storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a page testing method, a page testing apparatus, a computer storage medium, and an electronic device.
Background
With the development of computer and internet technologies, testing technologies have emerged. Meanwhile, as various applications are developed, the various applications need to be installed by different types of terminals and pages are displayed in the different types of terminals. As the application is upgraded, the front-end display page changes, and thus, the relevant front-end display page needs to be tested.
Currently, a relevant developer logs in each tested terminal one by one to access and view an upgrade display page of each tested terminal. Therefore, when there are many terminals to be tested, a fast and efficient test cannot be realized.
In view of this, there is a need in the art to develop a new page testing method and apparatus.
It is to be noted that the information disclosed in the background section above is only used to enhance understanding of the background of the present disclosure.
Disclosure of Invention
The present disclosure is directed to a page testing method, a page testing apparatus, a computer storage medium, and an electronic device, so as to avoid a defect of low efficiency of the existing page testing method at least to a certain extent.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a page testing method, including: acquiring a standard screenshot corresponding to a preset standard display page; sending an installation package of the compiled page test script to a tested terminal so that the tested terminal runs the installation package to install the page test script; testing the display page of the tested terminal by the page test script after the installation of the secure shell protocol control to obtain a test screenshot; and if the test screenshot is consistent with the standard screenshot, determining that the page test result corresponding to the tested terminal is a test pass.
In an exemplary embodiment of the present disclosure, the testing the display page of the terminal under test by the page test script after the secure shell protocol control installation to obtain a test screenshot includes: sending a trigger instruction to the tested terminal through the secure shell protocol so that the tested terminal starts the page test script to test a display page of the tested terminal according to the trigger instruction; after a preset time period, sending an acquisition instruction to the tested terminal through the secure shell protocol, and acquiring test information returned by the tested terminal according to the acquisition instruction; and the test information is the test screenshot obtained after the display page of the tested terminal is tested.
In an exemplary embodiment of the present disclosure, the method further comprises: comparing the test screenshot with the standard screenshot to obtain comparison similarity; and if the comparison similarity is greater than or equal to a preset threshold value, determining that the test screenshot is consistent with the standard screenshot.
In an exemplary embodiment of the present disclosure, the method further comprises: if the comparison similarity is smaller than the preset threshold, determining that the test screenshot is inconsistent with the standard screenshot; and performing differential display on the page elements on the test screenshot inconsistent with the standard screenshot.
In an exemplary embodiment of the disclosure, after determining that the test screenshot is inconsistent with the standard screenshot, the method further comprises: determining a display page corresponding to the test screenshot inconsistent with the standard screenshot as an abnormal page; and acquiring a page configuration file corresponding to the abnormal page, and repairing the page configuration file.
In an exemplary embodiment of the present disclosure, the method further comprises: positioning abnormal configuration in the page configuration file according to the page elements displayed in a differentiated mode; and repairing the abnormal configuration.
In an exemplary embodiment of the present disclosure, the sending the installation package of the written page test script to the tested terminal includes: and sending the installation package of the compiled page test script to the tested terminal based on a file transfer protocol.
According to a second aspect of the present disclosure, there is provided a page testing apparatus, comprising: the acquisition module is used for acquiring a standard screenshot corresponding to a preset standard display page; the installation module is used for sending an installation package of the compiled page test script to a tested terminal so that the tested terminal runs the installation package to install the page test script; the test module is used for testing the display page of the tested terminal through the page test script after the installation of the secure shell protocol control to obtain a test screenshot; and the result determining module is used for determining that the page test result corresponding to the tested terminal is a test pass if the test screenshot is consistent with the standard screenshot.
According to a third aspect of the present disclosure, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the page testing method of the first aspect described above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the page testing method of the first aspect via execution of the executable instructions.
As can be seen from the foregoing technical solutions, the page testing method, the page testing apparatus, the computer storage medium and the electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
in the technical solutions provided in some embodiments of the present disclosure, on one hand, the standard screenshot corresponding to the preset standard display page is obtained, and the correctness of the standard screenshot can be ensured, so as to ensure the accuracy of the subsequent test process. Furthermore, an installation package of the compiled page test script is sent to the tested terminal, so that the tested terminal runs the installation package to install the page test script, the installed page test script is controlled through a secure shell protocol to test a display page of the tested terminal, a test screenshot is obtained, each tested terminal can be directly tested by bypassing a Content Delivery Network (CDN), the technical problem of low test efficiency caused by the fact that the CDN cannot be bypassed for testing in the prior art is solved, and the test efficiency is improved. On the other hand, if the test screenshot is consistent with the standard screenshot, the page test result corresponding to the tested terminal is determined to be a test pass, and the accuracy of the test result can be improved on the premise of ensuring the correctness of the standard screenshot.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 is a flowchart illustrating a page testing method according to an exemplary embodiment of the present disclosure;
FIG. 2 shows a schematic flow chart of a page testing method in another exemplary embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating a page testing method according to yet another exemplary embodiment of the present disclosure;
FIG. 4 is a block diagram illustrating an overall flow of a page testing method in an exemplary embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of a page testing apparatus in an exemplary embodiment of the present disclosure;
FIG. 6 shows a schematic diagram of a structure of a computer storage medium in an exemplary embodiment of the disclosure;
fig. 7 shows a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
The terms "a," "an," "the," and "said" are used in this specification to denote the presence of one or more elements/components/parts/etc.; the terms "comprising" and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. other than the listed elements/components/etc.; the terms "first" and "second", etc. are used merely as labels, and are not limiting on the number of their objects.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
At present, after the version of the front-end page is changed and upgraded, the relevant developers generally log in each tested terminal one by one to access and view the upgrade display page of each tested terminal. Therefore, when there are many terminals under test, rapid automatic testing cannot be realized.
In the embodiments of the present disclosure, a page testing method is provided first, which overcomes, at least to some extent, the defect of low efficiency of the page testing method provided in the prior art.
Fig. 1 is a flowchart illustrating a page testing method according to an exemplary embodiment of the disclosure, where an execution subject of the page testing method may be a server that tests a page.
Referring to fig. 1, a page test method according to one embodiment of the present disclosure includes the steps of:
step S110, acquiring a standard screenshot corresponding to a preset standard display page;
step S120, sending the installation package of the compiled page test script to the tested terminal so that the tested terminal runs the installation package to install the page test script;
step S130, testing the display page of the tested terminal by the page test script after the installation of the secure shell protocol control to obtain a test screenshot;
and step S140, if the test screenshot is consistent with the standard screenshot, determining that the page test result corresponding to the tested terminal is a test pass.
In the technical scheme provided by the embodiment shown in fig. 1, on one hand, the standard screenshot corresponding to the preset standard display page is obtained, so that the correctness of the standard screenshot can be ensured, and the accuracy of the subsequent test process can be ensured. Furthermore, an installation package of the compiled page test script is sent to the tested terminal, so that the tested terminal runs the installation package to install the page test script, the page test script after installation is controlled through a secure shell protocol to test a display page of the tested terminal, a test screenshot is obtained, the CDN can be bypassed to directly test each tested terminal, the technical problem that in the prior art, the testing efficiency is low due to the fact that the CDN cannot be bypassed to test is solved, and the testing efficiency is improved. On the other hand, if the test screenshot is consistent with the standard screenshot, the page test result corresponding to the tested terminal is determined to be a test pass, and the accuracy of the test result can be guaranteed on the premise that the correctness of the standard screenshot is guaranteed.
The following describes the specific implementation of each step in fig. 1 in detail:
in step S110, a standard screenshot corresponding to a preset standard display page is obtained.
In an exemplary embodiment of the present disclosure, a standard display page may be preset, and then, a standard screenshot corresponding to the standard display page is obtained. The standard display page may be a display page in which each access data index is normal and the display style is consistent with the style after updating.
For example, after the standard display page is set, a screenshot may be performed on the standard display page to obtain a standard screenshot. Therefore, the correctness of the standard screenshot can be ensured, and the accuracy of the subsequent test process is ensured.
In step S120, the installation package of the programmed page test script is sent to the terminal under test, so that the terminal under test runs the installation package installation page test script.
In an exemplary embodiment of the disclosure, a page test script may be written, and an installation package of the page test script is sent to a terminal to be tested, so that the terminal to be tested runs the installation package to install the page test script.
The page test script can be a program code which is written in advance and can carry out automatic test on the display page of each tested terminal. After the program script is written, the program script can be packaged into PhantomJS by python (the JavaScript API based on webkit uses QtWebkit as the function of a core browser, and uses webkit to compile, interpret and execute JavaScript codes). The page test script has the function of simulating a browser to bypass the CDN to directly access the server address of the tested terminal and generate a test screenshot.
The installation package of the page test script may include a main test script and script configuration information (e.g., an access port address of the terminal under test, a screen capture size, a screen capture, a storage path of a script generation file, etc.). Therefore, for different tested terminals, the main test scripts in the installation package are the same, but the access port address, the screenshot size, the screenshot and the specific storage path of the script generation file can be set according to the actual situation of the tested terminal, namely, different tested terminals correspond to different script configuration information.
The tested terminal can be a server node which needs to test the page display condition in the server cluster. For example, an IP Address (Internet Protocol Address, IP Address for short) of each terminal to be tested may be obtained, and the page test script may be sent to the terminal to be tested corresponding to each IP Address in batch based on a File Transfer Protocol (FTP).
In step S130, the page test script after installation is controlled by the secure shell protocol to test the display page of the terminal under test, so as to obtain a test screenshot.
In the exemplary embodiment of the disclosure, after the tested terminal runs the installation package installation page test script, the installed page test script can be remotely logged in through the secure shell protocol to test the display page of the tested terminal, so as to obtain the test screenshot. Therefore, the CDN can be bypassed to directly test each tested terminal, the technical problem that the testing efficiency is low due to the fact that the CDN cannot be bypassed to test in the prior art is solved, and the testing efficiency is improved.
Specifically, referring to fig. 2, fig. 2 shows a flowchart of a page testing method in another exemplary embodiment of the present disclosure, and specifically shows a flowchart of testing a displayed page of a terminal under test by using a page testing script after installation of secure shell protocol control to obtain a test screenshot, which includes steps S201 to S202, and step S130 is explained below with reference to fig. 2.
In step S201, a trigger instruction is sent to the terminal under test through the secure shell protocol, so that the terminal under test starts a page test script according to the trigger instruction to test a display page of the terminal under test.
In the exemplary embodiment of the disclosure, a trigger instruction may be sent to each terminal to be tested through a secure shell protocol, so that the terminal to be tested starts a page test script according to the trigger instruction, a display page of the terminal to be tested is tested, and a test screenshot of each terminal to be tested is obtained. Therefore, the simple and quick simultaneous test on the plurality of tested terminals can be realized, the technical problem of low efficiency caused by single check of each tested terminal in manual login in the prior art is avoided, and the test efficiency is improved.
The Secure Shell Protocol (SSH) is a Protocol for Secure telnet and other Secure network services over an insecure network. It not only provides support for secure telnet, secure file transfer, and secure system traffic forwarding, but it also automatically encrypts, authenticates, and compresses the transferred data, provides robust security, prevents cryptanalysis and protocol attacks, can work very well without global key management or certificate infrastructure, and can use existing certificate infrastructure. Thus, it is possible to provide a secure communication by encrypting information and authenticating information.
In step S202, after a preset time period, sending an acquisition instruction to the terminal to be tested through a secure shell protocol, and acquiring test information returned by the terminal to be tested according to the acquisition instruction; the test information is a test screenshot obtained after a display page of the tested terminal is tested.
In the exemplary embodiment of the disclosure, after a trigger instruction is sent to a terminal to be tested so that the terminal to be tested starts a page test script, after a preset time period (for example, 5 seconds, which may be set by itself according to an actual situation) is set, an obtaining instruction may be sent to the terminal to be tested through a secure shell protocol, and test information (that is, a test screenshot obtained after a display page of each terminal to be tested is tested) returned by the terminal to be tested according to the obtaining instruction is obtained.
Continuing to refer to fig. 1, in step S140, if the test screenshot is consistent with the standard screenshot, it is determined that the page test result corresponding to the tested terminal is a test pass.
In the exemplary embodiment of the disclosure, after obtaining the test screenshots corresponding to each tested terminal, for example, the test screenshots and the labeled screenshots may be input into an OpenCV (Open Source Computer Vision Library, abbreviated as OpenCV, which is a cross-platform Computer Vision Library issued based on BSD license (Open Source), and may be run on Linux, Windows, Android, and Mac OS operating systems. Illustratively, when there are 3 terminals under test (terminals under test A, B, C), then 3 alignment similarities can be obtained, for example: 95% (corresponding to terminal a under test), 96% (corresponding to terminal B under test), 65% (corresponding to terminal C under test).
If the comparison similarity is greater than or equal to the preset threshold, it may be determined that the test screenshot is consistent with the standard screenshot, and for example, referring to the relevant explanations of the above steps, when the preset threshold is 95%, it may be determined that the test screenshot of the terminal a to be tested is consistent with the standard screenshot, and the test screenshot of the terminal B to be tested is consistent with the standard screenshot. Furthermore, the page test results corresponding to the tested terminal a and the tested terminal B can be determined to be passed.
If the comparison similarity is smaller than the preset threshold, it may be determined that the test screenshot is inconsistent with the standard screenshot, and for example, referring to the relevant explanation of the above step, when the preset threshold is 95%, it may be determined that the test screenshot of the terminal C to be tested is inconsistent with the standard screenshot. Furthermore, it can be determined that the page test result corresponding to the tested terminal C is a test failure. In the exemplary embodiment of the disclosure, when it is determined that the test screenshot of the terminal C under test is inconsistent with the standard screenshot, the page elements inconsistent therebetween may be displayed in a differentiated manner (for example, the page elements inconsistent in display may be marked by a marked-up mark box). Therefore, the inconsistent page elements are not required to be searched for by manual browsing and comparison, so that the inconsistent page elements are more prominent, the information acquisition efficiency of related developers is improved, and the related developers can quickly position the page elements to modify the related configuration project.
In the exemplary embodiment of the present disclosure, when it is determined that the test screenshot of the terminal C to be tested is inconsistent with the standard screenshot, refer to fig. 3, where fig. 3 shows a schematic flow diagram of a page test method in another exemplary embodiment of the present disclosure, and specifically shows a schematic flow diagram of performing a repair process on a page configuration file of the test screenshot inconsistent with the annotation screenshot, including steps S301 to S302, and the following explains a specific implementation manner with reference to fig. 3.
In step S301, a display page corresponding to the test screenshot in which the standard screenshot is inconsistent is determined as an abnormal page.
In an exemplary embodiment of the present disclosure, a display page corresponding to a test screenshot inconsistent with the annotation screenshot may be determined as an exception page.
In step S302, a page configuration file corresponding to the abnormal page is obtained, and the page configuration file is repaired.
In the exemplary embodiment of the present disclosure, after the abnormal page is determined, the page configuration file corresponding to the abnormal page may be obtained, and the page configuration file is repaired. Specifically, according to the page elements displayed in the differentiation manner, the abnormal configuration in the page configuration file can be positioned, and the abnormal configuration can be repaired. For example, when the page displayed in the differencing mode is the "page icon", the relevant developers can directly position the configuration program corresponding to the "page icon", so that the page configuration file can be repaired more specifically, and the file repairing efficiency is improved.
In an exemplary embodiment of the present disclosure, for example, fig. 4 shows an overall flowchart of a page testing method in an exemplary embodiment of the present disclosure, which includes steps S401 to S406, and a specific implementation is explained below with reference to fig. 4.
In step S401, start;
in step S402, the test script maintenance module obtains a compiled page test script;
in step S403, the test script sending module combines the compiled main test script and the script configuration information for different tested terminals, and sends the combined main test script and script configuration information to the specified tested terminal;
in step S404, the test script execution module runs the test script based on the secure shell protocol, generates a test screenshot corresponding to the display page of each test terminal, and stores the test screenshot in an assigned path;
in step S405, the test script screenshot comparing module compares the test screenshot with a pre-obtained standard screenshot to obtain a comparison result; storing the comparison result into a database for a test result maintenance module to use;
in step S406, the process ends.
The present disclosure also provides a page testing apparatus, and fig. 5 shows a schematic structural diagram of the page testing apparatus in an exemplary embodiment of the present disclosure; as shown in fig. 5, the page testing apparatus 500 may include an acquisition module 501, an installation module 502, a testing module 503, and a result determination module 504. Wherein:
an obtaining module 501, configured to obtain a standard screenshot corresponding to a preset standard display page.
In an exemplary embodiment of the disclosure, the obtaining module is configured to obtain a standard screenshot corresponding to a preset standard display page.
The installing module 502 is configured to send an installation package of the compiled page test script to the terminal to be tested, so that the terminal to be tested runs the installation package to install the page test script.
In an exemplary embodiment of the disclosure, the installation module is configured to send an installation package of the written page test script to the terminal under test based on a file transfer protocol, so that the terminal under test runs the installation package and installs the page test script.
The testing module 503 is configured to test the display page of the terminal under test through the page testing script after the secure shell protocol control installation, so as to obtain a test screenshot.
In an exemplary embodiment of the disclosure, the test module is configured to send a trigger instruction to the terminal under test through a secure shell protocol, so that the terminal under test starts a page test script according to the trigger instruction to test a display page of the terminal under test; after a preset time period, sending an acquisition instruction to the tested terminal through a secure shell protocol, and acquiring test information returned by the tested terminal according to the acquisition instruction; the test information is a test screenshot obtained after a display page of the tested terminal is tested.
And a result determining module 504, configured to determine that the page test result corresponding to the terminal to be tested passes the test if the test screenshot is consistent with the standard screenshot.
In an exemplary embodiment of the disclosure, the result determining module is configured to compare the test screenshot with the standard screenshot to obtain a comparison similarity; and if the comparison similarity is greater than or equal to a preset threshold value, determining that the test screenshot is consistent with the standard screenshot.
In an exemplary embodiment of the present disclosure, the result determining module is configured to determine that the test screenshot is inconsistent with the standard screenshot if the comparison similarity is smaller than a preset threshold; and carrying out differential display on the page elements on the test screenshots inconsistent with the standard screenshots.
In an exemplary embodiment of the present disclosure, the result determining module is configured to determine a display page corresponding to a test screenshot inconsistent with the standard screenshot as an abnormal page; and acquiring a page configuration file corresponding to the abnormal page, and repairing the page configuration file.
In an exemplary embodiment of the present disclosure, the result determination module is configured to locate an abnormal configuration in the page configuration file according to the page elements that are displayed in a differentiated manner; and repairing the abnormal configuration.
The specific details of each module in the page testing apparatus have been described in detail in the corresponding page testing method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer storage medium capable of implementing the above method. On which a program product capable of implementing the above-described method of the present specification is stored. In some possible embodiments, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the disclosure described in the "exemplary methods" section above of this specification, when the program product is run on the terminal device.
Referring to fig. 6, a program product 600 for implementing the above method according to an embodiment of the present disclosure is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a 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.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
A computer readable signal medium may include a propagated data signal with 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 readable signal medium may also be any readable medium that is not a 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 readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like 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 computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 700 according to this embodiment of the disclosure is described below with reference to fig. 7. The electronic device 700 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 is embodied in the form of a general purpose computing device. The components of the electronic device 700 may include, but are not limited to: the at least one processing unit 710, the at least one memory unit 720, a bus 730 connecting different system components (including the memory unit 720 and the processing unit 710), and a display unit 740.
Wherein the storage unit stores program code that is executable by the processing unit 710 to cause the processing unit 710 to perform steps according to various exemplary embodiments of the present disclosure as described in the above section "exemplary methods" of this specification. For example, the processing unit 710 may perform the following as shown in fig. 1: step S110, acquiring a standard screenshot corresponding to a preset standard display page; step S120, sending an installation package of the compiled page test script to a tested terminal so that the tested terminal runs the installation package to install the page test script; step S130, testing the display page of the tested terminal by the page test script after the installation of the secure shell protocol control to obtain a test screenshot; and step S140, if the test screenshot is consistent with the standard screenshot, determining that the page test result corresponding to the tested terminal is a test pass.
The storage unit 720 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)7201 and/or a cache memory unit 7202, and may further include a read only memory unit (ROM) 7203.
The storage unit 720 may also include a program/utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 730 may be any representation of one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 700, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 700 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 750. Also, the electronic device 700 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 760. As shown, the network adapter 760 communicates with the other modules of the electronic device 700 via the bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A page testing method is characterized by comprising the following steps:
acquiring a standard screenshot corresponding to a preset standard display page;
sending an installation package of the compiled page test script to a tested terminal so that the tested terminal runs the installation package to install the page test script;
testing the display page of the tested terminal by the page test script after the installation of the secure shell protocol control to obtain a test screenshot;
and if the test screenshot is consistent with the standard screenshot, determining that the page test result corresponding to the tested terminal is a test pass.
2. The method of claim 1, wherein the testing the display page of the terminal under test by the page test script after the secure shell protocol control installation to obtain a test screenshot comprises:
sending a trigger instruction to the tested terminal through the secure shell protocol so that the tested terminal starts the page test script to test a display page of the tested terminal according to the trigger instruction;
after a preset time period, sending an acquisition instruction to the tested terminal through the secure shell protocol, and acquiring test information returned by the tested terminal according to the acquisition instruction;
and the test information is the test screenshot obtained after the display page of the tested terminal is tested.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
comparing the test screenshot with the standard screenshot to obtain comparison similarity;
and if the comparison similarity is greater than or equal to a preset threshold value, determining that the test screenshot is consistent with the standard screenshot.
4. The method of claim 3, further comprising:
if the comparison similarity is smaller than the preset threshold, determining that the test screenshot is inconsistent with the standard screenshot;
and performing differential display on the page elements on the test screenshot inconsistent with the standard screenshot.
5. The method of claim 4, wherein after determining that the test screenshot is inconsistent with the standard screenshot, the method further comprises:
determining a display page corresponding to the test screenshot inconsistent with the standard screenshot as an abnormal page;
and acquiring a page configuration file corresponding to the abnormal page, and repairing the page configuration file.
6. The method of claim 4, further comprising:
positioning abnormal configuration in the page configuration file according to the page elements displayed in a differentiated mode;
and repairing the abnormal configuration.
7. The method according to claim 1, wherein the sending the installation package of the written page test script to the tested terminal comprises:
and sending the installation package of the compiled page test script to the tested terminal based on a file transfer protocol.
8. A page testing apparatus, comprising:
the acquisition module is used for acquiring a standard screenshot corresponding to a preset standard display page;
the installation module is used for sending an installation package of the compiled page test script to a tested terminal so that the tested terminal runs the installation package to install the page test script;
the test module is used for testing the display page of the tested terminal through the page test script after the installation of the secure shell protocol control to obtain a test screenshot;
and the result determining module is used for determining that the page test result corresponding to the tested terminal is a test pass if the test screenshot is consistent with the standard screenshot.
9. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the page testing method of any of claims 1-7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the page testing method of any of claims 1-7 via execution of the executable instructions.
CN202010095997.9A 2020-02-17 2020-02-17 Page testing method and device, computer storage medium and electronic equipment Pending CN113268407A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010095997.9A CN113268407A (en) 2020-02-17 2020-02-17 Page testing method and device, computer storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010095997.9A CN113268407A (en) 2020-02-17 2020-02-17 Page testing method and device, computer storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113268407A true CN113268407A (en) 2021-08-17

Family

ID=77227609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010095997.9A Pending CN113268407A (en) 2020-02-17 2020-02-17 Page testing method and device, computer storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113268407A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130004087A1 (en) * 2011-06-30 2013-01-03 American Express Travel Related Services Company, Inc. Method and system for webpage regression testing
CN104424098A (en) * 2013-08-28 2015-03-18 腾讯科技(深圳)有限公司 Application test method and application testing device
CN104536900A (en) * 2015-01-21 2015-04-22 小米科技有限责任公司 Method and device for controlling mobile terminal
CN104536888A (en) * 2014-12-24 2015-04-22 网易(杭州)网络有限公司 Game testing method and system for mobile devices
WO2017005148A1 (en) * 2015-07-03 2017-01-12 上海触乐信息科技有限公司 Automatic software-testing method and device
CN106411633A (en) * 2016-08-23 2017-02-15 国家电网公司 Web application compatibility testing method based on openstack and system thereof
US9934129B1 (en) * 2017-03-17 2018-04-03 Google Llc Determining application test results using screenshot metadata
CN108920380A (en) * 2018-07-20 2018-11-30 百度在线网络技术(北京)有限公司 Test method, device, server, equipment and the storage medium of the software compatibility
CN109189686A (en) * 2018-08-30 2019-01-11 中国平安人寿保险股份有限公司 Automation regression testing method, apparatus, storage medium and computer equipment
CN109471805A (en) * 2018-11-14 2019-03-15 网易(杭州)网络有限公司 Resource testing method and device, storage medium, electronic equipment
CN109947637A (en) * 2017-12-21 2019-06-28 中国移动通信集团重庆有限公司 Webpage compatibility automated test method, device, equipment and medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130004087A1 (en) * 2011-06-30 2013-01-03 American Express Travel Related Services Company, Inc. Method and system for webpage regression testing
CN104424098A (en) * 2013-08-28 2015-03-18 腾讯科技(深圳)有限公司 Application test method and application testing device
CN104536888A (en) * 2014-12-24 2015-04-22 网易(杭州)网络有限公司 Game testing method and system for mobile devices
CN104536900A (en) * 2015-01-21 2015-04-22 小米科技有限责任公司 Method and device for controlling mobile terminal
WO2017005148A1 (en) * 2015-07-03 2017-01-12 上海触乐信息科技有限公司 Automatic software-testing method and device
CN106411633A (en) * 2016-08-23 2017-02-15 国家电网公司 Web application compatibility testing method based on openstack and system thereof
US9934129B1 (en) * 2017-03-17 2018-04-03 Google Llc Determining application test results using screenshot metadata
CN109947637A (en) * 2017-12-21 2019-06-28 中国移动通信集团重庆有限公司 Webpage compatibility automated test method, device, equipment and medium
CN108920380A (en) * 2018-07-20 2018-11-30 百度在线网络技术(北京)有限公司 Test method, device, server, equipment and the storage medium of the software compatibility
CN109189686A (en) * 2018-08-30 2019-01-11 中国平安人寿保险股份有限公司 Automation regression testing method, apparatus, storage medium and computer equipment
CN109471805A (en) * 2018-11-14 2019-03-15 网易(杭州)网络有限公司 Resource testing method and device, storage medium, electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李佳欣;潘伟;: "PhantomJS在Web自动化测试中的应用", 计算机光盘软件与应用, no. 18, 15 September 2013 (2013-09-15), pages 83 - 84 *

Similar Documents

Publication Publication Date Title
US11151018B2 (en) Method and apparatus for testing a code file
CN105159833A (en) Automatic testing device and method
CN109388569B (en) Method for remotely detecting environmental anomaly of client, test server and storage medium
US20170052877A1 (en) Generic test automation for graphical user interface (gui) applications
US10216617B2 (en) Automatically complete a specific software task using hidden tags
CN110633219B (en) Page test method and device, storage medium and electronic equipment
CN107404418B (en) Internet product testing method, device, equipment and storage medium
CN113014445B (en) Operation and maintenance method, device and platform for server and electronic equipment
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN112540924A (en) Interface automation test method, device, equipment and storage medium
CN111241111B (en) Data query method and device, data comparison method and device, medium and equipment
CN112817853A (en) Automatic test method, system and electronic equipment
CN112363938A (en) Data processing method and device, electronic equipment and storage medium
CN114969760A (en) Vulnerability detection method and device, computer readable medium and electronic equipment
CN112506772B (en) Web automatic test method, device, electronic equipment and storage medium
CN111488275B (en) UI (user interface) automatic testing method and device, storage medium and electronic equipment
CN112988578A (en) Automatic testing method and device
CN115454856A (en) Multi-application security detection method, device, medium and electronic equipment
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
CN113268407A (en) Page testing method and device, computer storage medium and electronic equipment
CN110795338B (en) Front-end and back-end interaction-based automatic testing method and device and electronic equipment
CN113656301A (en) Interface testing method, device, equipment and storage medium
CN111857664B (en) Application development method, device, equipment and storage medium
US20240152356A1 (en) Automated developer configuration tool
CN115437938A (en) Test script configuration method, test device and related equipment

Legal Events

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