CN111552643A - Multi-browser webpage access synchronization method and system - Google Patents

Multi-browser webpage access synchronization method and system Download PDF

Info

Publication number
CN111552643A
CN111552643A CN202010344986.XA CN202010344986A CN111552643A CN 111552643 A CN111552643 A CN 111552643A CN 202010344986 A CN202010344986 A CN 202010344986A CN 111552643 A CN111552643 A CN 111552643A
Authority
CN
China
Prior art keywords
test
browser
operation information
uniform resource
resource locator
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
CN202010344986.XA
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010344986.XA priority Critical patent/CN111552643A/en
Publication of CN111552643A publication Critical patent/CN111552643A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Abstract

The application relates to the technical field of computers, in particular to a multi-browser webpage access synchronization method which can be applied to an intelligent security scene. Based on the test technology, when a proxy server receives a first webpage test access request sent by a test browser in a test browser cluster, a response page is fed back to the test browser in the test browser cluster, a synchronous script is injected into the test browser, so that the synchronous script monitors operation information of each test browser and protocol data streams containing the operation information, when the operation information is monitored, the operation information is sent to other test browsers, and when the synchronous script monitors the protocol data streams containing the operation information, the test browser is controlled to execute corresponding operation according to the operation information, so that any test browser can be used as a main test browser, and the other test browsers can synchronize the operation of the main test browser. The efficiency of webpage compatibility test is improved.

Description

