CN110209570A - Processing method, device, electronic equipment and the storage medium of event - Google Patents

Processing method, device, electronic equipment and the storage medium of event Download PDF

Info

Publication number
CN110209570A
CN110209570A CN201910315100.6A CN201910315100A CN110209570A CN 110209570 A CN110209570 A CN 110209570A CN 201910315100 A CN201910315100 A CN 201910315100A CN 110209570 A CN110209570 A CN 110209570A
Authority
CN
China
Prior art keywords
label
event
mark
trigger event
class name
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
CN201910315100.6A
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 ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910315100.6A priority Critical patent/CN110209570A/en
Publication of CN110209570A publication Critical patent/CN110209570A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics

Abstract

The disclosure provides processing method, device, electronic equipment and the storage medium of a kind of event, this method comprises: recording the label and mark of the first element when detecting to the trigger event of the first element on browser interface;Event replay instruction is received, event replay instruction includes the label and mark of the first element;Based on label and mark, the corresponding execution code of trigger event is transferred, and executes playback operation according to code is executed.The automatic playback of trigger event is realized, and does not have to related personnel and is manually operated again, avoids manually repeating inefficient operation, improves exploitation testing efficiency.And when the embodiment of the present disclosure records event action, other than capturing trigger event type, only need to record the label and mark of the element of trigger event, without recording code, in playback, matching label substance text is not needed, so as to compatible multilingual, improves the availability of the event action of record.

Description

