CN111177623A - Information processing method and device - Google Patents

Information processing method and device Download PDF

Info

Publication number
CN111177623A
CN111177623A CN201911342683.8A CN201911342683A CN111177623A CN 111177623 A CN111177623 A CN 111177623A CN 201911342683 A CN201911342683 A CN 201911342683A CN 111177623 A CN111177623 A CN 111177623A
Authority
CN
China
Prior art keywords
behavior
test
information
target
monitoring
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
CN201911342683.8A
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 Absolute Health Ltd
Original Assignee
Beijing Absolute Health 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 Absolute Health Ltd filed Critical Beijing Absolute Health Ltd
Priority to CN201911342683.8A priority Critical patent/CN111177623A/en
Publication of CN111177623A publication Critical patent/CN111177623A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses an information processing method and device, wherein the method comprises the following steps: when a target webpage is loaded by a browser, triggering a plug-in program of the browser; injecting a monitoring code in the source code of the target webpage through the plug-in, wherein the monitoring code is configured in the plug-in; monitoring the operation behavior aiming at the target webpage through the monitoring code; collecting behavior information of the operation behavior through the plug-in program; and sending the behavior information to a receiving end through the plug-in program according to a set mode. According to the invention, the technical problem that the webpage behavior information cannot be automatically collected in the related technology is solved, the source code of the webpage does not need to be manually modified, and the efficiency of collecting the behavior information is improved.

Description