Multi-browser webpage access synchronization method and system
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and a system for synchronizing access to multiple browser webpages.
Background
With the rapid development of internet technology, various information of the internet is basically displayed to users in the form of web pages. Such as: html 5(html 5 is a language description way of constructing Web content) page.
Taking html5 page as an example, after html5 page is made, developers need to perform compatibility tests on mobile devices of different browsers, different resolutions, different kernels and different systems, and issue html5 page after the compatibility tests pass. In order to improve the efficiency of the compatibility test, a main browser and a plurality of auxiliary browsers can be preset, and a tester can test the compatibility of a plurality of browsers or a plurality of mobile devices to the html5 page at one time by operating the main browser.
In the current testing mode, since the operation of the master browser is monitored through a script inserted in the master browser, and a webpage element is driven and controlled by a self webdriver (a testing framework of a Web automation testing tool) of the slave browser according to the monitored operation, the slave browser and the master browser do the same operation, the master browser cannot be changed, one master browser and a plurality of slave browsers need to be preset before testing, and a user can only operate the master browser in the testing process, so that the working efficiency of the webpage compatibility testing is low.
Disclosure of Invention
Therefore, it is necessary to provide a method and a system for synchronizing access to a multi-browser webpage, which improve the working efficiency of the webpage compatibility test, in order to solve the above technical problems.
A multi-browser web page access synchronization method, the method comprising:
when a proxy server receives a first webpage test access request sent by a test browser in a test browser cluster, acquiring a corresponding first response page from a browser server based on the first webpage test access request;
the proxy server sends the first response page and the synchronous script to the test browsers, so that the synchronous script is injected into each test browser in the test browser cluster, and the operation information of each test browser and the protocol data stream containing the operation information are monitored;
and when the synchronous script in any one test browser in the test browser cluster monitors the operation information, sending a protocol data stream containing the operation information to other test browsers in the test browser cluster, so that the synchronous scripts of other test browsers control other test browsers to execute the operation corresponding to the operation information according to the protocol data stream containing the operation information.
In one embodiment, the method for controlling, by the synchronization script, the test browser to execute the operation corresponding to the operation information according to the monitored protocol data stream containing the operation information includes:
the synchronous script analyzes according to the operation information to obtain data in the key and data of the value;
and the synchronous script calls an execution interface of the test browser according to the data in the key and the value data to enable the test browser to execute the operation corresponding to the operation information.
In one embodiment, when a proxy server receives a first web page test access request sent by a test browser in a test browser cluster, before the step of obtaining a corresponding first response page from the browser server based on the first web page access request, the method further includes:
when the proxy server receives a synchronous access configuration request, acquiring configuration information in the synchronous access configuration request, wherein the configuration information comprises a uniform resource locator of a server needing synchronous access;
and the proxy server generates a corresponding local uniform resource locator according to the uniform resource locator needing synchronous access and stores the local uniform resource locator into the container server.
In one embodiment, the method further comprises:
when the proxy server receives a second webpage test access request of a main test browser, a local uniform resource locator in the second webpage test access request is obtained, and the main test browser is a test browser of which the operation information is monitored by a synchronous script in the test browser cluster;
the proxy server acquires a corresponding server uniform resource locator according to the local uniform resource locator;
the proxy server modifies the local uniform resource locator in the second webpage test access request into the server uniform resource locator to obtain a modified second webpage test access request;
the proxy server sends the modified second webpage test access request to a browser server;
the proxy server receives a second response page fed back by the browser server according to the modified second webpage test access request;
and the proxy server sends the second response page to the main test browser.
In one embodiment, after the step of receiving a second response page fed back by the browser server according to the modified second web page test access request, the method further includes:
and the proxy server stores the local uniform resource locator and the second response page into a container server in a key-value pair mode.
In one embodiment, the method further comprises:
when the proxy server receives a third webpage test access request sent by a slave test browser according to the operation information of the master test browser, acquiring a local uniform resource locator in the third webpage test access request, wherein the slave test browser is a test browser in the test browser cluster except the master test browser, and the local uniform resource locator in the third webpage test access request is the same as the local uniform resource locator in the second webpage test access request;
the proxy server acquires the second response page corresponding to the local uniform resource locator from the container server according to the local uniform resource locator;
the proxy server sends the second response page to the slave test browser.
In one embodiment, the method for monitoring the operation information of the test browser by the synchronization script comprises the following steps:
and the synchronous script calls an operation information acquisition interface of the test browser to monitor the operation information of the test browser.
In one embodiment, the method further comprises: and after the synchronous script is injected into each test browser in the test browser cluster, the synchronous script starts an automatic screen recording of the test browser to perform operation recording, operation recording data are obtained, and the recording data are uploaded to a block chain.
A multi-browser web page access synchronization system, the system comprising: the system comprises a proxy server, a browser server and a test browser cluster;
when the proxy server receives a first webpage test access request sent by a test browser in the test browser cluster, acquiring a corresponding first response page from a browser server based on the first webpage test access request;
the proxy server sends the first response page and the synchronous script to the test browsers, so that the synchronous script is injected into each test browser in the test browser cluster, and the operation information of each test browser and the protocol data stream containing the operation information are monitored;
and when the synchronous script in any one test browser in the test browser cluster monitors the operation information, sending a protocol data stream containing the operation information to other test browsers in the test browser cluster, so that the synchronous scripts of other test browsers control other test browsers to execute the operation corresponding to the operation information according to the protocol data stream containing the operation information.
In one embodiment, the proxy server obtains configuration information in the synchronous access configuration request when receiving the synchronous access configuration request, wherein the configuration information comprises a uniform resource locator of the server needing synchronous access;
and the proxy server generates a corresponding local uniform resource locator according to the uniform resource locator needing synchronous access and stores the local uniform resource locator into the container server.
According to the multi-browser webpage access synchronization method and system, when a proxy server receives a first webpage test access request sent by a test browser in a test browser cluster, a response page is fed back to the test browser in the test browser cluster, a synchronization script is injected into the test browser, the synchronization script monitors operation information of each test browser and protocol data streams containing the operation information, when the operation information is monitored, the operation information is sent to other test browsers, and when the synchronization script monitors the protocol data streams containing the operation information, the test browser is controlled to execute corresponding operation according to the operation information, so that any test browser can be used as a main test browser, and the other test browsers can synchronize the operation of the main test browser. When the webpage compatibility test is carried out, the main test browser can be replaced at will to operate the webpage to be tested, the webpage compatibility test is completed, and the efficiency of the webpage compatibility test is improved.
Drawings
FIG. 1 is a diagram illustrating an exemplary implementation of a method for synchronizing access to web pages in multiple browsers;
FIG. 2 is a schematic flowchart illustrating a method for synchronizing access to multiple browser pages in one embodiment;
FIG. 3 is a block diagram of a multi-browser web page access synchronization system in one embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The multi-browser webpage access synchronization method provided by the application can be applied to the application environment shown in fig. 1. Therein, the test browser cluster 102 communicates with the proxy server 104 via a network, and the proxy server 104 communicates with the browser server 106 via a network. When the proxy server 104 receives a first web page test access request sent by a test browser in the test browser cluster 102, acquiring a corresponding first response page from the browser server 106 based on the first web page test access request; the proxy server 104 sends a first response page and a synchronous script to the test browsers, so that the synchronous script is injected into each test browser in the test browser cluster 102, and the operation information of each test browser and the protocol data stream containing the operation information are monitored; when the operation information is monitored by the synchronous script in any test browser in the test browser cluster 102, sending a protocol data stream containing the operation information to other test browsers in the test browser cluster 102, so that the synchronous scripts of the other test browsers control the other test browsers to execute the operation corresponding to the operation information according to the protocol data stream containing the operation information monitored by the synchronous script. Each test browser in the test browser cluster 102 is installed on a terminal to operate, the terminal may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the proxy server 104 and the browser server 106 may be implemented by independent servers or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, there is provided a multi-browser web page access synchronization method, comprising the steps of:
step S220, when the proxy server receives a first web page test access request sent by a test browser in the test browser cluster, acquiring a corresponding first response page from the browser server based on the first web page test access request.
The proxy server is an intermediate proxy mechanism between a personal network and an Internet service provider, is responsible for forwarding legal network information, controlling and registering forwarding, and is used for intercepting all access requests and response pages of a test browser in a test browser cluster. The test browser cluster is a cluster of more than two browsers needing to access to a webpage to be tested, each test browser in the test browser cluster is a client installed on a terminal for a user to use, each test browser in the test browser cluster can be a browser of a different type or a browser of the same type, and the types of the browsers are as follows: IE browser, Firefox browser, google browser, QQ browser, etc.
The first web page test access request is an access request sent by a test browser in a test browser cluster when the test browser opens the browser, the access request can be a request for opening a homepage of the browser, or a request for directly opening a web page to be tested according to a website, the first web page test access request sent by each test browser in the test browser cluster accesses the same website, and the obtained response pages are the same. The first response page is response data acquired according to the first webpage test access request. The browser server is a Web server, is a website server for providing online information browsing service, is a program residing on a certain type of computer on the internet, can provide documents to a Web client such as a browser and the like, can also place website files for browsing all over the world, and can place data files for downloading all over the world.
Step S240, the proxy server sends the first response page and the synchronization script to the test browser, so that the synchronization script is injected into each test browser in the test browser cluster, and monitors the operation information of each test browser and the protocol data stream containing the operation information.
The synchronous script is a script program written by adopting a script language (such as JavaScript, VBscript and the like) according to the test requirement, and the written script program needs to meet the functions of calling an operation information acquisition interface of the test browser and calling an execution interface of the test browser, so that the synchronous script runs in each test browser, the operation of monitoring user operation by calling the operation information acquisition interface of the browser is realized, and the same operation is executed by calling the execution interface of the browser. The operation information is data monitored when a tester operates the test browser, such as: click, slide, etc. The protocol data stream containing the operation information is a data stream containing the operation information transmitted from a test browser operated by a test person. And the synchronous scripts of all the test browsers in the test browser cluster respectively monitor whether the operation information is received or a protocol data stream containing the operation information is received.
Step S260, when the operation information is monitored by the synchronous script in any test browser in the test browser cluster, sending a protocol data stream containing the operation information to other test browsers in the test browser cluster, and enabling the synchronous scripts of the other test browsers to control the other test browsers to execute the operation corresponding to the operation information according to the monitored protocol data stream containing the operation information.
Wherein, when the tester has selected a test browser in the test browser cluster to operate, the synchronous script in the operated test browser can monitor that there is operation information, and the synchronous script records control information, if: the synchronous script monitors click operation, and the synchronous script is stored as key: value format, key is id of operated element, Value is operation action click. The other test browsers in the test browser cluster are test browsers other than the test browser monitored for the operation information in the test browser cluster. The protocol data stream is a data stream transmitted by a test browser except a test browser monitored to operation information in the test browser cluster to other test browsers in the test browser cluster through webwake (webwake is a full-duplex communication protocol based on TCP, and is an independent protocol created on TCP), such as: except that the test browser monitored the operation information transmits the operation information to the container server through the websocket, the container server transmits the operation information to other test browsers, and the container server is a server deployed together with the proxy server.
In one scenario, a user triggers a confirmation control of a current page of a test browser A in a test browser cluster by clicking, a synchronous script in the test browser A monitors that the confirmation control of the current page is clicked, the synchronous script records information that the confirmation control of the current page is triggered, the synchronous script in the test browser A takes the triggered information of the confirmation control of the current page as operation information, and the operation information is packaged into a protocol data stream through websobe and is sent to all test browsers except the test browser A in the test browser cluster. And receiving the synchronous script of the test browser of the protocol data stream, and controlling the test browser to execute the operation corresponding to the operation information according to the operation information in the protocol data stream.
In the multi-browser webpage access synchronization method, when a proxy server receives a first webpage test access request sent by a test browser in a test browser cluster, a response page is fed back to the test browser in the test browser cluster, a synchronization script is injected into the test browser, so that the synchronization script monitors operation information of each test browser and protocol data streams containing the operation information, when the operation information is monitored, the operation information is sent to other test browsers, and when the synchronization script monitors the protocol data streams containing the operation information, the test browser is controlled to execute corresponding operation according to the operation information, so that any test browser can be used as a main test browser, and the other test browsers can synchronize the operation of the main test browser. When the webpage compatibility test is carried out, the main test browser can be replaced at will to operate the webpage to be tested, the webpage compatibility test is completed, and the efficiency of the webpage compatibility test is improved. The scheme of the application can be applied to scenes such as security monitoring and the like of intelligent security, so that the construction of an intelligent city is promoted.
In one embodiment, the method for controlling the test browser to execute the operation corresponding to the operation information by the synchronization script according to the monitored protocol data stream containing the operation information includes:
analyzing the synchronous script according to the operation information to acquire data in the key and value data; and the synchronous script calls an execution interface of the test browser according to the data in the key and the value data to enable the test browser to execute the operation corresponding to the operation information.
When the synchronous script monitors the protocol data stream sent by the container server, the operation information in the protocol data stream is obtained, the operation information is analyzed, the corresponding operation is determined, and the synchronous script calls an execution interface of the test browser to execute the same operation, such as: the operation information in the protocol data stream is that id of an operation element of a key is XXX, Value is data in an operation action click format, the data in the key and the data of Value are obtained, it is determined that the operation element with id of XXX is clicked, the synchronous script calls an execution interface of the test browser, and the test browser is controlled to execute the operation of clicking the operation element with id of XXX. And controlling the test browser to execute and correspond to the operation according to the operation information through the synchronous script, so as to realize synchronous operation of the master test browser and the slave test browser.
In one embodiment, when the proxy server receives a first web page test access request sent by a test browser in the test browser cluster, before the step of obtaining a corresponding first response page from the browser server based on the first web page access request, the multi-browser web page access synchronization method further includes:
when the proxy server receives the synchronous access configuration request, acquiring configuration information in the synchronous access configuration request, wherein the configuration information comprises a uniform resource locator of the server needing synchronous access; and the proxy server generates a corresponding local uniform resource locator according to the uniform resource locator needing synchronous access and stores the local uniform resource locator into the container server.
The synchronous access configuration request is used for adding a webpage address to be tested and preprocessing the webpage address to be tested. The server uniform resource locator refers to a webpage address stored in the Web server, and the server uniform resource locator needing synchronous access refers to a webpage address stored in the Web server of a webpage needing to be tested. The preprocessing of the web page address to be tested means that a corresponding local uniform resource locator is generated according to the uniform resource locator to be synchronously accessed and stored in the container server, so that the test browser in the test browser cluster can obtain a response page corresponding to the web page to be tested through the local uniform resource locator. And generating a corresponding local uniform resource locator according to the uniform resource locator to be synchronously accessed, so that the test browsers in the test browser cluster can obtain the same response page through the local uniform resource locator.
In one embodiment, the multi-browser web page access synchronization method further comprises: when the proxy server receives a second webpage test access request of the main test browser, a local uniform resource locator in the second webpage test access request is obtained, and the main test browser is a test browser of which the operation information is monitored by the synchronous script in the test browser cluster; the proxy server acquires a corresponding server uniform resource locator according to the local uniform resource locator; the proxy server modifies the local uniform resource locator in the second webpage test access request into a server uniform resource locator to obtain a modified second webpage test access request; the proxy server sends the modified second webpage test access request to the browser server; the proxy server receives a second response page fed back by the browser server according to the modified second webpage test access request; the proxy server sends a second response page to the primary test browser.
The second webpage test access request is a request sent by the main test browser after the first webpage test access request is sent, and all the requests sent by the main test browser after the first webpage test access request are second webpage test access requests. The main test browser is a test browser which is monitored to the operation information by the synchronous script in the test browser cluster. The second response page is response data acquired according to the second web page test access request, namely, a web page corresponding to the URL in the second web page test access request.
In one embodiment, after the step of receiving a second response page fed back by the browser server according to the modified second web test access request, the multi-browser web access synchronization method further includes: and the proxy server stores the local uniform resource locator and the second response page into the container server in a key-value pair mode.
Wherein a key-value pair is each key followed by a corresponding value. The value is the response page and the key is the local uniform resource locator. A unique response page may be determined by a local uniform resource locator. When the main test browser sends the second webpage test access request of the same local uniform resource locator again, the values in the corresponding key value pairs are updated, for example: the main test browser sends a second webpage test access request carrying a local uniform resource locator A, and the proxy server modifies the local uniform resource locator A in the second webpage test access request into a server uniform resource locator A1 to obtain a modified second webpage test access request; forwarding the modified second webpage test access request to a browser server, acquiring a second response page a, and storing the local uniform resource locator A and the second response page a into an associated container in a key value pair mode; and when the proxy server receives a second webpage test access request carrying the local uniform resource locator A sent by the main test browser again, acquiring a second response page b from the browser server in a mode of acquiring the second response page a, and replacing the second response page a corresponding to the local uniform resource locator A in the associated container with the second response page b. The local uniform resource locator and the second response page are stored in a key value pair mode, and when the slave test browser accesses the local uniform resource locator and the second response page, the second response page can be directly fed back to the slave test browser. By updating the values in the corresponding key value pairs in real time, the second response page obtained from the test browser can be consistent with that obtained from the main test browser.
In one embodiment, the multi-browser web page access synchronization method further comprises: when the proxy server receives a third webpage test access request sent by the slave test browser according to the operation information of the master test browser, a local uniform resource locator in the third webpage test access request is obtained, the slave test browser is a test browser except the master test browser in the test browser cluster, and the local uniform resource locator in the third webpage test access request is the same as the local uniform resource locator in the second webpage test access request; the proxy server acquires a second response page corresponding to the local uniform resource locator from the container server according to the local uniform resource locator; and sending a second response page to the slave test browser.
The third webpage test access request is a request sent by the test browser after the first webpage test access request is sent, and all the requests sent by the test browser after the first webpage test access request are the second webpage test access requests. The requests sent from the test browsers are correspondingly sent on the premise that the main test browser sends the requests, namely: and the slave test browser controls the slave test browser to send a third webpage test access request for obtaining the response page c according to the protocol data stream containing the operation information monitored by the synchronous script. And acquiring a second response page corresponding to the local uniform resource locator from the container server, so that the second response page acquired from the test browser is consistent with that acquired from the main test browser.
In one embodiment, the manner in which the synchronization script monitors operational information of the test browser includes:
and calling the operation information acquisition interface of the test browser by the synchronous script to monitor the operation information of the test browser.
The operation information acquisition interface is an interface which is opened by the test browser and used for acquiring the operation information. When the synchronous script calls an operation information acquisition interface of the test browser to acquire the operation information, recording the operation information for monitoring the operation information, and if: the synchronous script monitors click operation, and the synchronous script is stored as key: value format, key is id of operated element, Value is operation action click. And transmitting the operation information to the container server through the websoket, and then sending the operation information to other test browsers in the test browser cluster by the container server. And monitoring the operation information of the test browser by calling an operation information acquisition interface of the test browser, and determining whether the test browser is the main test browser.
In one embodiment, the multi-browser webpage access synchronization method further comprises: after the synchronous script is injected into each test browser in the test browser cluster, the synchronous script starts an automatic screen recording of the test browser to perform operation recording, operation recording data are obtained, and the recording data are uploaded to a block chain.
And starting automatic screen recording of each test browser in the test browser cluster, and starting the automatic screen recording by using a synchronous script injected by each test browser. When the test is started, the synchronous script starts an automatic screen recording of the test browser to perform operation recording, operation recording data are obtained, the operation recording data comprise logs, operation screenshots, videos and the like, and result analysis can be performed according to the recorded logs, operation screenshots and videos subsequently. After the synchronous script is injected into the test browser, the automatic screen recording function, the automatically recorded log, the operation screenshot and the like are started through the synchronous script, and the result analysis can be subsequently performed according to the recorded log and the operation screenshot.
The corresponding digest information is obtained based on the recorded data, and specifically, the digest information is obtained by hashing the recorded data, for example, using the sha256s algorithm. Uploading summary information to the blockchain can ensure the safety and the fair transparency of the user. The user equipment may download the summary information from the blockchain to verify whether the recorded data is tampered.
In one embodiment, the embodiment relates to a test browser cluster, a proxy server, a container server and a browser server, wherein the test browser cluster comprises more than two slave test browsers, the proxy server and the container server are deployed together and are equivalent to auxiliary equipment of the proxy server, the test browsers in the test browser cluster are installed on a terminal, and data sent or received by the test browsers are sent or received through the terminal. The synchronization process is exemplified in connection with a specific multi-browser web page access.
And starting a proxy server and a container server, wherein the proxy server is responsible for intercepting the webpage test access requests (the webpage test access requests comprise a first webpage test access request, a second webpage test access request and a third webpage test access request) of the test browsers and response data corresponding to the webpage test access requests, the proxy server places the intercepted response data in the container server, and the proxy server provides the response data for all the test browsers.
The method comprises the steps that a proxy server injects a synchronous script into each test browser when each test browser in a test browser cluster accesses for the first time, the synchronous script injected by each test browser in the test browser cluster calls an operation information acquisition interface of the test browser to monitor user operation (namely operation information), such as page clicking, data input and the like, the test browser monitoring the operation information is a main test browser, the operation information of the main test browser is synchronized to other test browsers (slave test browsers) through websocket, and the synchronous scripts in the slave test browsers perform the same operation with the main test browser according to the received operation information. And when the test browser acquires the response page, acquiring a second response page corresponding to the local uniform resource locator from the container server, so that the second response page acquired from the test browser is consistent with the content acquired from the main test browser. Therefore, the effect of synchronizing the content and the operation in the master-slave test browser is realized, the batch management test is realized, and the master-slave test browser is selected independently.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 1, there is provided a multi-browser web page access synchronization system, comprising: testing a browser cluster 102, a proxy server 104, and a browser server 106, wherein:
when the proxy server 104 receives a first web test access request sent by a test browser in the test browser cluster 102, a corresponding first response page is acquired from the browser server 106 based on the first web test access request.
The proxy server 104 sends the first response page and the synchronization script to the test browsers, so that the synchronization script is injected into each test browser in the test browser cluster 102 to monitor the operation information of each test browser and the protocol data stream containing the operation information.
When the operation information is monitored by the synchronous script in any test browser in the test browser cluster 102, sending a protocol data stream containing the operation information to other test browsers in the test browser cluster 102, so that the synchronous scripts of the other test browsers control the other test browsers to execute the operation corresponding to the operation information according to the monitored protocol data stream containing the operation information.
In one embodiment, as shown in FIG. 3, the synchronization script of each test browser in the test browser cluster 102 is further used to: analyzing according to the operation information to determine operation data; and calling an execution interface of the test browser according to the operation data to enable the test browser to execute the operation corresponding to the operation information.
In one embodiment, the multi-browser web page access synchronization system further comprises the container server 108: when receiving the synchronous access configuration request, the proxy server 104 acquires configuration information in the synchronous access configuration request, wherein the configuration information includes a uniform resource locator of the server to be synchronously accessed; the proxy server 104 generates a corresponding local uniform resource locator according to the uniform resource locator to be accessed synchronously, and stores the local uniform resource locator in the container server 108.
In one embodiment, the proxy server 104 of the multi-browser web page access synchronization system is further configured to:
when a second webpage test access request of the main test browser is received, a local uniform resource locator in the second webpage test access request is obtained, and the main test browser is a test browser of which the operation information is monitored by the synchronous script in the test browser cluster 102; acquiring a corresponding server uniform resource locator according to the local uniform resource locator; modifying the local uniform resource locator in the second webpage test access request into a server uniform resource locator to obtain a modified second webpage test access request; sending the modified second webpage test access request to the browser server 106; receiving a second response page fed back by the browser server 106 according to the modified second webpage test access request; and sending a second response page to the main test browser.
In one embodiment, the proxy server 104 of the multi-browser web page access synchronization system is further configured to: the local uniform resource locator and the second response page are stored in the container server 108 in a key-value pair manner.
In one embodiment, the proxy server 104 of the multi-browser web page access synchronization system is further configured to: when a third webpage test access request sent by the slave test browser according to the operation information of the master test browser is received, a local uniform resource locator in the third webpage test access request is obtained, the slave test browser is a test browser in the test browser cluster 102 except the master test browser, and the local uniform resource locator in the third webpage test access request is the same as the local uniform resource locator in the second webpage test access request; acquiring a second response page corresponding to the local uniform resource locator from the container server 108 according to the local uniform resource locator; and sending a second response page to the slave test browser.
In one embodiment, the synchronization script of each test browser in the test browser cluster 102 is further configured to: and calling an operation information acquisition interface of the test browser to monitor the operation information of the test browser.
In one embodiment, the synchronization script of each test browser in the test browser cluster 102 is further configured to: after the synchronous script is injected into each test browser in the test browser cluster, the synchronous script starts an automatic screen recording of the test browser to perform operation recording, operation recording data are obtained, and the recording data are uploaded to a block chain.
For specific limitations of the multi-browser webpage access synchronization system, reference may be made to the above limitations of the multi-browser webpage access synchronization method, which is not described herein again. The modules in the multi-browser web page access synchronization system can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a multi-browser web page access synchronization method.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A multi-browser web page access synchronization method, the method comprising:
when a proxy server receives a first webpage test access request sent by a test browser in a test browser cluster, acquiring a corresponding first response page from a browser server based on the first webpage test access request;
the proxy server sends the first response page and the synchronous script to the test browsers, so that the synchronous script is injected into each test browser in the test browser cluster, and the operation information of each test browser and the protocol data stream containing the operation information are monitored;
and when the synchronous script in any one test browser in the test browser cluster monitors the operation information, sending a protocol data stream containing the operation information to other test browsers in the test browser cluster, so that the synchronous scripts of other test browsers control other test browsers to execute the operation corresponding to the operation information according to the protocol data stream containing the operation information.
2. The method according to claim 1, wherein the synchronous script controls a manner in which the test browser executes the operation corresponding to the operation information according to the monitored protocol data stream containing the operation information, and includes:
the synchronous script analyzes according to the operation information to obtain data in the key and data of the value;
and the synchronous script calls an execution interface of the test browser according to the data in the key and the value data to enable the test browser to execute the operation corresponding to the operation information.
3. The method of claim 1, wherein when a proxy server receives a first web page test access request sent by a test browser in a test browser cluster, before the step of obtaining a corresponding first response page from the browser server based on the first web page access request, the method further comprises:
when the proxy server receives a synchronous access configuration request, acquiring configuration information in the synchronous access configuration request, wherein the configuration information comprises a uniform resource locator of a server needing synchronous access;
and the proxy server generates a corresponding local uniform resource locator according to the uniform resource locator needing synchronous access and stores the local uniform resource locator into the container server.
4. The method of claim 3, further comprising:
when the proxy server receives a second webpage test access request of a main test browser, a local uniform resource locator in the second webpage test access request is obtained, and the main test browser is a test browser of which the operation information is monitored by a synchronous script in the test browser cluster;
the proxy server acquires a corresponding server uniform resource locator according to the local uniform resource locator;
the proxy server modifies the local uniform resource locator in the second webpage test access request into the server uniform resource locator to obtain a modified second webpage test access request;
the proxy server sends the modified second webpage test access request to a browser server;
the proxy server receives a second response page fed back by the browser server according to the modified second webpage test access request;
and the proxy server sends the second response page to the main test browser.
5. The method of claim 4, wherein after the step of receiving a second response page fed back by the browser server according to the modified second web test access request, the method further comprises:
and the proxy server stores the local uniform resource locator and the second response page into a container server in a key-value pair mode.
6. The method of claim 5, further comprising:
when the proxy server receives a third webpage test access request sent by a slave test browser according to the operation information of the master test browser, acquiring a local uniform resource locator in the third webpage test access request, wherein the slave test browser is a test browser in the test browser cluster except the master test browser, and the local uniform resource locator in the third webpage test access request is the same as the local uniform resource locator in the second webpage test access request;
the proxy server acquires the second response page corresponding to the local uniform resource locator from the container server according to the local uniform resource locator;
the proxy server sends the second response page to the slave test browser.
7. The method of claim 1, wherein the synchronization script monitors a manner of operation information of the test browser, comprising:
and the synchronous script calls an operation information acquisition interface of the test browser to monitor the operation information of the test browser.
8. The method of claim 1, further comprising:
and after the synchronous script is injected into each test browser in the test browser cluster, the synchronous script starts an automatic screen recording of the test browser to perform operation recording, operation recording data are obtained, and the recording data are uploaded to a block chain.
9. A multi-browser web page access synchronization system, the system comprising: the system comprises a proxy server, a browser server and a test browser cluster;
when the proxy server receives a first webpage test access request sent by a test browser in the test browser cluster, acquiring a corresponding first response page from a browser server based on the first webpage test access request;
the proxy server sends the first response page and the synchronous script to the test browsers, so that the synchronous script is injected into each test browser in the test browser cluster, and the operation information of each test browser and the protocol data stream containing the operation information are monitored;
and when the synchronous script in any one test browser in the test browser cluster monitors the operation information, sending a protocol data stream containing the operation information to other test browsers in the test browser cluster, so that the synchronous scripts of other test browsers control other test browsers to execute the operation corresponding to the operation information according to the protocol data stream containing the operation information.
10. The system according to claim 9, wherein the proxy server, upon receiving the synchronous access configuration request, obtains configuration information in the synchronous access configuration request, the configuration information including a uniform resource locator of the server to be accessed synchronously;
and the proxy server generates a corresponding local uniform resource locator according to the uniform resource locator needing synchronous access and stores the local uniform resource locator into the container server.
CN202010344986.XA 2020-04-27 2020-04-27 Multi-browser webpage access synchronization method and system Pending CN111552643A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010344986.XA CN111552643A (en) 2020-04-27 2020-04-27 Multi-browser webpage access synchronization method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010344986.XA CN111552643A (en) 2020-04-27 2020-04-27 Multi-browser webpage access synchronization method and system

