CN110543405A - Log display method and device, storage medium and computer equipment - Google Patents

Log display method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN110543405A
CN110543405A CN201910754652.7A CN201910754652A CN110543405A CN 110543405 A CN110543405 A CN 110543405A CN 201910754652 A CN201910754652 A CN 201910754652A CN 110543405 A CN110543405 A CN 110543405A
Authority
CN
China
Prior art keywords
log
information
test
configuration information
request information
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
CN201910754652.7A
Other languages
Chinese (zh)
Inventor
胡鹏强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201910754652.7A priority Critical patent/CN110543405A/en
Publication of CN110543405A publication Critical patent/CN110543405A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The invention provides a log display method, which comprises the following steps: adding page label configuration information of a test log in a test script; the page tag configuration information is used for configuring request information in a test log and displaying the request information according to a block-level structure; running the test script to generate a log file corresponding to the test script; reading the log file and analyzing the page tag configuration information, and rendering the content of the read log file according to the analyzed page tag configuration information to obtain a test log which shows the request information according to a block-level structure. The method can simply and quickly increase the hierarchy of the test log, so that the test log is more attractive, effective information is convenient to view and distinguish, the energy consumed by a tester due to the removal of too much and complicated information is avoided, and powerful technical support is provided for improving the efficiency of positioning the test problem.

Description