Processing method, device, electronic equipment and the storage medium of event
Technical field
This disclosure relates to field of computer technology more particularly to a kind of processing method of event, device, electronic equipment and Storage medium.
Background technique
As WEB application more and more in depth develops, the exploitation of webpage also becomes increasingly complex on website, user and webpage Interactive realization depends on the event and thing of HTML (HyperText Markup Language, hypertext markup language) Part treatment mechanism.
The operation generated when user accesses the web page, referred to as event, such as mouse event, KeyEvent etc..It is answered in WEB In development process, the operation for doing some repeatability is generally required to the test of application function, such as need to click boundary one by one Button element on face tests corresponding function, and when developing new function, developed function may be had an impact, In order to test whether to have an impact and have which influence, it is also necessary to which repetitive operation one time again is brought not to developer in this way Just, working efficiency is influenced.
Summary of the invention
The disclosure provides processing method, device, electronic equipment and the storage medium of a kind of event, to solve the prior art The defects of working efficiency is lower.
Disclosure first aspect provides a kind of processing method of event, comprising:
When detecting to the trigger event of the first element on browser interface, record first element label and Mark;
Event replay instruction is received, the event replay instruction includes the label and mark of first element;
Based on the label and the mark, the corresponding execution code of the trigger event is transferred, and according to the execution Code executes playback operation.
Disclosure the second aspect provides a kind of processing unit of event, comprising:
Logging modle, for recording described first when detecting to the trigger event of the first element on browser interface The label and mark of element;
Receiving module, for receiving event replay instruction, the event replay instruction includes the label of first element And mark;
Processing module, for transferring the corresponding execution code of the trigger event based on the label and the mark, And playback operation is executed according to the execution code.
A kind of electronic equipment is provided in terms of disclosure third, comprising: at least one processor and memory;
The memory stores computer program;At least one described processor executes the calculating of the memory storage Machine program, the method to realize first aspect offer.
The 4th aspect of the disclosure provides a kind of computer readable storage medium, deposits in the computer readable storage medium Computer program is contained, the computer program is performed the method for realizing that first aspect provides.
Processing method, device, electronic equipment and the storage medium for the event that the disclosure provides, by detecting to clear Look at the trigger event of the first element on device interface when, record the label and mark of the first element, receiving event replay instruction Afterwards, it is based on label and mark, transfers the corresponding execution code of trigger event, and execute playback operation according to code is executed.It realizes The automatic playback of trigger event, and do not have to related personnel and be manually operated again, it avoids manually repeating inefficient operation, raising is opened Send out testing efficiency.And when the embodiment of the present disclosure records event action, other than capturing trigger event type, it is only necessary to record The label and mark of the element of trigger event, in playback, do not need matching label substance text without recording code This, so as to compatible multilingual, for example website is there are when multilingual, even if still can correctly return after switching language It puts, improves the availability of the event action of record.
Detailed description of the invention
In order to illustrate more clearly of the embodiment of the present disclosure or technical solution in the prior art, below will to embodiment or Attached drawing needed to be used in the description of the prior art is briefly described, it should be apparent that, the accompanying drawings in the following description is this Disclosed some embodiments, for those of ordinary skill in the art, without any creative labor, also Other drawings may be obtained according to these drawings without any creative labor.
Fig. 1 is the flow diagram of the processing method for the event that one embodiment of the disclosure provides;
Fig. 2 is the flow diagram of the processing method for the event that another embodiment of the disclosure provides;
Fig. 3 is the structural schematic diagram of the processing unit for the event that one embodiment of the disclosure provides;
Fig. 4 is the structural schematic diagram for the electronic equipment that one embodiment of the disclosure provides;
Fig. 5 is the structural schematic diagram of the electronic equipment 800 suitable for the embodiment of the present disclosure.
Through the above attached drawings, it has been shown that the specific embodiment of the disclosure will be hereinafter described in more detail.These are attached Figure and verbal description are not intended to limit the scope of this disclosure concept by any means, but by reference to particular implementation The concept of the present disclosure is explained for those skilled in the art for example.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present disclosure clearer, below in conjunction with the embodiment of the present disclosure In attached drawing, the technical solution in the embodiment of the present disclosure is clearly and completely described, it is clear that described embodiment is Disclosure a part of the embodiment, instead of all the embodiments.Based on the embodiment in the disclosure, ordinary skill people Member's every other embodiment obtained without creative efforts, belongs to the range of disclosure protection.
Noun involved in the disclosure is explained first:
HTML:HyperText Markup Language, HyperText Markup Language.The structure of hypertext markup language Including " head " part (English: Head) and " main body " part (English: Body), wherein " head " portion provides the letter about webpage Breath, " main body " part provide the particular content of webpage.Hypertext, which refers to, may include picture, link, music, program in the page Etc. non-legible element.Html page refers to the HTML code page of webpage.
Element: HTML element refers on html page from label (start tag) is started to end-tag (end Tag all codes).Such as: element<p>xXXXX</p>, wherein<p>with</p>it respectively indicates and starts label and terminate to mark Label, are collectively referred to as the label of the element.
Element ID: refer to the ID attribute for element setting.ID attribute provides the ID of HTML element.
ClassName: class name refers to that the class attribute for element setting, class attribute provide the class name of element ClassName。
The mark of element: being the information for referring to navigate to the element in html page, such as element ID, element ClassName or tag path etc..Since the label of different elements may be identical, it only cannot by the label of element The element for navigating to trigger event needs the mark by element, for example, the element of trigger event is < div class=" >24 hours heat of module-head " is heard</div>, label is<div></div>, and may have in html web page very much<div> </div>label, then can be by the class name module-head of the element, as the mark of the element, in html page In find the element of trigger event.
JavaScript: being a kind of literal translation formula scripting language, is a kind of regime type, weak type, the language based on prototype Speech, built-in support type.Its interpreter is referred to as JavaScript engine, is a part of browser, is widely used in client The scripting language at end is to use on HTML (application under standard generalized markup language) webpage earliest, is used to HTML Webpage increases dynamic function.
The processing method for the event that the embodiment of the present disclosure provides, is suitable for WEB application exploitation test or user is actually clear When looking at, when related personnel is by the test such as clicking operation, keyboard operation or using webpage function, trigger event can recorde Relevant information, when need repeat these operation when, these can be played back based on the relevant information of the trigger event of record automatically Operation, and do not have to related personnel and be manually operated again, it avoids manually repeating inefficient operation, improves exploitation testing efficiency.And this When open embodiment record event action, other than capturing trigger event type, it is only necessary to record the mark of the element of trigger event Label and mark, in playback, do not need matching label substance text without recording code, a variety of so as to compatibility Language, such as website, even if still can correctly play back after switching language, improve the event behaviour of record there are when multilingual The availability of work.
In addition, term " first ", " second " etc. are used for description purposes only, it is not understood to indicate or imply relatively heavy The property wanted or the quantity for implicitly indicating indicated technical characteristic.In the description of following embodiment, the meaning of " plurality " is Two or more, unless otherwise specifically defined.
These specific embodiments can be combined with each other below, may be for the same or similar concept or process It is repeated no more in some embodiments.Below in conjunction with attached drawing, the embodiment of the present invention is described.
One embodiment of the disclosure provides a kind of processing method of event, for realizing the record of the trigger events such as browser And playback.The executing subject of the embodiment of the present disclosure is the processing unit of event, which can be set in the electronic device, should Electronic equipment can be the equipment such as server, desktop computer, laptop.
As shown in Figure 1, be the flow diagram of the processing method for the event that the embodiment of the present disclosure provides, this method comprises:
Step 101, when detecting to the trigger event of the first element on browser interface, the mark of the first element is recorded Label and mark.
Specifically, when user (such as developer, tester, client user etc.) is in browser interface, such as net When carrying out the operations such as click button, keyboard input on page, that is, trigger to respective element (element is known as the first element) Event then can detecte the trigger event to the first element, can capture the trigger event, such as mouse event, KeyEvent Deng getting the event informations such as type, the specific event operation of trigger event, for example mouse event is clicked by right key or left Key click or wheel operation etc., KeyEvent is to trigger which key or have input which information etc., specifically The mode of capturing events information is the prior art, and details are not described herein.Further, it is also possible to get the first element label and Other relevant informations.Such as first element element ID, class name ClassName etc..In order to be navigated to when subsequent playback First element needs to record the label of the first element and the mark of the first element.
Optionally, if with the element ID of the first element in html page, and its element ID is unique in the HTML page , then the mark that the element ID of the first element can be used as the first element is recorded.In playback, the label can be passed through With the position of the mark location first element into html page.
Optionally, since element ID is usually what developer was arranged, although generally require element ID be it is unique, Also it is difficult to avoid being likely to occur the case where element ID is repeated, such as there are also the label of second element is identical as the first element, and the The element ID of Was Used and the element ID of the first element are also identical, or even there are also the element ID of more elements and the first element It is identical with label, in this case, need to obtain ID serial number namely first of the element ID of the first element in html page It is a which the element ID of element comes in multiple elements with same label and identical element ID in the html page.Tool The acquisition of the ID serial number of body can be object and the object of each element with identical element ID according to the element in event source Whether the address distributed in memory unanimously obtains.In playback, according to the element ID and serial number of the first element of record, Navigate to the first element.
Optionally, if with the class name ClassName of the first element in html page, and its ClassName is in HTML page It is in face uniquely, then the mark that the ClassName of the first element can be used as first element is recorded.
Optionally, if not only without the element ID of the first element but also without the ClassName of the first element in html page, The then parent element of available first element, judge in html page whether element ID with parent element or ClassName, if so, then can be using parent element as location element, by the label road between location element and the first element Diameter is recorded as the mark of the first element.
Optionally, the mark of the first element can also be other relevant information, as long as triggering can be found in html page First element of event, the embodiment of the present disclosure is without limitation.
Optionally, here the first element can be it is multiple, i.e., user may constantly carry out mouse click, keyboard input A plurality of news is opened Deng operation, such as user, then can generate the trigger event of multiple first elements, can then automatically record at this time The event type and relevant information of each trigger event, can record in serialized fashion, for example be remembered according to user's operation sequence Record, or according to the triggered time of each trigger event record etc., sequence of events can be generated, played back for subsequent.It returns The automatic repetitive operation to user's operation is then realized when putting according to the sequence of events of record.
It is alternatively possible in the form of event capturing, monitor all kinds of events in the overall situation using JavaScript script.When When the behavior of user triggers some event, event type and event information are recorded by way of serializing.Record Information can specifically include the event information (event type, event action, triggered time, trigger sequence etc.) of user's operation And the relevant information (such as label and mark of the first element) of the element (such as first element) in event source
Step 102, event replay instruction is received, event replay instruction includes the label and mark of the first element.
Step 103, it is based on label and mark, transfers the corresponding execution code of trigger event, and execute according to code is executed Playback operation.
Specifically, after the event information for having recorded one or more elements, if subsequent these behaviour for needing duplicate customer To make, for example receives event replay instruction, event replay instruction includes the label and mark for needing the first element played back, The trigger event of the first element of record can then be played back, be manually operated again without user.Specifically it can be The label and mark of the first element based on record navigate to the execution code of trigger event, Lai Shixian playback operation.Wherein, Event replay instruction can be the automatic trigger in test, can also be triggered manually by the user that needs play back, which then may be used To receive event replay instruction.
It is alternatively possible to corresponding first element is found in html page according to the mark and label of the first element, Trigger the trigger event to the first element.It is to be appreciated that also recording the event for having the trigger event of the first element in record Type and other relevant event informations carry out the first element identical as trigger event after finding corresponding first element Operation, realize accurate playback to user's operation.Specifically repeat no more.
The processing method for the event that the embodiment of the present disclosure provides, by detecting to the first element on browser interface Trigger event when, record the first element label and mark, receive event replay instruction after, be based on label and mark, The corresponding execution code of trigger event is transferred, and executes playback operation according to code is executed.The automatic of trigger event is realized to return It puts, and does not have to related personnel and be manually operated again, avoid manually repeating inefficient operation, improve exploitation testing efficiency.And this public affairs When opening embodiment record event action, other than capturing trigger event type, it is only necessary to record the label of the element of trigger event , in playback, matching label substance text is not needed, so as to a variety of languages of compatibility without recording code with mark Speech, for example website is there are when multilingual, even if still can correctly play back after switching language, improve the event action of record Availability.
Another embodiment of the disclosure does further supplementary explanation to the processing method of event provided by the above embodiment.
As shown in Fig. 2, being the flow diagram of the processing method for the event that the embodiment of the present disclosure provides.
As a kind of enforceable mode, on the basis of the above embodiments, optionally, step 101, specifically can wrap It includes:
Step 2011, in the trigger event of the first element on detecting interface, the label of the first element is obtained.
Specifically, when detecting to the trigger event of the first element on browser interface, it is available to the first element Label, other relevant informations of the first element can also be obtained.
Illustratively, " news " that user clicks on browsing device net page then triggers corresponding with this on html web page The trigger event of element, the label of the available element, and the tool to the event type of the trigger event of the element, event Jump page after gymnastics work etc., such as click.
Step 2012, judge the element ID whether in html page with the first element.
Specifically, after the label for obtaining the first element, it can be determined that whether there is the first element in html page Element ID, if so, the then element ID of available first element.
Step 2013, if so, and element ID is uniquely, using element ID as the mark of the first element in html page Know.
Specifically, if can also judge the element ID of first element with the element ID of the first element in html page It is whether unique in html page, if so, showing in html page, first yuan can be uniquely navigated to according to element ID The position of element, then can be using the element ID of the first element as the mark of the first element.
Step 2014, the label and mark of the first element are recorded.
Specifically, the label of the first element and mark can then be remembered after the mark that the first element has been determined Record, in order to subsequent playback.
In playback, the position of the label and the mark location first element into html page can be passed through.
Optionally, this method further include:
Step 2021, if the member of element ID and the first element in html page also at least one other element Plain ID is identical, and the label of at least one other element is identical as the label of the first element, and the element ID for obtaining the first element exists ID serial number in html page.
Step 2022, using the ID serial number of the element ID of the first element and the element ID of the first element as the first element Mark.
Specifically, since element ID is usually what developer was arranged, although generally require element ID be it is unique, Also it is difficult to avoid being likely to occur the case where element ID is repeated, such as there are also the label of second element is identical as the first element, and the The element ID of Was Used and the element ID of the first element are also identical, or even there are also the element ID of more elements and the first element It is identical with label, in this case, need to obtain ID serial number namely first of the element ID of the first element in html page It is a which the element ID of element comes in multiple elements with same label and identical element ID in the html page.Tool The acquisition of the ID serial number of body can be object and the object of each element with identical element ID according to the element in event source Whether the address distributed in memory unanimously obtains.In playback, according to the element ID and serial number of the first element of record, Navigate to the first element.
Optionally, if not having the element ID of the first element, this method in html page further include:
Step 2031, judge the class name whether in html page with the first element.
Step 2032, if so, and class name is uniquely, using class name as the mark of the first element in html page.
Specifically, and if its ClassName is in HTML page with the class name ClassName of the first element in html page It is in face uniquely, then the mark that the ClassName of the first element can be used as first element is recorded.Concrete principle Similar to above-mentioned element ID, details are not described herein.
It should be understood that in html page whether the judgement of the element ID with the first element, and whether have the The judgement of the class name of one element is not limited to above-mentioned sequencing, can also first judge whether with class name, in no class name When judging whether with element ID.
Optionally, this method can also include:
Step 2033, if the class name of class name and the first element in html page also at least one other element It is identical, and the label of at least one other element is identical as the label of the first element, obtains the class name of the first element in HTML page Class name serial number in face;Using the class name serial number of the class name of the first element and the class name of the first element as the mark of the first element.
The case where to the element ID of above-mentioned first element, is similar, since ClassName is usually what developer was arranged, The case where being likely to occur multiple identical class names, such as the label of also second element are identical as the first element, and second element Class name is also identical as the class name of the first element, in this case, needs to obtain class of the class name of the first element in html page The class name of name serial number namely the first element is arranged in multiple elements with same label and identical class name in the HTML page It is a at which.Acquisitions of specific class name serial number can be according to the object of the element in event source with there is each of identical class name Whether address that the object of element distributes in memory unanimously obtains.In playback, according to the class name of the first element of record With class name serial number and label, the first element is navigated to.
Optionally, this method can also include:
Step 2034, if not having the class name of the first element in html page, the member of the parent element of the first element is obtained Plain ID or class name, using the tag path between parent element and the first element as the mark of the first element.
Specifically, if not only without the element ID of the first element but also without the class name of the first element in html page ClassName, then the parent element of available first element, judges the element whether in html page with parent element ID or ClassName, if so, then can be using parent element as location element, by the mark between location element and the first element Label path is recorded as the mark of the first element.
It is to be appreciated that if the parent element of the first element in html page also without element ID or ClassName, The parent element of parent element can be then continued to search, and so on, until finding the member with element ID or ClassName Element is used as location element, records the tag path between location element and the first element as the mark of the first element.
As a kind of possible embodiment, optionally, when the number of the first element is multiple, the first element is recorded Label and mark, comprising:
According to the trigger sequence of the trigger event of each first element, the label and mark of each first element are recorded to serializing Know.
Specifically, here the first element can be it is multiple, i.e., user may constantly carry out mouse click, keyboard input A plurality of news is opened Deng operation, such as user, then can generate the trigger event of multiple first elements, can then automatically record at this time The event type and relevant information of each trigger event, can record in serialized fashion, for example be remembered according to user's operation sequence Record, or according to the triggered time of each trigger event record etc., sequence of events can be generated, played back for subsequent.It returns The automatic repetitive operation to user's operation is then realized when putting according to the sequence of events of record.
Optionally, DOM (DOM Document Object Model) thing of user's operation can also be stored with customized event structured way Part.
As a kind of possible embodiment, optionally, the triggering thing to the first element on browser interface is being detected When part, this method further include:
Record the event information of the trigger event of the first element;
Based on label and mark, the corresponding execution code of trigger event is transferred, and executes playback behaviour according to code is executed Make, comprising:
Based on label, mark and event information, the corresponding execution code of trigger event is transferred, and is held according to code is executed Row operation identical with trigger event.
Wherein, the event type for capturing trigger event is the prior art, and details are not described herein.
The principle of event replay is the element by searching for trigger event, simulates identical event action.
It is alternatively possible to search html page element by CSS selector path orientation.
It should be noted that each enforceable mode can individually be implemented in the embodiment of the present disclosure, can also not conflict In the case where in any combination combine implement the disclosure without limitation.
The processing method for the event that the embodiment of the present disclosure provides, by detecting to the first element on browser interface Trigger event when, record the first element label and mark, receive event replay instruction after, be based on label and mark, The corresponding execution code of trigger event is transferred, and executes playback operation according to code is executed.The automatic of trigger event is realized to return It puts, and does not have to related personnel and be manually operated again, avoid manually repeating inefficient operation, improve exploitation testing efficiency.And this public affairs When opening embodiment record event action, other than capturing trigger event type, it is only necessary to record the label of the element of trigger event , in playback, matching label substance text is not needed, so as to a variety of languages of compatibility without recording code with mark Speech, for example website is there are when multilingual, even if still can correctly play back after switching language, improve the event action of record Availability.
Disclosure another embodiment provides a kind of processing unit of event, the place of the event for executing above-described embodiment Reason method.
As shown in figure 3, being the structural schematic diagram of the processing unit for the event that the embodiment of the present disclosure provides.The place of the event Managing device 30 includes logging modle 31, receiving module 32 and processing module 33.
Wherein, logging modle, for when detecting to the trigger event of the first element on browser interface, record the The label and mark of one element;Receiving module, for receiving event replay instruction, event replay instruction includes the first element Label and mark;Processing module transfers the corresponding execution code of trigger event, and according to execution for being based on label and mark Code executes playback operation.
About the device in the embodiment of the present disclosure, the concrete mode that wherein modules execute operation is somebody's turn to do related It is described in detail in the embodiment of method, no detailed explanation will be given here.
According to the processing unit for the event that the embodiment of the present disclosure provides, by detecting on browser interface first When the trigger event of element, record the label and mark of the first element, after receiving event replay instruction, based on label and Mark transfers the corresponding execution code of trigger event, and executes playback operation according to code is executed.Realize trigger event Automatic playback, and do not have to related personnel and be manually operated again, it avoids manually repeating inefficient operation, improves exploitation testing efficiency.And And when embodiment of the present disclosure record event action, other than capturing trigger event type, it is only necessary to record the element of trigger event Label and mark, without recording code, playback when, do not need matching label substance text, so as to compatibility Multilingual, for example website is there are when multilingual, even if still can correctly play back after switching language, improve the thing of record The availability of part operation.
The another embodiment of the disclosure does further supplementary explanation to device provided by the above embodiment.
As a kind of enforceable mode, on the basis of the above embodiments, optionally, logging modle is specifically used for:
Obtain the label of the first element;Judge the element ID whether in html page with the first element;If so, and member Plain ID is uniquely, using element ID as the mark of the first element in html page;Record the label and mark of the first element Know.
Optionally, logging modle is also used to: if in html page also at least one other element element ID with The element ID of first element is identical, and the label of at least one other element is identical as the label of the first element, obtains first yuan ID serial number of the element ID of element in html page;By the ID serial number of the element ID of the first element and the element ID of the first element Mark as the first element.
Optionally, logging modle is also used to: if not having the element ID of the first element in html page, judging HTML page Whether there is the class name of the first element in face;If so, and class name is uniquely, using class name as first yuan in html page The mark of element.
Optionally, logging modle is also used to: if in html page also at least one other element class name with The class name of first element is identical, and the label of at least one other element is identical as the label of the first element, obtains the first element Class name serial number of the class name in html page;Using the class name serial number of the class name of the first element and the class name of the first element as The mark of first element.
Optionally, logging modle is also used to: if not having the class name of the first element in html page, obtaining the first element Parent element element ID or class name, using the tag path between parent element and the first element as the mark of the first element Know.
As another enforceable mode, on the basis of the above embodiments, optionally, logging modle is specific to use In: when the number of the first element is multiple, according to the trigger sequence of the trigger event of each first element, serializing ground record The label and mark of each first element.
As another enforceable mode, optionally, logging modle is also used to: being detected on browser interface When the trigger event of the first element, the event information of the trigger event of the first element is recorded.
Correspondingly, processing module, is specifically used for:
Based on label, mark and event information, the corresponding execution code of trigger event is transferred, and is held according to code is executed Row operation identical with trigger event.
About the device in the embodiment of the present disclosure, the concrete mode that wherein modules execute operation is somebody's turn to do related It is described in detail in the embodiment of method, no detailed explanation will be given here.
It should be noted that each enforceable mode can individually be implemented in the embodiment of the present disclosure, can also not conflict In the case where in any combination combine implement the disclosure without limitation.
According to the processing unit of the event of the embodiment of the present disclosure, by detecting to the first element on browser interface Trigger event when, record the first element label and mark, receive event replay instruction after, be based on label and mark, The corresponding execution code of trigger event is transferred, and executes playback operation according to code is executed.The automatic of trigger event is realized to return It puts, and does not have to related personnel and be manually operated again, avoid manually repeating inefficient operation, improve exploitation testing efficiency.And this public affairs When opening embodiment record event action, other than capturing trigger event type, it is only necessary to record the label of the element of trigger event , in playback, matching label substance text is not needed, so as to a variety of languages of compatibility without recording code with mark Speech, for example website is there are when multilingual, even if still can correctly play back after switching language, improve the event action of record Availability.
Disclosure another embodiment provides a kind of electronic equipment, for executing method provided by the above embodiment.
As shown in figure 4, the structural schematic diagram of the electronic equipment provided for the embodiment of the present disclosure.The electronic equipment 50 includes: At least one processor 51 and memory 52;
Memory stores computer program;At least one processor executes the computer program of memory storage, to realize Method provided by the above embodiment.
According to the electronic equipment of the embodiment of the present disclosure, by detecting the triggering to the first element on browser interface When event, the label and mark of the first element are recorded, after receiving event replay instruction, label and mark is based on, transfers touching The corresponding execution code of hair event, and playback operation is executed according to code is executed.The automatic playback of trigger event is realized, and It is manually operated again without related personnel, avoids manually repeating inefficient operation, improve exploitation testing efficiency.And the disclosure is real When applying example record event action, other than capturing trigger event type, it is only necessary to record the label and mark of the element of trigger event Knowledge, in playback, does not need matching label substance text without recording code, so as to be compatible with multilingual, than If website is there are when multilingual, even if still can correctly play back after switching language, improve the event action of record can The property used.
In a kind of exemplary embodiment, optionally, as shown in figure 5, being set for the electronics suitable for the embodiment of the present disclosure Standby 800 structural schematic diagram.Electronic equipment 800 may include processing unit (such as central processing unit, graphics processor etc.) 801, random visit can be loaded into according to the program being stored in read-only memory (ROM) 802 or from storage device 808 It asks the program in memory (RAM) 803 and executes various movements appropriate and processing.In RAM 803, it is also stored with electronics Equipment 800 operates required various programs and data.Processing unit 801, ROM 802 and RAM 803 by bus 804 that This is connected.Input/output (I/O) interface 805 is also connected to bus 804.
In general, following device can connect to I/O interface 805: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 806 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 807 of dynamic device etc.;Storage device 808 including such as tape, hard disk etc.;And communication device 809.Communication dress It sets 809 and can permit electronic equipment 800 and wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 5 is shown Electronic equipment 800 with various devices, it should be understood that being not required for implementing or having all devices shown. It can alternatively implement or have more or fewer devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable Jie Computer program in matter, the computer program include the program code for method shown in execution flow chart.Such In embodiment, which can be downloaded and installed from network by communication device 809, or from storage device 808 are mounted, or are mounted from ROM 802.When the computer program is executed by processing unit 801, it is real to execute the disclosure Apply the above-mentioned function of limiting in the method for example.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or Computer readable storage medium either the two any combination.Computer readable storage medium for example can be --- But be not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above group It closes.The more specific example of computer readable storage medium can include but is not limited to: have being electrically connected for one or more conducting wires It connects, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type programmable Reading memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic are deposited Memory device or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium, which can be, any includes Or the tangible medium of storage program, which can be commanded execution system, device or device use or in connection make With.And in the disclosure, computer-readable signal media may include in a base band or as carrier wave a part propagate number It is believed that number, wherein carrying computer-readable program code.The data-signal of this propagation can take various forms, packet Include but be not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be Any computer-readable medium other than computer readable storage medium, the computer-readable signal media can send, propagate Either transmission is for by the use of instruction execution system, device or device or program in connection.It is computer-readable The program code for including on medium can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) Etc. or above-mentioned any appropriate combination.
The another embodiment of the disclosure provides a kind of computer readable storage medium, deposits in the computer readable storage medium Computer program is contained, computer program is performed the method for realizing that any of the above-described embodiment provides.
According to the computer readable storage medium of the embodiment of the present disclosure, by detecting on browser interface first When the trigger event of element, record the label and mark of the first element, after receiving event replay instruction, based on label and Mark transfers the corresponding execution code of trigger event, and executes playback operation according to code is executed.Realize trigger event Automatic playback, and do not have to related personnel and be manually operated again, it avoids manually repeating inefficient operation, improves exploitation testing efficiency.And And when embodiment of the present disclosure record event action, other than capturing trigger event type, it is only necessary to record the element of trigger event Label and mark, without recording code, playback when, do not need matching label substance text, so as to compatibility Multilingual, for example website is there are when multilingual, even if still can correctly play back after switching language, improve the thing of record The availability of part operation.
In several embodiments provided by the disclosure, it should be understood that disclosed device and method can pass through Other modes are realized.For example, the apparatus embodiments described above are merely exemplary, for example, the unit is drawn Point, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, device or unit it is indirect Coupling or communication connection can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, as unit The component of display may or may not be physical unit, it can and it is in one place, or may be distributed over more In a network unit.Some or all of unit therein can be selected to realize the embodiment of the present disclosure according to the actual needs The purpose of scheme.
It, can also be in addition, each functional unit in each embodiment of the disclosure can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit, can store computer-readable at one In storage medium.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that an electronics It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the disclosure The part steps of a embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk Etc. the various media that can store program code.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each functional module Division progress for example, in practical application, can according to need and above-mentioned function distribution is complete by different functional modules At the internal structure of device being divided into different functional modules, to complete all or part of the functions described above. The specific work process of the device of foregoing description, can refer to corresponding processes in the foregoing method embodiment, no longer superfluous herein It states.
Finally, it should be noted that the above various embodiments is only to illustrate the technical solution of the disclosure, rather than its limitations; Although the disclosure is described in detail referring to foregoing embodiments, those skilled in the art should understand that: its It is still possible to modify the technical solutions described in the foregoing embodiments, or special to some or all of technologies Sign is equivalently replaced;And these are modified or replaceed, each embodiment of the disclosure that it does not separate the essence of the corresponding technical solution The range of technical solution.