Publications (1)

Publication Number Publication Date
CN111552643A true CN111552643A (en) 2020-08-18

Family

ID=71998183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010344986.XA Pending CN111552643A (en) 2020-04-27 2020-04-27 Multi-browser webpage access synchronization method and system

Country Status (1)

Country Link
CN (1) CN111552643A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988263A (en) * 2021-02-10 2021-06-18 青岛希望鸟科技有限公司 Method and system for synchronizing web pages
CN116980236A (en) * 2023-09-25 2023-10-31 腾讯科技(深圳)有限公司 Network security detection method, apparatus, device, medium and program product

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988263A (en) * 2021-02-10 2021-06-18 青岛希望鸟科技有限公司 Method and system for synchronizing web pages
CN112988263B (en) * 2021-02-10 2023-11-28 青岛希望鸟科技有限公司 Webpage synchronization method and system
CN116980236A (en) * 2023-09-25 2023-10-31 腾讯科技(深圳)有限公司 Network security detection method, apparatus, device, medium and program product
CN116980236B (en) * 2023-09-25 2024-01-09 腾讯科技(深圳)有限公司 Network security detection method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US11588922B2 (en) Capturing and replaying application sessions using resource files
CN109766262B (en) Interface data processing method, automatic testing method, device, equipment and medium
CN108304498B (en) Webpage data acquisition method and device, computer equipment and storage medium
US11477298B2 (en) Offline client replay and sync
CN104767775B (en) Web application information push method and system
CN110990205B (en) Interface call testing method, device and computer readable storage medium
US11436066B2 (en) System for offline object based storage and mocking of rest responses
CN112073405A (en) Webpage data loading method and device, computer equipment and storage medium
CN107181779B (en) Method, device and system for processing access request
CN110688598B (en) Service parameter acquisition method and device, computer equipment and storage medium
CN111859224A (en) Server rendering method and device based on node server and computer equipment
CN109787974B (en) Message data stream generation method and device, computer equipment and storage medium
CN111431767B (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
CN110598135A (en) Network request processing method and device, computer readable medium and electronic equipment
CN111552643A (en) Multi-browser webpage access synchronization method and system
CN112241298A (en) Page display method and device, storage medium and electronic device
CN113821254A (en) Interface data processing method, device, storage medium and equipment
CN112925589B (en) Calling method and device of expansion interface
CN114915565B (en) Network debugging method and system
CN115062254A (en) Mock data implementation method based on Google browser, storage medium and equipment
CN111371643B (en) Authentication method, device and storage medium
Panum et al. Kraaler: A user-perspective web crawler
CN109981738B (en) Cloud server suitable for application of narrow-band Internet of things
CN113805968A (en) Application program function execution method and device, computer equipment and storage medium
CN115859333A (en) File transmission encryption method, device, equipment and readable 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