log display method and device, storage medium and computer equipment
Technical Field
The invention relates to the technical field of computers, in particular to a log display method, a log display device, a computer readable storage medium and computer equipment.
background
In the automatic test process, a test tool can generate a large number of test logs, and testers can analyze the test logs to realize the analysis and positioning of the error reasons of the test cases. At present, a test log generated by an automatic test is usually a log of a plain text, and has the limitations of being not beautiful enough and weak in hierarchy, and the efficiency of positioning test problems is influenced because a tester does not clearly and conveniently check the log content and quickly distinguish effective information.
Disclosure of Invention
In order to solve at least one of the above technical defects, the present invention provides a log display method, a corresponding apparatus, a computer-readable storage medium, and a computer device according to the following technical solutions.
according to an aspect, an embodiment of the present invention provides a log displaying method, including the following steps:
Adding page label configuration information of a test log in a test script; the page tag configuration information is used for configuring request information in a test log and displaying the request information according to a block-level structure;
Running the test script to generate a log file corresponding to the test script;
reading the log file and analyzing the page tag configuration information, and rendering the content of the read log file according to the analyzed page tag configuration information to obtain a test log which shows the request information according to a block-level structure.
in one embodiment, the running the test script and generating a log file corresponding to the test script includes:
running the test script based on a Jmeter test tool to obtain log data corresponding to the test script;
And writing the log data into a log file to generate a log file.
in one embodiment, the page tag configuration information includes: tag element configuration information and style configuration information.
In one embodiment, the page tag configuration information is used for configuring the request information in the test log to be displayed in a block-level structure, and includes:
the tag element configuration information and the style configuration information are used for configuring summary information of request information in a test log and displaying the summary information according to a block-level structure, and detailed information of the request information is hidden by default;
The obtaining of the test log showing the request information according to the block-level structure includes:
And obtaining a test log which shows the summary information of the request information according to a block-level structure and hides the detailed information of the request information by default.
In one embodiment, after obtaining a test log in which summary information of the request information is shown in a block-level structure and detailed information of the request information is hidden by default, the method further includes:
Receiving a display instruction triggered by one request message, wherein the display instruction is used for indicating the detailed information of the request message to be displayed;
And responding to the display instruction, and displaying the detailed information of the request information.
in one embodiment, the presenting, in response to the presentation instruction, details of the requested information includes:
Responding to the display instruction, and judging whether the detailed information of the request information is successfully acquired;
If so, displaying the summary information of the request information in a first color, and displaying the detailed information below the summary information;
And if not, displaying the summary information of the request information in a second color.
in one embodiment, the reading the log file and analyzing the page tag configuration information, and rendering the content of the read log file according to the analyzed page tag configuration information to obtain the test log in which the request information is displayed according to a block-level structure includes:
reading the log file based on a browser and analyzing the page tag configuration information;
extracting page tag configuration information corresponding to preset configuration characteristics of the browser from the analyzed page tag configuration information;
Popping up a new window of the browser;
rendering the content of the read log file according to page tag configuration information corresponding to preset configuration characteristics of the browser, and obtaining a test log displayed by the request information according to a block-level structure in the new window.
Further, according to another aspect, an embodiment of the present invention provides a log presentation apparatus, including:
the configuration module is used for adding page label configuration information of the test log in the test script; the page tag configuration information is used for configuring request information in a test log and displaying the request information according to a block-level structure;
the log file acquisition module is used for running the test script and generating a log file corresponding to the test script;
and the log display module is used for reading the log file, analyzing the page tag configuration information, rendering the content of the read log file according to the analyzed page tag configuration information, and obtaining the test log displayed by the request information according to the block-level structure.
According to yet another aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the log presentation method described above.
according to yet another aspect, embodiments of the present invention provide a computer device, the computer comprising one or more processors; a memory; one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more computer programs configured to: the log display method is executed.
Compared with the prior art, the invention has the following beneficial effects:
According to the log display method, the log display device, the computer readable storage medium and the computer equipment, the page label configuration information used for configuring the request information in the test log and displayed according to the block-level structure is set, the content of the log file obtained by running the script is rendered according to the analyzed page label configuration information, and the test log displayed according to the block-level structure of the request information is obtained.
in addition, the label element configuration information and the style configuration information are used for configuring the abstract information of the request information in the test log and are displayed according to the block-level structure, and the detailed information of the request information is hidden by default, so that the detailed information of each request information in the rendered test log is hidden, the abstract information of each request information is simply and beautifully displayed, and the test log can be further more concise and attractive.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of a method of a log displaying method according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating an effect of displaying request information in a test log according to a block-level structure according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a log display apparatus according to an embodiment of the present invention;
Fig. 4 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
as used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
it will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
an embodiment of the present invention provides a log display method, as shown in fig. 1, the method includes:
step S110: adding page label configuration information of a test log in a test script; and the page tag configuration information is used for configuring request information in the test log and displaying the request information according to a block-level structure.
For the embodiment, the test script includes a code for generating a plain text log, and when the test script including the code for generating the plain text log is run by a test tool, the test script can generate the plain text log in real time.
for the embodiment, on the basis of a code for generating a plain text log, adding page tag configuration information of the test log in the test script, where the page tag configuration information is used to configure a display format of the test log in a page, and specifically, the page tag configuration information is used to configure request information in the test log to be displayed according to a block-level structure, where the request information is displayed according to the block-level structure, specifically, related information corresponding to each request in the test log is displayed in blocks, so as to enhance the hierarchy of the test log, make the test log more beautiful, and facilitate viewing.
Step S120: and running the test script to generate a log file corresponding to the test script.
for the embodiment, in the automatic test process, the test script is run through the test tool, and the log file corresponding to the test script can be automatically generated in real time.
Step S130: reading the log file and analyzing the page tag configuration information, and rendering the content of the read log file according to the analyzed page tag configuration information to obtain a test log which shows the request information according to a block-level structure.
For this embodiment, the rendering presentation of the test log may be implemented based on a browser, specifically, when the log file is opened by the browser for viewing, the browser reads the log file in real time and analyzes the page tag configuration information, where the page tag configuration information is used to configure the request information in the test log to be presented in a block-level structure, and then the browser automatically pops up a new window, renders the content of the read log file to be presented in the page of the new window according to the analyzed page tag configuration information, so as to obtain the test log in which the request information is presented in the block-level structure.
fig. 2 is a schematic diagram illustrating an effect of the request information in the test log according to the block-level structure according to an embodiment. In this embodiment, the test log includes four request messages, specifically, a first request message, a second request message, a third request message, and a fourth request message, and after rendering according to the parsed page tag configuration information, the relevant information corresponding to each request in the test log is displayed in blocks, so that the hierarchy of the test log is enhanced, and the test log is convenient for a tester to check.
according to the log display method provided by the invention, the page label configuration information used for configuring the request information in the test log and displayed according to the block-level structure is set, the content of the log file obtained by running the script is rendered according to the analyzed page label configuration information, and the test log displayed according to the block-level structure of the request information is obtained.
In one embodiment, the running the test script and generating a log file corresponding to the test script includes:
running the test script based on a Jmeter test tool to obtain log data corresponding to the test script;
and writing the log data into a log file to generate a log file.
For this embodiment, the test script is specifically a meter test script, the meter test script includes a code for generating a plain text log, and in addition, the meter test script is further added with page tag configuration information of the test log, where the page tag configuration information is used to configure request information in the test log and is displayed according to a block-level structure.
For this embodiment, the Jmeter test script includes a code for generating a plain text log, specifically: adding a post processor BeanShellPostProcessor at the end of the jmeter script, defining a writeToLog method in the processor, using a built-in object prev of the jmeter to acquire thread information, such as acquiring a thread group name based on getThreadName, acquiring a request name based on getSampleLabel, acquiring request data based on getSamplerData, acquiring a response code based on getResponseCode, acquiring response data based on getResponseDataAsString, and finally calling the writeToLog method at the end of BeanShell.
for this embodiment, adding the page tag configuration information of the test log to the meter test script specifically includes: the acquired thread information is concatenated and integrated and stored in a variable, such as a variable logInfo; in addition, several variables are defined, which hold some label information, such as < div class ═ panel panel-success ' > < div class ═ panel-heading ' data-toggle ═ panel ' href # panel body >, < div id ═ panel-panel panel-panel ' > < div class ═ panel-body ' > and so on, and these variables holding label information are combined with logInfo variable to form the complete web page content.
for the embodiment, when the Jmeter test script is run based on a Jmeter test tool, log data corresponding to the Jmeter test script can be obtained, and the real-time log data is written into a log file to generate a log file.
In one embodiment, the page tag configuration information includes: tag element configuration information and style configuration information.
for this embodiment, the page tag configuration information of the test log is added to the test script as tag element configuration information and style configuration information, and specifically, page tag elements such as div and label and a custom style are added to the test script.
In one embodiment, the page tag configuration information is used for configuring the request information in the test log to be displayed in a block-level structure, and includes:
The tag element configuration information and the style configuration information are used for configuring summary information of request information in a test log and displaying the summary information according to a block-level structure, and detailed information of the request information is hidden by default;
The obtaining of the test log showing the request information according to the block-level structure includes:
and obtaining a test log which shows the summary information of the request information according to a block-level structure and hides the detailed information of the request information by default.
for this embodiment, each request message in the test log usually contains more contents, and in order to further improve the hierarchy of the test log, only the summary message of the request message may be displayed when the request message is displayed at a block level, and the detailed message of the request message is hidden by default.
with the present embodiment, the content of the request information is divided into summary information and detailed information in advance, for example, the name of the request information may be used as the summary information of the request information, and the rest of the content may be used as the detailed information of the detailed information.
for the embodiment, on the basis of a code for generating a plain text log, adding tag element configuration information and style configuration information in the test log in the test script, where the tag element configuration information and the style configuration information are used to configure summary information of request information in the test log to be displayed in a block-level structure and detailed information of the request information is hidden by default, for example, adding page tag elements such as div and label and customized styles capable of hiding the detailed information by default, so that after contents of a read log file are rendered according to parsed tag element configuration information and style configuration information, a test log in which the summary information of the request information is displayed in a block-level structure and detailed information of the request information is hidden by default can be obtained, that is, after rendering, each requested detailed information is hidden by default, only summary information of each request message is shown.
in this embodiment, the tag element configuration information and the style configuration information are used for configuring summary information of request information in a test log, and the detailed information of the request information is hidden by default, so that the detailed information of each request information in the test log displayed after rendering is hidden, and the summary information of each request information is only briefly and beautifully displayed, so that the test log can be further concise and attractive, a tester can conveniently check and distinguish effective information, the tester is prevented from expending energy due to the removal of too much and complicated information, and a powerful technical support is provided for improving the efficiency of test problem positioning.
In one embodiment, after obtaining a test log in which summary information of the request information is shown in a block-level structure and detailed information of the request information is hidden by default, the method further includes:
receiving a display instruction triggered by one request message, wherein the display instruction is used for indicating the detailed information of the request message to be displayed;
And responding to the display instruction, and displaying the detailed information of the request information.
for this embodiment, when the summary information of the request information in the test log is displayed in a block-level structure and the detailed information of the request information is hidden by default, a tester can further display the detailed information of the request information by clicking the summary information of some request information. Accordingly, the tag element configuration information and the style configuration information are also used to configure detailed information of the request information in the test log to be presented in response to the presentation instruction. When the browser receives a display instruction triggered by a request message, wherein the display instruction is used for indicating the display of the detailed information of the request message, the browser immediately responds to the display instruction and displays the detailed information of the request message in the test log.
in one embodiment, the presenting, in response to the presentation instruction, details of the requested information includes:
responding to the display instruction, and judging whether the detailed information of the request information is successfully acquired;
If so, displaying the summary information of the request information in a first color, and displaying the detailed information below the summary information;
And if not, displaying the summary information of the request information in a second color.
In an actual application scenario, when the detailed information of the request information cannot be successfully acquired, the detailed information of the request information cannot be displayed. Therefore, the label element configuration information and the style configuration information are used for configuring the corresponding display format of the test log when the detailed information is successfully displayed and the corresponding display format of the test log when the detailed information cannot be displayed in advance, so that the test log can respectively correspond to different display formats when the detailed information is successfully displayed and cannot be successfully displayed, a tester can conveniently and quickly identify whether the detailed information of the request information is successfully displayed, and powerful technical support is provided for improving the efficiency of positioning test problems.
for this embodiment, the display format is specifically a display color, and specifically, the tag element configuration information and the style configuration information are used to configure: and when the detailed information in the test log is successfully displayed, the summary information of the request information is displayed in a first color, and when the detailed information cannot be displayed, the summary information of the request information is displayed in a second color.
the first color is different from the second color, for example, the first color may be green, the second color may be red, and the first color and the second color may also be other different color values.
correspondingly, in the rendered test log, if the browser can successfully acquire the detailed information of the request information, the summary information of the request information is displayed in a first color, the detailed information is displayed below the summary information, and if the browser cannot acquire the detailed information of the request information, the summary information of the request information is displayed in a second color.
in one embodiment, the reading the log file and analyzing the page tag configuration information, and rendering the content of the read log file according to the analyzed page tag configuration information to obtain the test log in which the request information is displayed according to a block-level structure includes:
reading the log file based on a browser and analyzing the page tag configuration information;
extracting page tag configuration information corresponding to preset configuration characteristics of the browser from the analyzed page tag configuration information;
popping up a new window of the browser;
Rendering the content of the read log file according to page tag configuration information corresponding to preset configuration characteristics of the browser, and obtaining a test log displayed by the request information according to a block-level structure in the new window.
For this embodiment, the page tag configuration information includes preset configuration characteristics of different browsers, where the preset configuration characteristics are configuration characteristics preset by each browser for a page display format.
for this embodiment, a rendering display of a test log is realized based on a browser, specifically, when the log file is opened by the browser for viewing, the browser reads the log file in real time and analyzes the page tag configuration information, where the page tag configuration information is used to configure request information in the test log to be displayed according to a block-level structure, and the page tag configuration information includes preset configuration characteristics of different browsers; further determining which browser the current browser is, and extracting page tag configuration information corresponding to preset configuration characteristics of the browser from the analyzed page tag configuration information; and then automatically popping up a new window by the browser, rendering the read content of the log file according to the page label configuration information corresponding to the preset configuration characteristics of the browser, and obtaining the test log displayed by the request information according to a block-level structure in the new window.
For example, the browser a is provided with a preset configuration characteristic for a font type displayed on a page, the font adapted to the browser is a song style, and the font type in the test log rendered by the browser is adapted to the song style.
For another example, the browser B sets a preset configuration characteristic for a background image color of the page display, and if the background image color adapted to the browser is light gray, the background image color in the test log displayed after rendering by the browser is adapted to be light gray.
In addition, an embodiment of the present invention provides a log display apparatus, as shown in fig. 3, the apparatus includes: a configuration module 31, a log file acquisition module 32 and a log display module 33; wherein the content of the first and second substances,
The configuration module 31 is configured to add page tag configuration information of the test log in the test script; the page tag configuration information is used for configuring request information in a test log and displaying the request information according to a block-level structure;
The log file obtaining module 32 is configured to run the test script and generate a log file corresponding to the test script;
The log display module 33 is configured to read the log file, analyze the page tag configuration information, render the content of the read log file according to the analyzed page tag configuration information, and obtain a test log in which the request information is displayed according to a block-level structure.
in an embodiment, the log file obtaining module 32 is specifically configured to:
running the test script based on a Jmeter test tool to obtain log data corresponding to the test script;
and writing the log data into a log file to generate a log file.
in one embodiment, the page tag configuration information includes: tag element configuration information and style configuration information.
in one embodiment, the page tag configuration information is used for configuring the request information in the test log to be displayed in a block-level structure, and includes:
the tag element configuration information and the style configuration information are used for configuring summary information of request information in a test log and displaying the summary information according to a block-level structure, and detailed information of the request information is hidden by default;
The log display module 33 is specifically configured to:
And obtaining a test log which shows the summary information of the request information according to a block-level structure and hides the detailed information of the request information by default.
in one embodiment, after obtaining a test log in which summary information of the request information is shown in a block-level structure and detailed information of the request information is hidden by default, the method further includes:
Receiving a display instruction triggered by one request message, wherein the display instruction is used for indicating the detailed information of the request message to be displayed;
And responding to the display instruction, and displaying the detailed information of the request information.
in one embodiment, the presenting, in response to the presentation instruction, details of the requested information includes:
responding to the display instruction, and judging whether the detailed information of the request information is successfully acquired;
If so, displaying the summary information of the request information in a first color, and displaying the detailed information below the summary information;
and if not, displaying the summary information of the request information in a second color.
in an embodiment, the log display module 33 is specifically configured to:
reading the log file based on a browser and analyzing the page tag configuration information;
extracting page tag configuration information corresponding to preset configuration characteristics of the browser from the analyzed page tag configuration information;
Popping up a new window of the browser;
Rendering the content of the read log file according to page tag configuration information corresponding to preset configuration characteristics of the browser, and obtaining a test log displayed by the request information according to a block-level structure in the new window.
The log display device provided by the invention can realize that: the method can simply and quickly increase the hierarchy of the test log, make the test log more beautiful, facilitate the checking and distinguishing of effective information, avoid the energy consumption of a tester due to the removal of too much and complicated information, and provide powerful technical support for improving the efficiency of positioning test problems; it can also be realized that: the label element configuration information and the style configuration information are used for configuring the summary information of the request information in the test log and are displayed according to the block-level structure, and the detailed information of the request information is hidden by default, so that the detailed information of each request information in the test log displayed after rendering is hidden, only the summary information of each request information is simply and beautifully displayed, and the test log can be further more concise and attractive.
The log display device provided by the embodiment of the present invention can implement the method embodiment provided above, and for specific function implementation, reference is made to the description in the method embodiment, which is not repeated herein.
Furthermore, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the log presentation method described in the above embodiment. The computer-readable storage medium includes, but is not limited to, any type of disk including floppy disks, hard disks, optical disks, CD-ROMs, and magneto-optical disks, ROMs (Read-Only memories), RAMs (Random AcceSS memories), EPROMs (EraSable Programmable Read-Only memories), EEPROMs (Electrically EraSable Programmable Read-Only memories), flash memories, magnetic cards, or optical cards. That is, a storage device includes any medium that stores or transmits information in a form readable by a device (e.g., a computer, a cellular phone), and may be a read-only memory, a magnetic or optical disk, or the like.
the computer-readable storage medium provided by the invention can realize that: the method can simply and quickly increase the hierarchy of the test log, make the test log more beautiful, facilitate the checking and distinguishing of effective information, avoid the energy consumption of a tester due to the removal of too much and complicated information, and provide powerful technical support for improving the efficiency of positioning test problems; it can also be realized that: the label element configuration information and the style configuration information are used for configuring the summary information of the request information in the test log and are displayed according to the block-level structure, and the detailed information of the request information is hidden by default, so that the detailed information of each request information in the test log displayed after rendering is hidden, only the summary information of each request information is simply and beautifully displayed, and the test log can be further more concise and attractive.
The computer-readable storage medium provided in the embodiments of the present invention can implement the method embodiments provided above, and for specific function implementation, reference is made to the description in the method embodiments, which is not repeated herein.
in addition, an embodiment of the present invention further provides a computer device, as shown in fig. 4. The computer device described in this embodiment may be a server, a personal computer, a network device, and other devices. The computer device comprises a processor 402, a memory 403, an input unit 404, and a display unit 405. Those skilled in the art will appreciate that the device configuration means shown in fig. 4 do not constitute a limitation of all devices and may include more or less components than those shown, or some components in combination. The memory 403 may be used to store the computer program 401 and the functional modules, and the processor 402 runs the computer program 401 stored in the memory 403 to execute various functional applications of the device and data processing. The memory may be internal or external memory, or include both internal and external memory. The memory may comprise read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), flash memory, or random access memory. The external memory may include a hard disk, a floppy disk, a ZIP disk, a usb-disk, a magnetic tape, etc. The disclosed memory includes, but is not limited to, these types of memory. The disclosed memory is by way of example only and not by way of limitation.
The input unit 404 is used for receiving input of signals and receiving keywords input by a user. The input unit 404 may include a touch panel and other input devices. The touch panel can collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel by using any suitable object or accessory such as a finger, a stylus and the like) and drive the corresponding connecting device according to a preset program; other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., play control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like. The display unit 405 may be used to display information input by a user or information provided to a user and various menus of the computer device. The display unit 405 may take the form of a liquid crystal display, an organic light emitting diode, or the like. The processor 402 is a control center of the computer device, connects various parts of the entire computer using various interfaces and lines, and performs various functions and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory.
As one embodiment, the computer device includes: one or more processors 402, a memory 403, one or more computer programs 401, wherein the one or more computer programs 401 are stored in the memory 403 and configured to be executed by the one or more processors 402, the one or more computer programs 401 being configured to perform the log presentation method of any of the above embodiments.
The computer equipment provided by the invention can realize that: the method can simply and quickly increase the hierarchy of the test log, make the test log more beautiful, facilitate the checking and distinguishing of effective information, avoid the energy consumption of a tester due to the removal of too much and complicated information, and provide powerful technical support for improving the efficiency of positioning test problems; it can also be realized that: the label element configuration information and the style configuration information are used for configuring the summary information of the request information in the test log and are displayed according to the block-level structure, and the detailed information of the request information is hidden by default, so that the detailed information of each request information in the test log displayed after rendering is hidden, only the summary information of each request information is simply and beautifully displayed, and the test log can be further more concise and attractive.
The computer device provided in the embodiment of the present invention may implement the method embodiment provided above, and for specific function implementation, reference is made to the description in the method embodiment, which is not described herein again.
in addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. a log display method is characterized by comprising the following steps:
Adding page label configuration information of a test log in a test script; the page tag configuration information is used for configuring request information in a test log and displaying the request information according to a block-level structure;
running the test script to generate a log file corresponding to the test script;
Reading the log file and analyzing the page tag configuration information, and rendering the content of the read log file according to the analyzed page tag configuration information to obtain a test log which shows the request information according to a block-level structure.
2. the log presentation method of claim 1, wherein the running the test script and generating the log file corresponding to the test script comprises:
Running the test script based on a Jmeter test tool to obtain log data corresponding to the test script;
and writing the log data into a log file to generate a log file.
3. The log presentation method of claim 1, wherein the page tag configuration information comprises: tag element configuration information and style configuration information.
4. The log presentation method of claim 3, wherein the page tag configuration information is used for configuring request information in the test log to be presented in a block-level structure, and comprises:
the tag element configuration information and the style configuration information are used for configuring summary information of request information in a test log and displaying the summary information according to a block-level structure, and detailed information of the request information is hidden by default;
the obtaining of the test log showing the request information according to the block-level structure includes:
and obtaining a test log which shows the summary information of the request information according to a block-level structure and hides the detailed information of the request information by default.
5. The log displaying method according to claim 4, wherein after obtaining the test log in which the summary information of the request information is displayed in a block-level structure and the detailed information of the request information is hidden by default, the method further comprises:
receiving a display instruction triggered by one request message, wherein the display instruction is used for indicating the detailed information of the request message to be displayed;
and responding to the display instruction, and displaying the detailed information of the request information.
6. The log presentation method according to claim 5, wherein the presenting, in response to the presentation instruction, detailed information of the requested information comprises:
Responding to the display instruction, and judging whether the detailed information of the request information is successfully acquired;
If so, displaying the summary information of the request information in a first color, and displaying the detailed information below the summary information;
And if not, displaying the summary information of the request information in a second color.
7. the log displaying method according to claim 1, wherein the reading the log file and analyzing the page tag configuration information, and rendering the content of the read log file according to the analyzed page tag configuration information to obtain the test log in which the request information is displayed in a block-level structure comprises:
Reading the log file based on a browser and analyzing the page tag configuration information;
Extracting page tag configuration information corresponding to preset configuration characteristics of the browser from the analyzed page tag configuration information;
Popping up a new window of the browser;
Rendering the content of the read log file according to page tag configuration information corresponding to preset configuration characteristics of the browser, and obtaining a test log displayed by the request information according to a block-level structure in the new window.
8. a log presentation apparatus, comprising:
The configuration module is used for adding page label configuration information of the test log in the test script; the page tag configuration information is used for configuring request information in a test log and displaying the request information according to a block-level structure;
The log file acquisition module is used for running the test script and generating a log file corresponding to the test script;
And the log display module is used for reading the log file, analyzing the page tag configuration information, rendering the content of the read log file according to the analyzed page tag configuration information, and obtaining the test log displayed by the request information according to the block-level structure.
9. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the log presentation method of any one of claims 1 to 7.
10. a computer device, comprising:
One or more processors;
a memory;
One or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more computer programs configured to: executing the log presentation method of any of claims 1 to 7.
CN201910754652.7A 2019-08-15 2019-08-15 Log display method and device, storage medium and computer equipment Pending CN110543405A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910754652.7A CN110543405A (en) 2019-08-15 2019-08-15 Log display method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910754652.7A CN110543405A (en) 2019-08-15 2019-08-15 Log display method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN110543405A true CN110543405A (en) 2019-12-06