Claims (11)

1. a kind of processing method of event characterized by comprising
When detecting to the trigger event of the first element on browser interface, the label and mark of first element are recorded;
Event replay instruction is received, the event replay instruction includes the label and mark of first element;
Based on the label and the mark, the corresponding execution code of the trigger event is transferred, and according to the execution code Execute playback operation.
2. the method according to claim 1, wherein the label and mark for recording first element, packet It includes:
Obtain the label of first element;
Judge the element ID whether in html page with first element;
If so, and the element ID is uniquely, using the element ID as the mark of first element in html page;
Record the label and mark of first element.
3. according to the method described in claim 2, it is characterized in that, if also having in the html page at least one other The element ID of element is identical as the element ID of first element, and the label of at least one other element and described first The label of element is identical, obtains ID serial number of the element ID of first element in the html page;
Using the ID serial number of the element ID of first element and the element ID of first element as the mark of first element Know.
4. according to the method described in claim 2, it is characterized in that, if not having first element in the html page Element ID, the method also includes:
Judge the class name whether in the html page with first element;
If so, and the class name is uniquely, using the class name as the mark of first element in the html page.
5. according to the method described in claim 4, it is characterized in that, if also having in the html page at least one other The class name of element is identical as the class name of first element, and the label of at least one other element and first element Label it is identical, obtain class name serial number of the class name of first element in the html page;
Using the class name serial number of the class name of first element and the class name of first element as the mark of first element.
6. according to the method described in claim 4, it is characterized in that, if not having first element in the html page Class name obtains the element ID or class name of the parent element of first element, by the parent element and first element it Between mark of the tag path as first element.
7. the method according to claim 1, wherein when the number of first element be it is multiple when, the note Record the label and mark of first element, comprising:
According to the trigger sequence of the trigger event of each first element, serializing ground record the label of each first element with Mark.
8. method according to claim 1-7, which is characterized in that detecting to first yuan on browser interface When the trigger event of element, the method also includes:
Record the event information of the trigger event of first element;
It is described to be based on the label and the mark, the corresponding execution code of the trigger event is transferred, and according to the execution Code executes playback operation, comprising:
Based on the label, the mark and the event information, the corresponding execution code of the trigger event is transferred, and according to The execution code executes operation identical with the trigger event.
9. a kind of processing unit of event characterized by comprising
Logging modle, for recording first element when detecting to the trigger event of the first element on browser interface Label and mark;
Receiving module, for receiving event replay instruction, the event replay instruction includes the label and mark of first element Know;
Processing module transfers the corresponding execution code of the trigger event for being based on the label and the mark, and according to The execution code executes playback operation.
10. a kind of electronic equipment characterized by comprising at least one processor and memory;
The memory stores computer program;At least one described processor executes the computer journey of the memory storage Sequence, to realize method of any of claims 1-8.
11. a kind of computer readable storage medium, which is characterized in that be stored with computer journey in the computer readable storage medium Sequence, the computer program, which is performed, realizes method of any of claims 1-8.
CN201910315100.6A 2019-04-18 2019-04-18 Processing method, device, electronic equipment and the storage medium of event Pending CN110209570A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910315100.6A CN110209570A (en) 2019-04-18 2019-04-18 Processing method, device, electronic equipment and the storage medium of event

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910315100.6A CN110209570A (en) 2019-04-18 2019-04-18 Processing method, device, electronic equipment and the storage medium of event