Information processing method and device
Technical Field
The present invention relates to the field of computers, and in particular, to an information processing method and apparatus.
Background
In the related art, a web page is a document organized in a hypertext markup Language (HTML) format on the world wide web. When information is queried via the world wide web, it appears as an information page, which may include information such as graphics, text, sound, and video. When behavior tracking is performed on a web page and webpage behaviors are collected, a JavaScript code for detection is added in a source code of a website, if the code is not added in the website, behavior tracking collection cannot be performed, for example, behavior collection needs to be performed on 100 websites, and each website needs a maintainer to manually add a code. Even if the detection code is added, only the webpage behavior can be found, but the behavior information cannot be automatically acquired, so that the user needs to use an additional webpage analysis tool for analysis and extraction, or manually analyze and extract, and the efficiency is very low.
In addition, in the related art, when the automated test is executed, a tester needs to manually write a test case, a script program, or the like, or install client software to execute the test process, which is inefficient.
In view of the above problems in the related art, no effective solution has been found at present.
Disclosure of Invention
In order to solve the technical problems that webpage behavior information cannot be automatically collected in the related art and test script codes cannot be automatically generated in the related art, the embodiment of the invention provides an information processing method and device.
According to an embodiment of the present invention, there is provided an information processing method including: when a target webpage is loaded by a browser, triggering a plug-in program of the browser; injecting a monitoring code in the source code of the target webpage through the plug-in, wherein the monitoring code is configured in the plug-in; monitoring the operation behavior aiming at the target webpage through the monitoring code; collecting behavior information of the operation behavior through the plug-in program; and sending the behavior information to a receiving end through the plug-in program according to a set mode.
Optionally, the collecting, by the plug-in program, behavior information of the operation behavior includes: analyzing an operation event corresponding to the operation behavior; collecting static behavior information of the operation event, wherein the static behavior information comprises at least one of the following: the webpage element, the operation information and the response information, wherein the operation information is used for describing the operation event, and the response information is used for describing the response event of the webpage element based on the operation event.
Optionally, the monitoring, by the monitoring code, the operation behavior for the target webpage includes: acquiring the monitoring authority of the browser through the monitoring code; and monitoring the operation behavior aiming at the target webpage based on the monitoring authority.
Optionally, the monitoring the operation behavior for the target webpage includes at least one of: monitoring a page staying behavior aiming at the target webpage; monitoring page dragging behaviors aiming at the target webpage; monitoring click behaviors aiming at the target webpage; and monitoring information input behaviors aiming at the target webpage.
Optionally, sending the behavior information to a receiving end according to a set manner by the plug-in includes: adding the behavior information into a message queue of the browser process through the plug-in program; and sending the message queue to a receiving end.
Optionally, after collecting the behavior information of the operation behavior, the method further includes: searching a target test template in the test template set according to the behavior information; adding the behavior information into the target test template to generate a test case of a test target, wherein the test target is a page element of the target webpage; and generating a test script code of the test target based on the test case.
Optionally, searching for the target test template in the test template set according to the behavior information includes: analyzing an event type of the operation behavior according to the behavior information, wherein the event type comprises one of the following: a page jump event, a click event, a focus lost event, a form value change event; and searching a target test template matched with the event type in the test template set.
Optionally, adding the behavior information to the target test template includes: if the operation behavior corresponds to a page jump event or a click event, adding element variables of page elements in the target test template; and the operation behavior corresponds to a focus losing event or a form value changing event, element variables of page elements are added in the target test template, and information is input and/or a file is uploaded.
Optionally, after generating the test script code according to the behavior information, the method further includes: performing function test on the target webpage according to the test script code; and generating a test report based on the test result.
Optionally, performing a function test on the target webpage according to the test script code includes: testing the webpage elements of the target webpage according to the test script codes, wherein the behavior information comprises: the webpage elements, the operation information and the response information; and judging whether the webpage element responds to the operation information or not, and generating the response information.
According to another embodiment of the present invention, there is provided an information processing apparatus including: the triggering module is used for triggering a plug-in program of the browser when the browser loads a target webpage; the injection module is used for injecting monitoring codes into the source codes of the target webpage through the plug-in program, wherein the monitoring codes are configured in the plug-in program; the monitoring module is used for monitoring the operation behavior aiming at the target webpage through the monitoring code; the collection module is used for collecting the behavior information of the operation behavior through the plug-in program; and the sending module is used for sending the behavior information to a receiving end through the plug-in program according to a set mode.
Optionally, the collecting module includes: the analysis unit is used for analyzing the operation event corresponding to the operation behavior; the acquisition unit is used for acquiring static behavior information of the operation event, wherein the static behavior information comprises at least one of the following: the webpage element, the operation information and the response information, wherein the operation information is used for describing the operation event, and the response information is used for describing the response event of the webpage element based on the operation event.
Optionally, the monitoring module includes: the acquisition unit is used for acquiring the monitoring authority of the browser through the monitoring code; and the monitoring unit is used for monitoring the operation behavior aiming at the target webpage based on the monitoring authority.
Optionally, the listening unit includes at least one of: the first monitoring subunit is used for monitoring the page staying behavior aiming at the target webpage; the second monitoring subunit is used for monitoring the page dragging behavior aiming at the target webpage; the third monitoring subunit is used for monitoring the click behavior aiming at the target webpage; and the fourth monitoring subunit is used for monitoring the information input behavior aiming at the target webpage.
Optionally, the sending module includes: the adding unit is used for adding the behavior information into a message queue of the browser process through the plug-in program; and the sending unit is used for sending the message queue to a receiving end.
Optionally, the apparatus further comprises: the searching module is used for searching a target test template in a test template set according to the behavior information after the collecting module collects the behavior information of the operation behaviors; the first generation module is used for adding the behavior information in the target test template to generate a test case of a test target, wherein the test target is a page element of the target webpage; and the second generation module is used for generating the test script code of the test target based on the test case.
Optionally, the searching module includes: an analyzing unit, configured to analyze an event type of the operation behavior according to the behavior information, where the event type includes one of: a page jump event, a click event, a focus lost event, a form value change event; and the searching unit is used for searching the target test template matched with the event type in the test template set.
Optionally, the first generating module includes: the first generating unit is used for adding element variables of page elements in the target test template if the operation behavior corresponds to a page jump event or a click event; and the second generating unit is used for adding element variables of page elements, input information and/or uploading files in the target test template corresponding to the operation behavior losing focus events or form value changing events.
Optionally, the apparatus further comprises: the test module is used for performing function test on the target webpage according to the test script codes after the second generation module generates the test script codes according to the behavior information; and the third generation module is used for generating a test report based on the test result.
Optionally, the test module includes: a testing unit, configured to test a web page element of the target web page according to the test script code, where the behavior information includes: the webpage elements, the operation information and the response information; and the judging unit is used for judging whether the webpage element responds to the operation information or not and generating the response information.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the scheme of the embodiment, when the target webpage is loaded on the browser, the plug-in program of the browser is triggered, then the monitoring code is injected into the source code of the target webpage through the plug-in program, the operation behavior aiming at the target webpage is monitored through the monitoring code, the behavior information of the operation behavior is collected through the plug-in program and is sent to the receiving end according to the set mode, the source code of the webpage is automatically changed through the browser, the behavior information of the webpage generated on the browser is collected through the browser, the technical problem that the behavior information of the webpage cannot be automatically collected in the related technology is solved, the source code of the webpage does not need to be manually modified, and the efficiency of collecting the behavior information is improved.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
The invention will be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
FIG. 1 is a block diagram of a hardware configuration of an information processing computer according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of information processing according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a scenario for collecting behavior information according to an embodiment of the present invention;
fig. 4 is a block diagram of the structure of an information processing apparatus according to an embodiment of the present invention;
fig. 5 is a block diagram of an information processing apparatus according to a preferred embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the computer system/server include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set top boxes, programmable consumer electronics, network pcs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above systems, and the like.
The computer system/server may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer, a server, or a similar computing device. Taking a computer as an example, fig. 1 is a hardware configuration block diagram of an information processing computer according to an embodiment of the present invention. As shown in fig. 1, computer 10 may include one or more (only one shown in fig. 1) processors 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally may also include a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those of ordinary skill in the art that the configuration shown in FIG. 1 is illustrative only and is not intended to limit the configuration of the computer described above. For example, computer 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the information processing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which may be connected to computer 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of such networks may include wireless networks provided by the communications provider of computer 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In the present embodiment, an information processing method is provided, and fig. 2 is a flowchart of an information processing method according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the steps of:
step S202, when the browser loads a target webpage, triggering a plug-in program of the browser;
step S204, injecting a monitoring code into a source code of a target webpage through a plug-in program, wherein the monitoring code is configured in the plug-in program;
the monitoring code of the embodiment is a code issued by a plug-in program of the browser, the browser gives the plug-in to acquire and modify the right of the webpage opened by the plug-in by installing the plug-in program in the browser in advance, and the monitoring code is injected into the source code when the browser loads the webpage through the source code, so that the automatic monitoring of the webpage is realized.
In this embodiment, a monitoring code may be injected into the main function of the source code to monitor all the web page elements managed by the main function, or a monitoring code may be injected into the source code of the web page element to be monitored to monitor the web page element corresponding to the web page element, so that an additional burden is not generated to the call processing of the main function, and the response speed of the web page is not affected.
Step S206, monitoring the operation behavior aiming at the target webpage by monitoring the code;
in this embodiment, the operation behavior is an operation behavior of the user or the device on the target website, such as a website login behavior, a page stop behavior, a click behavior, an information input behavior, and the like.
The monitoring code of this embodiment corresponds to a monitoring service, and is configured to discover and report a user event or a system event for a target web page to a browser, and may be implemented by monitoring a moving cursor of a mouse or monitoring a touch position of a touch medium (e.g., a finger or a stylus pen).
Step S208, collecting behavior information of the operation behavior through the plug-in program;
the plug-in program in this embodiment is a program written according to an interface of the browser, and may interact with the browser, and by injecting a monitoring code of the plug-in program into a webpage code opened by the browser, when an operation behavior is monitored, the plug-in program may collect and analyze information such as a background code loaded by the browser, a front-end interface, and the like, so as to realize collection of behavior information, and automatically send the behavior information to a receiving end, thereby realizing automatic discovery and collection of webpage operation behaviors by the browser.
And step S210, sending the behavior information to a receiving end through the plug-in program according to a set mode.
Through the steps, when the target webpage is loaded by the browser, the plug-in program of the browser is triggered, then the monitoring code is injected into the source code of the target webpage through the plug-in program, the operation behavior aiming at the target webpage is monitored through the monitoring code, the behavior information of the operation behavior is collected through the plug-in program and is sent to the receiving end according to the set mode, the source code of the webpage is automatically changed through the browser, and the behavior information of the webpage generated on the browser is collected through the browser, so that the technical problem that the behavior information of the webpage cannot be automatically collected in the related art is solved, the source code of the webpage does not need to be manually modified, and the efficiency of collecting the behavior information is improved.
In one embodiment of this embodiment, collecting behavior information of the operation behavior by the plug-in includes:
s11, analyzing the operation event corresponding to the operation behavior;
the information capture program of this embodiment may be a plug-in program written in advance by JavaScript codes, added to or built in a toolbar of the browser, or may be a functional component hidden in the browser. The information capture program of the present embodiment may collect static data of the operational behavior.
S12, collecting static behavior information of the operation event, wherein the static behavior information comprises at least one of the following: the webpage element comprises operation information and response information, wherein the operation information is used for describing operation events, and the response information is used for describing response events of the webpage element based on the operation events. In addition to the above information, the static behavior information may include time information (operation time, response time, etc.), a URL (Uniform Resource Locator) address, environment information of the browser, and the like. The web page elements of the present embodiment include: text, pictures, audio, animation, video, links, etc.
In one scenario, a user enters a panning homepage in a browser, then clicks a display picture of a merchant A in the homepage, enters a store for browsing, a target webpage is the panning homepage, webpage elements are the display picture of the merchant A in the homepage, an operation event is clicking the display picture, and a response event is a store website interface of the merchant A.
Fig. 3 is a scene schematic diagram of behavior information collection according to the embodiment of the present invention, where a target web page is an Baidu home page, and a user performs an operation behavior with respect to the web page: inputting characters abc in a search bar of an operation interface, clicking a search key, responding to the operation behavior in a hundred degrees mode, and generating a search result in a response interface.
In this embodiment, the monitoring the operation behavior for the target webpage by the monitoring code includes: acquiring the monitoring authority of the browser through the monitoring code; and monitoring the operation behavior aiming at the target webpage based on the monitoring authority. Optionally, the monitoring right is an activeTab right, based on which the extension program can temporarily access the currently active tab page when the user calls the extension program (e.g., clicks a browser button), and the access to the tab page continues until the tab page is navigated or closed.
The operation behavior for the target web page includes any operation behavior performed on a page of the target web page. The monitoring of the operation behavior for the target web page may be, but is not limited to: monitoring a page staying behavior aiming at a target webpage; monitoring page dragging behaviors aiming at a target webpage, such as page scrolling, page content dragging and the like; monitoring click behaviors aiming at a target webpage, such as clicking, double clicking, right clicking and the like; and monitoring information input behaviors aiming at the target webpage, such as literal characters input in an information input box or a retrieval area. Aiming at different types of operation behaviors, different monitoring codes can be adopted, corresponding monitoring codes are triggered according to the event types of the operation behaviors, and uniform monitoring codes can also be adopted to respond to any operation behaviors aiming at the target webpage.
In this embodiment, after adding the behavior information to the message queue of the browser process, various data processing may be performed according to a requirement based on the behavior information, and in an embodiment, sending the behavior information to the receiving end according to a set manner by the plug-in includes: and adding the behavior information into a message queue of the browser process through the plug-in program, and sending the message queue to a receiving end. The method is added into a Message queue of the browser in a post Message mode, and automatic discovery and collection of webpage operation behaviors of the browser are achieved. In addition, the user image can be analyzed according to the behavior information, and the safety of the target webpage can be evaluated.
In one embodiment of the present embodiment, the target webpage is automatically tested according to the collected behavior information. After collecting behavior information of the operation behavior, the method further comprises:
s21, searching a target test template in the test template set according to the behavior information;
s22, behavior information is added into the target test template to generate a test case of a test target, wherein the test target is a page element of a target webpage;
when creating a test case, a test code frame may also be generated, including configuration information before testing, such as the size of a test window, a test environment, and the like. The embodiment adds behavior information to the existing test case to generate a complete test case.
S23, generating test script codes of the test targets based on the test cases. Test script code in addition to test cases
The embodiment can automatically generate the test script code of the target webpage without installing software or manually writing the test code.
The test script code in this embodiment may be used to test the target web page, and may also be used to test a web page associated with or similar to the target web page.
By the automatic testing scheme of the embodiment, the testing script code is automatically generated, the technical problem that the testing script code cannot be automatically generated in the related technology is solved, the testing code does not need to be written manually, the automatic testing of the webpage is realized, and the efficiency of webpage testing is improved.
In this embodiment, searching for the target test template in the test template set according to the behavior information includes: analyzing an event type of the operation behavior according to the behavior information, wherein the event type comprises one of the following: a page jump event (hashchange), a click event (click), a loss of focus event (blu), a form value change event (change); and searching a target test template matched with the event type in the test template set. The test template corresponding to each event type is different test codes.
The behavior information required to be added is different in the test templates of different event types. Adding behavior information in the target test template comprises: if the operation behavior corresponds to a page jump event or a click event, adding element variables of page elements in a target test template; the operation behavior corresponds to a focus lost event or a form value change event, element variables of page elements are added in the target test template, and input information (such as information input by a user in an input box) and/or an upload file (such as a file uploaded by a user item website) are/is added.
In this embodiment, in addition to matching the target test template using the event type, the target test template may be matched using the web page elements, the response information, the environment information, and the like in the behavior information, or a preset uniform test template may be used, and the uniform test template may be applied to all test objects.
The test template of this embodiment is a test case template, the test template collectively includes a plurality of template files corresponding to different test types, and the test case template includes information such as a test target (also called a test object), a test environment, input data, a test procedure, an expected result (response information), and a test script (the test script is a series of instructions for controlling a test flow, and the instructions can be executed by an automated test tool to implement maintainability and reusability of the test flow).
The default information may be replaced in the target test template or the behavior information may be added in the empty characters of the target test template. In some embodiments of this embodiment, if the input data and the test target in the test template are adjustable, the behavior information is added to the corresponding operation information in the behavior information to generate the test case of the test target, and it is also possible that other information (such as an expected result, a test environment, and the like) in the test template is also adjustable, and it is also necessary to add corresponding response information, web environment information, and the like in the behavior information to the test template to generate the test case of the test target.
Optionally, after the test script code is generated according to the behavior information, the test script code may further perform an automated test on the target website, where the process includes: performing function test on the target webpage according to the test script code; and generating a test report based on the test result.
In an embodiment of this embodiment, performing a function test on the target webpage according to the test script code includes: testing the webpage elements of the target webpage according to the test script codes, wherein the behavior information comprises: webpage elements, operation information and response information; and judging whether the webpage elements respond to the operation information or not, and generating response information.
In one example, when a user actually operates a webpage a, C operation is performed on B elements of the webpage a, the webpage responds to the C operation to generate a D page, when a test case is generated, the B elements are determined as test targets in the test case, the C operation is input data, the D page is an expected result, the webpage a is tested by using the test case, if the B elements of the webpage a successfully respond to the C operation and generate the D page, the test result is in accordance with the expectation, a test report that the test is passed is generated, if the B elements of the webpage a cannot respond to the C operation or generate the E page in response to the C operation, the test result is not in accordance with the expectation, and belongs to an abnormal event, and a test report that the test is not passed is generated.
By the scheme of the embodiment, the automatic test of the webpage is realized by automatically generating the test case and the test report.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, an information processing apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and the description of which has been already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of the structure of an information processing apparatus according to an embodiment of the present invention, as shown in fig. 4, the apparatus including: a trigger module 40, an injection module 42, a listening module 44, a collection module 46, a sending module 48, wherein,
the triggering module 40 is configured to trigger a plug-in program of the browser when the browser loads a target webpage;
an injection module 42, configured to inject a monitoring code into the source code of the target web page through the plug-in, where the monitoring code is configured in the plug-in;
a monitoring module 44, configured to monitor an operation behavior for the target webpage through the monitoring code;
a collecting module 46, configured to collect behavior information of the operation behavior through the plug-in;
and a sending module 48, configured to send the behavior information to a receiving end according to a set manner through the plug-in.
Optionally, the collecting module 46 includes: an analyzing unit 461, configured to analyze an operation event corresponding to the operation behavior; an acquisition unit 462, configured to acquire static behavior information of the operation event, where the static behavior information includes at least one of: the webpage element, the operation information and the response information, wherein the operation information is used for describing the operation event, and the response information is used for describing the response event of the webpage element based on the operation event.
Optionally, the listening module 44 includes: an obtaining unit 441, configured to obtain, through the monitoring code, a monitoring right of the browser; a listening unit 442, configured to listen to an operation behavior for the target web page based on the listening permission.
Optionally, the listening unit 442 includes at least one of: a first monitoring subunit 4421, configured to monitor a page staying behavior for the target web page; a second monitoring subunit 4422, configured to monitor a page dragging behavior for the target webpage; a third monitoring subunit 4423, configured to monitor a click behavior for the target web page; a fourth monitoring subunit 4424, configured to monitor an information input behavior for the target webpage.
Optionally, the sending module 48 includes: an adding unit 481, configured to add the behavior information to a message queue of the browser process through the plug-in; a sending unit 482, configured to send the message queue to a receiving end.
Optionally, the apparatus further comprises: the searching module 50 is used for searching a target test template in the test template set according to the behavior information after the collecting module collects the behavior information of the operation behaviors; the first generating module 52 is configured to add the behavior information to the target test template to generate a test case of a test target, where the test target is a page element of the target webpage; and a second generating module 54, configured to generate a test script code of the test target based on the test case.
Optionally, the searching module 50 includes: an analyzing unit 501, configured to analyze an event type of the operation behavior according to the behavior information, where the event type includes one of: a page jump event, a click event, a focus lost event, a form value change event; a searching unit 502, configured to search a target test template matching the event type in the test template set.
Optionally, the first generating module 52 includes: a first generating unit 521, configured to add an element variable of a page element in the target test template if the operation behavior corresponds to a page jump event or a click event; a second generating unit 522, configured to add element variables of page elements, input information and/or an upload file in the target test template corresponding to the operation behavior corresponding to the out-of-focus event or the form value change event.
Optionally, the apparatus further comprises: the test module 56 is configured to perform a function test on the target webpage according to the test script code after the second generation module generates the test script code according to the behavior information; a third generating module 58 is configured to generate a test report based on the test result.
Optionally, the test module 56 includes: a testing unit 561, configured to test a web page element of the target web page according to the test script code, where the behavior information includes: the webpage elements, the operation information and the response information; a determining unit 562, configured to determine whether the web page element responds to the operation information, and generate the response information.
Fig. 5 is a block diagram showing a configuration of an information processing apparatus according to a preferred embodiment of the present invention, and as shown in fig. 5, the apparatus includes: the system comprises a trigger module 40, an injection module 42, a monitoring module 44, a collection module 46, a sending module 48, a search module 50, a first generation module 52, a second generation module 54, a test module 56, and a third generation module 58, wherein the collection module 46 comprises an analysis unit, 461 an acquisition unit 462, the monitoring module 44 comprises an acquisition unit 441, a monitoring unit 442, the monitoring unit 441 comprises a first monitoring subunit 4411, a second monitoring subunit 4412, a third monitoring subunit 4413, and a fourth monitoring subunit 4414, the sending module 48 comprises an adding unit 481 and a sending unit 482, the search module 50 comprises an analysis unit 501, a search unit 502, the first generation module 52 comprises a first generation unit 521, a second generation unit 522, and the test module 56 comprises a test unit 561 and a judgment unit 562.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, when the browser loads the target webpage, triggering the plug-in program of the browser;
s2, injecting a monitoring code in the source code of the target webpage through the plug-in program, wherein the monitoring code is configured in the plug-in program;
s3, monitoring the operation behavior aiming at the target webpage through the monitoring code;
s4, collecting behavior information of the operation behavior through the plug-in program;
and S5, sending the behavior information to a receiving end through the plug-in program according to a set mode.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, when the browser loads the target webpage, triggering the plug-in program of the browser;
s2, injecting a monitoring code in the source code of the target webpage through the plug-in program, wherein the monitoring code is configured in the plug-in program;
s3, monitoring the operation behavior aiming at the target webpage through the monitoring code;
s4, collecting behavior information of the operation behavior through the plug-in program;
and S5, sending the behavior information to a receiving end through the plug-in program according to a set mode.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The method and system of the present invention may be implemented in a number of ways. For example, the methods and systems of the present invention may be implemented in software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustrative purposes only, and the steps of the method of the present invention are not limited to the order specifically described above unless specifically indicated otherwise. Furthermore, in some embodiments, the present invention may also be embodied as a program recorded in a recording medium, the program including machine-readable instructions for implementing a method according to the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the present invention.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to practitioners skilled in this art. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.