Family

ID=68711607

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910754652.7A Pending CN110543405A (en) 2019-08-15 2019-08-15 Log display method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN110543405A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112084108A (en) * 2020-08-28 2020-12-15 山东英信计算机技术有限公司 Test script generation method and device and related components

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090249250A1 (en) * 2008-04-01 2009-10-01 Oracle International Corporation Method and system for log file processing and generating a graphical user interface based thereon
CN107957937A (en) * 2017-12-19 2018-04-24 郑州云海信息技术有限公司 A kind of method and system of daily record output
CN109582579A (en) * 2018-11-30 2019-04-05 腾讯音乐娱乐科技(深圳)有限公司 Applied program testing method, device, electronic equipment and storage medium
CN109828983A (en) * 2018-12-15 2019-05-31 平安科技(深圳)有限公司 PG data base processing method, device, electronic equipment and storage medium
CN109947707A (en) * 2019-02-28 2019-06-28 上海浪潮云计算服务有限公司 A kind of log collection analysis system and method for Insight HD platform based on Solr

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090249250A1 (en) * 2008-04-01 2009-10-01 Oracle International Corporation Method and system for log file processing and generating a graphical user interface based thereon
CN107957937A (en) * 2017-12-19 2018-04-24 郑州云海信息技术有限公司 A kind of method and system of daily record output
CN109582579A (en) * 2018-11-30 2019-04-05 腾讯音乐娱乐科技(深圳)有限公司 Applied program testing method, device, electronic equipment and storage medium
CN109828983A (en) * 2018-12-15 2019-05-31 平安科技(深圳)有限公司 PG data base processing method, device, electronic equipment and storage medium
CN109947707A (en) * 2019-02-28 2019-06-28 上海浪潮云计算服务有限公司 A kind of log collection analysis system and method for Insight HD platform based on Solr

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112084108A (en) * 2020-08-28 2020-12-15 山东英信计算机技术有限公司 Test script generation method and device and related components