Publications (1)

Publication Number Publication Date
CN110209570A true CN110209570A (en) 2019-09-06

Family

ID=67785487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910315100.6A Pending CN110209570A (en) 2019-04-18 2019-04-18 Processing method, device, electronic equipment and the storage medium of event

Country Status (1)

Country Link
CN (1) CN110209570A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102142016A (en) * 2010-01-29 2011-08-03 微软公司 Cross-browser interactivity recording, playback and editing
CN103365779A (en) * 2013-07-09 2013-10-23 广东欧珀移动通信有限公司 Software test method and system
CN106897347A (en) * 2016-08-15 2017-06-27 阿里巴巴集团控股有限公司 A kind of web page display method, Action Events recording method and device
CN109254910A (en) * 2018-08-08 2019-01-22 北京城市网邻信息技术有限公司 A kind of test method of application program, device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102142016A (en) * 2010-01-29 2011-08-03 微软公司 Cross-browser interactivity recording, playback and editing
US20110191676A1 (en) * 2010-01-29 2011-08-04 Microsoft Corporation Cross-Browser Interactivity Recording, Playback, and Editing
CN103365779A (en) * 2013-07-09 2013-10-23 广东欧珀移动通信有限公司 Software test method and system
CN106897347A (en) * 2016-08-15 2017-06-27 阿里巴巴集团控股有限公司 A kind of web page display method, Action Events recording method and device
CN109254910A (en) * 2018-08-08 2019-01-22 北京城市网邻信息技术有限公司 A kind of test method of application program, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN105940654B (en) Franchise static web application in trust
US8977739B2 (en) Configurable frame work for testing and analysis of client-side web browser page performance
CN108052334A (en) Method for page jump, device, computer equipment and storage medium
CN104461903B (en) The method and apparatus of test client based on browser
CN107783899A (en) The method of testing of the H5 pages, device and computer equipment in application program
CN102520841A (en) Collection user interface
CN109302461A (en) Information displaying, processing method, medium, system and calculating equipment
CN111966255B (en) Information display method and device, electronic equipment and computer readable medium
CN108345543A (en) A kind of data processing method, device, equipment and storage medium
CN104102578B (en) Test method and system and operation terminal
CN106293965A (en) The method of the hardware resource of hardware resource access system and access electronic installation thereof
CN109614318A (en) Automated testing method, device, electronic equipment and computer-readable medium
CN107729246A (en) For the auxiliary test methods of intended application, device, equipment and storage medium
CN109388376A (en) Risk of software development appraisal procedure, device, equipment and readable storage medium storing program for executing
CN111045653B (en) System generation method and device, computer readable medium and electronic equipment
CN106951495A (en) Method and apparatus for information to be presented
CN109669596A (en) Method and apparatus for showing chat message
CN111736918B (en) Buried point configuration method and device and electronic equipment
CN110134869A (en) A kind of information-pushing method, device, equipment and storage medium
CN113590974A (en) Recommendation page configuration method and device, electronic equipment and computer readable medium
CN108334516A (en) Information-pushing method and device
CN107480055A (en) Method of testing, device, calculate readable storage medium storing program for executing and computing device
CN109240928A (en) A kind of test method, device, equipment and storage medium
CN111400581B (en) System, method and apparatus for labeling samples
CN109857473A (en) A kind of loading method and device of page data

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