Claims (15)

1. An information processing method characterized by comprising:
when a target webpage is loaded by a browser, triggering a plug-in program of the browser;
injecting a monitoring code in the source code of the target webpage through the plug-in, wherein the monitoring code is configured in the plug-in;
monitoring the operation behavior aiming at the target webpage through the monitoring code;
collecting behavior information of the operation behavior through the plug-in program;
and sending the behavior information to a receiving end through the plug-in program according to a set mode.
2. The method of claim 1, wherein collecting behavior information for the operational behavior by the plug-in comprises:
analyzing an operation event corresponding to the operation behavior;
collecting static behavior information of the operation event, wherein the static behavior information comprises at least one of the following: the webpage element, the operation information and the response information, wherein the operation information is used for describing the operation event, and the response information is used for describing the response event of the webpage element based on the operation event.
3. The method of claim 1, wherein listening, by the listening code, for operational behavior for the target web page comprises:
acquiring the monitoring authority of the browser through the monitoring code;
and monitoring the operation behavior aiming at the target webpage based on the monitoring authority.
4. The method of claim 3, wherein listening for operational behavior with respect to the target web page comprises at least one of:
monitoring a page staying behavior aiming at the target webpage;
monitoring page dragging behaviors aiming at the target webpage;
monitoring click behaviors aiming at the target webpage;
and monitoring information input behaviors aiming at the target webpage.
5. The method of claim 1, wherein sending the behavior information to a receiving end in a set manner by the plug-in comprises:
adding the behavior information into a message queue of the browser process through the plug-in program;
and sending the message queue to a receiving end.
6. The method of claim 1, wherein after collecting behavior information for the operational behavior, the method further comprises:
searching a target test template in the test template set according to the behavior information;
adding the behavior information into the target test template to generate a test case of a test target, wherein the test target is a page element of the target webpage;
and generating a test script code of the test target based on the test case.
7. The method of claim 6, wherein finding a target test template in a set of test templates based on the behavior information comprises:
analyzing an event type of the operation behavior according to the behavior information, wherein the event type comprises one of the following: a page jump event, a click event, a focus lost event, a form value change event;
and searching a target test template matched with the event type in the test template set.
8. The method of claim 6, wherein adding the behavior information in the target test template comprises:
if the operation behavior corresponds to a page jump event or a click event, adding element variables of page elements in the target test template;
and the operation behavior corresponds to a focus losing event or a form value changing event, element variables of page elements are added in the target test template, and information is input and/or a file is uploaded.
9. The method of claim 6, wherein after generating test script code from the behavior information, the method further comprises:
performing function test on the target webpage according to the test script code;
and generating a test report based on the test result.
10. The method of claim 8, wherein functionally testing the target web page according to the test script code comprises:
testing the webpage elements of the target webpage according to the test script codes, wherein the behavior information comprises: the webpage elements, the operation information and the response information;
and judging whether the webpage element responds to the operation information or not, and generating the response information.
11. An information processing apparatus characterized by comprising:
the triggering module is used for triggering a plug-in program of the browser when the browser loads a target webpage;
the injection module is used for injecting monitoring codes into the source codes of the target webpage through the plug-in program, wherein the monitoring codes are configured in the plug-in program;
the monitoring module is used for monitoring the operation behavior aiming at the target webpage through the monitoring code;
the collection module is used for collecting the behavior information of the operation behavior through the plug-in program;
and the sending module is used for sending the behavior information to a receiving end through the plug-in program according to a set mode.
12. The apparatus of claim 11,
the collection module includes: the analysis unit is used for analyzing the operation event corresponding to the operation behavior; the acquisition unit is used for acquiring static behavior information of the operation event, wherein the static behavior information comprises at least one of the following: the webpage element, operation information and response information, wherein the operation information is used for describing the operation event, and the response information is used for describing a response event of the webpage element based on the operation event; and/or the presence of a gas in the gas,
the monitoring module comprises: the acquisition unit is used for acquiring the monitoring authority of the browser through the monitoring code; the monitoring unit is used for monitoring the operation behavior aiming at the target webpage based on the monitoring authority; and/or the presence of a gas in the gas,
the sending module comprises: the adding unit is used for adding the behavior information into a message queue of the browser process through the plug-in program; and the sending unit is used for sending the message queue to a receiving end.
13. The apparatus of claim 12, wherein the listening unit comprises at least one of: the first monitoring subunit is used for monitoring the page staying behavior aiming at the target webpage; the second monitoring subunit is used for monitoring the page dragging behavior aiming at the target webpage; the third monitoring subunit is used for monitoring the click behavior aiming at the target webpage; and the fourth monitoring subunit is used for monitoring the information input behavior aiming at the target webpage.
14. The apparatus of claim 11, further comprising:
the searching module is used for searching a target test template in a test template set according to the behavior information after the collecting module collects the behavior information of the operation behaviors; the first generation module is used for adding the behavior information in the target test template to generate a test case of a test target, wherein the test target is a page element of the target webpage; the second generation module is used for generating a test script code of the test target based on the test case; and/or the presence of a gas in the gas,
the test module is used for performing function test on the target webpage according to the test script codes after the second generation module generates the test script codes according to the behavior information; and the third generation module is used for generating a test report based on the test result.
15. The apparatus of claim 14,
the searching module comprises: an analyzing unit, configured to analyze an event type of the operation behavior according to the behavior information, where the event type includes one of: a page jump event, a click event, a focus lost event, a form value change event; the searching unit is used for searching a target test template matched with the event type in the test template set; and/or the presence of a gas in the gas,
the first generation module comprises: the first generating unit is used for adding element variables of page elements in the target test template if the operation behavior corresponds to a page jump event or a click event; the second generation unit is used for adding element variables of page elements, input information and/or uploading files in the target test template corresponding to the operation behavior losing focus events or form value changing events; and/or the presence of a gas in the gas,
a testing unit, configured to test a web page element of the target web page according to the test script code, where the behavior information includes: the webpage elements, the operation information and the response information; and the judging unit is used for judging whether the webpage element responds to the operation information or not and generating the response information.
CN201911342683.8A 2019-12-23 2019-12-23 Information processing method and device Pending CN111177623A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911342683.8A CN111177623A (en) 2019-12-23 2019-12-23 Information processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911342683.8A CN111177623A (en) 2019-12-23 2019-12-23 Information processing method and device