Similar Documents

Publication Publication Date Title
JP7017613B2 (en) Naming Robotic Process Automation activities based on auto-discovered target labels
US9135151B2 (en) Automatic verification by comparing user interface images
US8959431B2 (en) Low resolution placeholder content for document navigation
CN104699602B (en) Method and computer for detecting influence
US20100064230A1 (en) Method and apparatus for remotely displaying screen files and efficiently handling remote operator input
US20090300588A1 (en) Method and apparatus for acquiring definitions of debug code of basic input/output system
US8160865B1 (en) Systems and methods for managing coordinate geometry for a user interface template
US9064233B2 (en) Methods and apparatus for device-specific analytics data visualization
KR19980083398A (en) Customer Support System Using the Internet
US9703770B2 (en) Automated validation of the appearance of graphical user interfaces
WO2015078566A1 (en) System and method for testing data representation for different mobile devices
JP2013084259A (en) Gradual visual comparison of web browser screen
CN107193747B (en) Code testing method and device and computer equipment
CN113018870A (en) Data processing method and device and computer readable storage medium
CN110543405A (en) Log display method and device, storage medium and computer equipment
CN106126084B (en) A kind of display methods for electric paper ink screen
CN109871205A (en) GUI code method of adjustment, device, computer installation and storage medium
US9104573B1 (en) Providing relevant diagnostic information using ontology rules
CN109145241B (en) Browser and content display management method of browser
CN110321278B (en) System testing method and device, computer equipment and storage medium
US7664776B1 (en) Methods and apparatus for dynamic form definition
CN112905931B (en) Page information display method and device, electronic equipment and storage medium
CN114003421A (en) Virtual machine timeout mechanism testing method, system, terminal and storage medium
CN113468050A (en) Canvas-based testing method and device, computer equipment and storage medium
US10423680B2 (en) Keyboard command and control in a customer relationship management (CRM) system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191206