Publications (1)

Publication Number Publication Date
CN111177623A true CN111177623A (en) 2020-05-19

Family

ID=70655643

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911342683.8A Pending CN111177623A (en) 2019-12-23 2019-12-23 Information processing method and device

Country Status (1)

Country Link
CN (1) CN111177623A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799927A (en) * 2021-01-28 2021-05-14 中国工商银行股份有限公司 Operation behavior information acquisition method and device for front-end user
CN113377634A (en) * 2021-05-25 2021-09-10 北京猿力教育科技有限公司 Monitoring method for backtracking user operation, user operation backtracking method and device
CN113779570A (en) * 2021-09-18 2021-12-10 深信服科技股份有限公司 Process monitoring method and device, electronic equipment and readable storage medium
CN114756217A (en) * 2022-03-22 2022-07-15 北京云枢创新软件技术有限公司 Plug-in-based script generation system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062780A (en) * 2018-06-25 2018-12-21 深圳市远行科技股份有限公司 The development approach and terminal device of automatic test cases
CN109284458A (en) * 2018-09-28 2019-01-29 平安普惠企业管理有限公司 Webpage display process, device, computer equipment and storage medium
CN109710354A (en) * 2018-12-13 2019-05-03 平安普惠企业管理有限公司 Page monitor method, page restoring method, device, equipment and medium
CN109710831A (en) * 2018-12-28 2019-05-03 四川新网银行股份有限公司 A kind of network crawler system based on browser plug-in
CN110213157A (en) * 2019-05-17 2019-09-06 腾讯科技(深圳)有限公司 A kind of monitoring method of instant messaging request, apparatus and system
CN110298000A (en) * 2019-05-21 2019-10-01 平安普惠企业管理有限公司 Acquisition methods, terminal device and the medium of page parameter
CN110334299A (en) * 2019-06-27 2019-10-15 上海淇馥信息技术有限公司 A kind of pop-up methods of exhibiting, device and electronic equipment monitored based on address field
CN110413476A (en) * 2019-06-20 2019-11-05 平安普惠企业管理有限公司 Webpage collapses monitor method, device, computer equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062780A (en) * 2018-06-25 2018-12-21 深圳市远行科技股份有限公司 The development approach and terminal device of automatic test cases
CN109284458A (en) * 2018-09-28 2019-01-29 平安普惠企业管理有限公司 Webpage display process, device, computer equipment and storage medium
CN109710354A (en) * 2018-12-13 2019-05-03 平安普惠企业管理有限公司 Page monitor method, page restoring method, device, equipment and medium
CN109710831A (en) * 2018-12-28 2019-05-03 四川新网银行股份有限公司 A kind of network crawler system based on browser plug-in
CN110213157A (en) * 2019-05-17 2019-09-06 腾讯科技(深圳)有限公司 A kind of monitoring method of instant messaging request, apparatus and system
CN110298000A (en) * 2019-05-21 2019-10-01 平安普惠企业管理有限公司 Acquisition methods, terminal device and the medium of page parameter
CN110413476A (en) * 2019-06-20 2019-11-05 平安普惠企业管理有限公司 Webpage collapses monitor method, device, computer equipment and storage medium
CN110334299A (en) * 2019-06-27 2019-10-15 上海淇馥信息技术有限公司 A kind of pop-up methods of exhibiting, device and electronic equipment monitored based on address field

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799927A (en) * 2021-01-28 2021-05-14 中国工商银行股份有限公司 Operation behavior information acquisition method and device for front-end user
CN113377634A (en) * 2021-05-25 2021-09-10 北京猿力教育科技有限公司 Monitoring method for backtracking user operation, user operation backtracking method and device
CN113779570A (en) * 2021-09-18 2021-12-10 深信服科技股份有限公司 Process monitoring method and device, electronic equipment and readable storage medium
CN113779570B (en) * 2021-09-18 2024-02-23 深信服科技股份有限公司 Security protection method and device based on core process and electronic equipment
CN114756217A (en) * 2022-03-22 2022-07-15 北京云枢创新软件技术有限公司 Plug-in-based script generation system

Similar Documents

Publication Publication Date Title
US11489934B2 (en) Method and system for monitoring and tracking browsing activity on handled devices
US20200137196A1 (en) Capturing and replaying application sessions using resource files
CN109739717B (en) Page data acquisition method and device and server
CN111177623A (en) Information processing method and device
US8326922B2 (en) Method for server-side logging of client browser state through markup language
CN107729475B (en) Webpage element acquisition method, device, terminal and computer-readable storage medium
CN102646135B (en) Webpage collecting method, device and system
CN111901192B (en) Statistical method and device for page access data
CN104243273A (en) Method and device for displaying information on instant messaging client and information display system
CN104765746B (en) Data processing method and device for mobile communication terminal browser
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN111163054A (en) Method and device for detecting malicious behavior of webpage
CN103455600A (en) Video URL (Uniform Resource Locator) grabbing method and device and server equipment
CN114528457A (en) Web fingerprint detection method and related equipment
CN104834588A (en) Permanent residence cross site script vulnerability detection method and apparatus
CN113190512A (en) Power customer behavior data analysis method based on buried point technology
CN112817817B (en) Buried point information query method, buried point information query device, computer equipment and storage medium
JP6505849B2 (en) Generation of element identifier
CN111291288B (en) Webpage link extraction method and system
CN112256545A (en) Method and device for acquiring user operation information
CN112307386A (en) Information monitoring method, system, electronic device and computer readable storage medium
CN112905935A (en) Page recording method, page recording animation generation method, equipment and storage medium
CN109246069B (en) Webpage login method and device and readable storage medium
CN111045934A (en) Page analysis method, device, client, storage medium and electronic equipment
CN110928547A (en) Public file extraction method, device, terminal and storage medium

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
CB02 Change of applicant information

Address after: 100102 201 / F, block C, 2 lizezhong 2nd Road, Chaoyang District, Beijing

Applicant after: Beijing Shuidi Technology Group Co.,Ltd.

Address before: Room 4103, room 101, floor 1, building 2, No. 208, Lize Zhongyuan, Chaoyang District, Beijing 100102

Applicant before: Beijing Health Home Technology Co.,Ltd.

CB02 Change of applicant information