CN114721927A - Page test information acquisition method and device, computer equipment and storage medium - Google Patents

Page test information acquisition method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114721927A
CN114721927A CN202110002130.9A CN202110002130A CN114721927A CN 114721927 A CN114721927 A CN 114721927A CN 202110002130 A CN202110002130 A CN 202110002130A CN 114721927 A CN114721927 A CN 114721927A
Authority
CN
China
Prior art keywords
request
component
target page
interface
page
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
CN202110002130.9A
Other languages
Chinese (zh)
Inventor
刘�东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110002130.9A priority Critical patent/CN114721927A/en
Publication of CN114721927A publication Critical patent/CN114721927A/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
    • 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

Abstract

The application relates to a page test information acquisition method and device, computer equipment and a storage medium, and belongs to the technical field of front-end development. The method comprises the following steps: acquiring a first request initiated by a target page; the first request is sent according to a communication mode between the target page and the application program; and the target page is developed based on the application program running in the second system environment; initiating a second request based on the first request; the second request is used for indicating the service assembly to acquire static data set corresponding to the first request when the second request is intercepted by the service assembly of the target page, and returning the static data to the target page so as to update based on the static data; and outputting the test information of the target page based on the target page before and after updating. By the scheme, the mobile terminal does not need to be operated to open the page in the application program, and the test information does not need to be derived from the mobile terminal, so that the test efficiency is greatly improved.

Description

Page test information acquisition method and device, computer equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of front-end development, in particular to a method and a device for acquiring page test information, computer equipment and a storage medium.
Background
In the process of developing a Web page in a local Application (Native APP) in a mobile terminal, the developed page is generally required to be tested.
In the related art, when testing a page in a Native APP, a developer needs to open the page through the Native APP installed in a mobile terminal, and then operate the page according to steps specified by a test case, so as to generate test information in the mobile terminal according to an operation result. The developer then exports the generated test information from the mobile terminal to the personal computer for analysis.
However, in the above scheme, a developer needs to operate a Native APP in the mobile terminal to implement the operation on the page to be tested, and then the test information needs to be derived, which requires many manual steps and affects the efficiency of testing the page in the Native APP.
Disclosure of Invention
The embodiment of the application provides a method and a device for acquiring page test information, computer equipment and a storage medium, and can improve page test efficiency. The technical scheme comprises the following contents:
in one aspect, a method for acquiring page test information is provided, where the method is performed by a terminal running a first system environment, and the method includes:
acquiring a first request initiated by a target page; the first request is sent according to a communication mode between the target page and the application program; the target page is a page opened in a browser of the terminal, and the target page is developed based on an application program running in a second system environment;
initiating a second request based on the first request; the second request is sent according to a communication mode between the target page and a network side; the second request is used for indicating the service assembly to acquire static data corresponding to the first request when the second request is intercepted by the service assembly of the target page, and returning the static data to the target page so as to update based on the static data;
and outputting the test information of the target page based on the target page before and after updating.
In one aspect, an apparatus for acquiring page test information is provided, where the apparatus is used in a terminal running a first system environment, and the apparatus includes:
the first request acquisition module is used for acquiring a first request initiated by a target page; the first request is sent according to a communication mode between the target page and the application program; the target page is a page opened in a browser of the terminal, and the target page is developed based on an application program running in a second system environment;
a second request initiating module, configured to initiate a second request based on the first request; the second request is sent according to the communication mode between the target page and the network side; the second request is used for indicating the service assembly to acquire static data corresponding to the first request when the second request is intercepted by the service assembly of the target page, and returning the static data to the target page so as to update based on the static data;
and the information output module is used for outputting the test information of the target page based on the target page before and after updating.
In one possible implementation, a virtual bridging component runs in the terminal; the virtual bridging component is provided with a first interface, and the first interface is used for realizing communication between the target page and the application program;
the first request acquisition module includes:
the first request acquisition sub-module is used for intercepting the first request sent by the first interface called by the target page through the virtual bridging component;
the second request initiating module includes:
the second request acquisition submodule is used for calling a second interface to send the second request based on the request content of the first request through the virtual bridging component; the second interface is an interface used for realizing communication between the target page and a network side.
In a possible implementation manner, the second request sending sub-module includes:
a second request sending unit, configured to invoke, through the virtual bridge component, a second interface based on request content of the first request, and send the second request including an identifier of the virtual bridge component;
the device further comprises:
the data sending submodule is used for responding to a notification message sent by the service component and received through the virtual bridging component and sending the static data to the service component; and the notification message is sent by the service component based on the identifier of the virtual bridging component after the service component intercepts the second request.
In one possible implementation, the apparatus further includes:
the channel establishing submodule is used for establishing a message channel between the virtual bridging component and the service component before sending the static data to the service component in response to receiving a notification message sent by the service component through the virtual bridging component;
and the message receiving submodule is used for receiving the notification message sent by the service component through the message channel.
In a possible implementation manner, the second request sending unit is configured to,
in response to the presence of the static data in the terminal, invoking, by the virtual bridging component, a second interface based on the request content of the first request, sending the second request including an identification of the virtual bridging component.
In a possible implementation manner, the second request sending unit is configured to,
and responding to the configuration information of the virtual bridging component to indicate that local data is preferentially passed for testing, calling a second interface through the virtual bridging component based on the request content of the first request, and sending the second request containing the identification of the virtual bridging component.
In one possible implementation, the apparatus further includes:
the configuration interface display module is used for displaying a configuration interface of the virtual bridging component before acquiring a first request initiated by a target page, wherein the configuration interface comprises a configuration item corresponding to the configuration information;
and the configuration information generating module is used for generating the configuration information based on the configuration operation of the configuration items.
In one possible implementation, the apparatus further includes:
a network status acquiring unit, configured to respond to a configuration information indication of the virtual bridging component that a test is performed preferentially by using local data, invoke, by the virtual bridging component, a second interface based on a request content of the first request, and acquire, before sending the second request including an identifier of the virtual bridging component, network connection status information of the terminal as the configuration information of the virtual bridging component;
the second request sending unit is configured to,
and responding to the network connection state information indicating that the network connection is not smooth, calling a second interface through the virtual bridging component based on the request content of the first request, and sending the second request containing the identification of the virtual bridging component.
In a possible implementation manner, the second request obtaining sub-module includes:
and the request sending unit is used for calling a second interface based on the request content of the first request through the virtual bridging component and sending the second request containing the address of the server so that the service component can acquire the static data from the server.
In a possible implementation manner, the request sending unit is configured to,
and responding to the absence of the static data in the terminal, calling a second interface through the virtual bridging component based on the request content of the first request, and sending the second request containing the address of the server.
In one possible implementation, the apparatus further includes:
the address interface display module is used for displaying an address setting interface before acquiring a first request initiated by a target page, wherein the address setting interface comprises a setting item corresponding to the address of the server;
and the address acquisition module is used for acquiring the address of the server based on the setting operation of the setting item.
In a possible implementation manner, the first request is a data acquisition message sent based on a javascript bridge technology; the second request is a hypertext transfer protocol, HTTP, request.
In another aspect, a computer device is provided, which includes a processor and a memory, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the page test information obtaining method as described above.
In another aspect, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a set of codes, or a set of instructions is stored, which is loaded and executed by a processor to implement the page test information obtaining method as described above.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the page test information acquisition method provided in the various optional implementation modes of the above aspects.
The technical scheme provided by the application can comprise the following beneficial effects:
in the scheme shown in the embodiment of the application, a page is opened in a browser of a terminal (such as a computer) which is different from the system environment of a mobile terminal, a communication request between the page and an APP is converted into a communication request between the page and a network side, then a service component originally supported by the browser is utilized to intercept the communication request, and static data corresponding to the communication request is returned to the page; therefore, the response to the communication request between the page and the application program is realized in the browser environment, the page in the application program is directly tested through the browser in the terminal with different system environments of the mobile terminal, the page in the application program does not need to be opened by operating the mobile terminal, and the test information does not need to be derived from the mobile terminal, so that the test efficiency is greatly improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
FIG. 1 is a schematic diagram illustrating a structure of a page test information acquisition system according to an exemplary embodiment;
FIG. 2 is a schematic diagram illustrating a browser architecture in accordance with an exemplary embodiment;
FIG. 3 is a flowchart illustrating a method for obtaining page test information in accordance with an exemplary embodiment;
FIG. 4 is a flowchart illustrating a method for obtaining page test information in accordance with an exemplary embodiment;
FIG. 5 is a diagram illustrating data transmission of a message channel according to the embodiment shown in FIG. 4;
FIG. 6 is a diagram of a message channel data transmission according to the embodiment shown in FIG. 4;
FIG. 7 is a schematic diagram illustrating a debugging process of a target page according to the embodiment shown in FIG. 4;
FIG. 8 is a block diagram illustrating a page test information acquisition method according to an exemplary embodiment;
FIG. 9 is a block diagram illustrating a page test information acquisition apparatus according to an exemplary embodiment;
FIG. 10 is a block diagram illustrating a computer device according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
It is to be understood that reference herein to "a number" means one or more and "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
For the sake of easy understanding, terms referred to in the embodiments of the present application will be described below.
1) Front end development
Front-end development is a process of creating a front-end interface such as a Web page or an APP (Application) and presenting the front-end interface to a user, and user interface interaction of internet products can be realized through HTML (Hyper Text Markup Language), CSS (Cascading Style Sheet), JavaScript (transliteration scripting Language) and various derived technologies, frameworks and solutions.
The JavaScript belongs to a high-level scripting language of a network, and is generally used for adding various dynamic functions to a Web page in the process of developing the Web page, so that the Web page has a smoother and more attractive browsing effect, wherein the service logic of the Web page depends on the JavaScript language.
2) Local Application program (Native Application, Native APP)
Native APP is a third party application program based on a smartphone local operating system such as iOS, Android, WP and running using Native programs, which may also be referred to as local APP. The commonly used development languages are JAVA, C + +, Objective-C.
Fig. 1 is a schematic structural diagram illustrating a page test information acquisition system according to an exemplary embodiment. The system comprises: a first terminal 110, a second terminal 120, a first server 130, and a second server 140.
The first terminal 110 may be a computer device having a browser supporting HTML5(HyperText Markup Language).
The first terminal 110 runs a first system environment, for example, the first system environment is a Windows system environment.
For example, the first terminal 110 may be, but is not limited to, a smart phone, a tablet computer, an e-book reader, a notebook computer, a desktop computer, and the like.
The second terminal 120 may be a mobile terminal installed with Native APP.
For example, the second terminal 120 may be a smart phone, a tablet computer, etc., but is not limited thereto.
The second terminal 120 runs a second system environment, for example, the second system environment is an iOS system environment, an Android system environment, or a WP system environment, etc.
In one possible implementation, a developer opens a web page in Native APP in the second terminal 120 through a browser on the first terminal 110 for debugging.
The first server 130 may be a server corresponding to Native APP. The second server 140 may be a server for storing static data.
The first server 130 and the second server 140 may be independent physical servers, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be cloud servers providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, Network service, cloud communication, middleware service, domain name service, security service, CDN (Content Delivery Network), big data, and an artificial intelligence platform. The application is not limited thereto.
Optionally, the first terminal 110 and the second server 140, and the second terminal 120 and the first server 130 are connected through a communication network. Optionally, the communication network is a wired network or a wireless network.
In one possible implementation manner, a developer connects the first terminal 110 and the second terminal 120 in a wired or wireless manner in a preliminary development and debugging preparation stage, so that the first terminal 110 and the second terminal 120 can perform data transmission.
In another possible implementation, there is no direct connection between the first terminal 110 and the second terminal 120.
Optionally, the wireless network or wired network described above uses standard communication techniques and/or protocols. The Network is typically the Internet, but may be any Network including, but not limited to, a Local Area Network (LAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a mobile, wireline or wireless Network, a private Network, or any combination of virtual private networks. In some embodiments, data exchanged over a network is represented using techniques and/or formats including Hypertext Mark-up Language (HTML), Extensible Markup Language (XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec). In other embodiments, custom and/or dedicated data communication techniques may also be used in place of, or in addition to, the data communication techniques described above.
At present, the development work of the page and the test analysis work of the page are usually carried out on a personal computer/workstation of a developer or a tester, and the same is true for the development work of the page in a Native APP in a mobile terminal. Therefore, if the debugging/testing of the pages in the Native APP of the mobile terminal can be directly performed on the personal computer/workstation, the efficiency of testing the pages in the Native APP can be greatly improved.
The system environment (such as a Windows system environment or a Linux system environment) of the personal computer/workstation of the developer or the tester is different from the system environment (such as an iOS system environment, an Android system environment, or a WP system environment) in which the Native APP runs in the mobile terminal.
For a page, data generally needs to be acquired in a presentation process to perform page update, for example, when the page receives a user operation, data corresponding to the user operation needs to be acquired, so as to respond to the user operation based on the acquired data. For a page displayed in Native APP, there are two ways to acquire data: and acquiring data from a server on the network side, and acquiring data from a Native APP.
The pages in the Native APP are also Web pages in nature, and can also be displayed through a browser. When the page in the Native APP is displayed in the browser, the browser in any system environment can directly acquire the data on the network side through the address of the server of the Native APP.
However, for data which needs to be obtained from Native APPs, due to different system environments, a page opened in a browser running in a personal computer/workstation cannot communicate with Native APPs running in different system environments, which is a main problem that a tester is prevented from directly debugging/testing the page in the Native APP of the mobile terminal on the personal computer/workstation.
The subsequent embodiment of the application provides a scheme for testing the page in the Native APP in the browser on the personal computer/workstation.
Fig. 2 is a flowchart illustrating a page test information acquisition method according to an exemplary embodiment. The page test information acquisition method may be executed by a computer device. For example, the computer device may be a terminal running a browser, for example, the terminal may be the first terminal 110 shown in fig. 1. As shown in fig. 2, the page test information acquiring method includes the following steps:
step 201, acquiring a first request initiated by a target page; the first request is sent according to a communication mode between the target page and the application program; the target page is a page opened in a browser of the terminal, and the target page is developed based on an application program running in the second system environment.
In this embodiment of the application, after the developer develops the target page for the application program (for example, Native APP) in the second system environment, the tester needs to test the function of the target page, and at this time, the tester can open the target page through the browser in the terminal.
For example, a developer deploys a developed target page to a network side, a tester inputs a network address of the target page in an address bar of a browser, and at this time, the browser requests page data of the target page from the network side according to the network address and displays the target page. In the embodiment of the application, the target page can be debugged/tested in the browser in the terminal.
In this embodiment of the application, since the target page is developed based on the application program running in the second system environment, in the presentation process of the target page, when data needs to be obtained from the application program to update the page, the target page may initiate the first request according to the designed logic and the communication mode between the target page and the application program.
202, initiating a second request based on the first request; the second request is sent according to the communication mode between the target page and the network side; the second request is used for indicating the service component to acquire the static data set corresponding to the first request when the second request is intercepted by the service component of the target page, and returning the static data to the target page so that the target page can be updated based on the static data.
The first system environment of the terminal is different from the second system environment which is depended by the application program, so that data cannot be returned to the first request through the application program; in this embodiment, the terminal may convert the first request into a second request sent by a communication method between the target page and the network side, and since different operating system environments (including the first system environment and the second system environment) can support the communication method between the target page and the network side, the converted second request can be transmitted in the first system environment.
The service component is a service component which is native supported by the browser; the service component is registered by the browser aiming at the target page in advance, and the service component has the main function of serving as a proxy server between the page and the server and providing proxy service for interaction between the page and the server. For example, the Service component may be a Service Worker Service.
In this embodiment of the application, the developer/tester may set corresponding static data for the first request in advance, as response data of the first request, so as to be used for testing the target page. The terminal converts the first request into a second request, and the second request is intercepted by the service component when being transmitted in the system, and further, the service component can obtain the static data which is preset for the first request according to the second request, and the static data is used as response data and is returned to the target page, so that the target page does not need to be actually communicated with the application program, and the data which needs to be obtained from the application program can be obtained for testing.
And step 203, outputting the test information of the target page based on the target page before and after updating.
In the embodiment of the application, the terminal can automatically output the test information of the target page based on the target page before and after updating.
In one possible implementation, the updated target page is displayed in the browser in real time.
In a possible implementation manner, the test information is used for debugging the target page, or is used for analyzing and detecting whether the target page has a defect.
To sum up, in the solution shown in the embodiment of the present application, a page is opened in a browser of a terminal (such as a computer) that is different from a system environment of a mobile terminal, a communication request between the page and an APP is converted into a communication request between the page and a network side, then a service component originally supported by the browser is used to intercept the communication request, and static data corresponding to the communication request is returned to the page; therefore, the response to the communication request between the page and the application program is realized in the browser environment, the page in the application program is directly tested through the browser in the terminal with different system environments of the mobile terminal, the page in the application program does not need to be opened by operating the mobile terminal, and the test information does not need to be derived from the mobile terminal, so that the test efficiency is greatly improved.
The process of debugging the target page shown in fig. 2 may be implemented by a virtual bridge component provided in a terminal running the browser, where the virtual bridge component may be a software program component. Wherein the virtual bridge component may be provided in the browser, for example, implemented as a plug-in to the browser; alternatively, the virtual bridge component can be configured independently of the browser.
For example, taking the virtual bridge component as an example, please refer to fig. 3, which is a schematic structural diagram of a browser according to an exemplary embodiment.
As shown in fig. 3, the browser 30 includes a web page 31, a virtual bridge component 32, a browser interface 33, and a service component 34.
The web page 31 is a target page to be debugged, and the virtual bridge component 32 includes a request conversion module 321 and a data matching logic module 322. The request converting module 321 is used for converting the format of the received request. The data matching logic module 322 is configured to obtain static data, and match the request with the corresponding format generated based on the conversion with the static data to obtain a matching result. The browser interface 33 is used to accept calls to send requests to the network side. The service component 34 is used for intercepting the request sent to the network side, and obtaining corresponding data according to the intercepted request and returning the corresponding data to the target page.
FIG. 4 is a flowchart illustrating a method for obtaining page test information according to an example embodiment. The page test information acquisition method may be executed by a computer device. For example, the computer device may be a terminal running a browser, for example, the terminal may be the first terminal 110 shown in fig. 1. As shown in fig. 4, the page test information acquiring method includes the following steps:
step 401, intercepting a first request sent by a target page calling a first interface through a virtual bridging component.
In the embodiment of the application, a virtual bridging component may be disposed in the target page, and a first request sent by the target page calling the first interface may be intercepted by the virtual bridging component.
The first interface is used for realizing communication between the target page and the application program. For example, the first interface may be an interface implemented based on the javascript bridge technology, and accordingly, the first request may be a data acquisition message sent by the javascript bridge technology.
The virtual bridging component is a framework based on JavaScript, and the virtual bridging component can comprise a JavaScript bridge module and a data matching logic module. The javascript bridge module may be a collective module having a plurality of functions of calling the javascript bridge technology, acquiring the environment in which the target page is located, intercepting the first request, calling the second interface, and the like.
In this embodiment, when the target page initiates the first request, the virtual bridge component may intercept the first request because the first request is sent by calling the javascript bridge module.
The JavaScriptbridge module can establish communication connection with an application program through JavaScriptbridge technology in a non-test mode, and transmit data acquisition information to the application program to realize data acquisition, and the steps are as follows:
1) the javascript bridge module may first create an HTML iframe tag.
For example, the code that creates the HTML iframe tag is: create element ('iframe').
2) And then appointing an interface address with the native APP.
For example, the interface address may be: jsbridge:// weishi/getUsercallback ═ aaa.
3) Then, a function named aaa is added under the windows object.
Such as: aaa function (res) { … }.
4) And changing the src attribute value of the iframe label into an interface address.
Such as: < iframe src >.
5) Finally, the native app requests to intercept the interface address, a callback name function is extracted through callback aaa, the function name (aaa) is notified through Webview, and a page in the native app can receive the notification (window aaa) and is called.
In a possible implementation manner, the first request includes a current target page state identifier, where the target page state identifier is used to indicate whether a target page is in a test mode, and in response to determining that the current target page is in a non-test mode based on the target page state identifier, the javascriptbtbridge module receives the first request and establishes communication connection with the application program by calling a javascriptbtbridge technology, so as to send a data acquisition message to the application program.
In the test mode according to the embodiment of the present application, the first request is not provided to the application program by the javascript bridge module, but is intercepted by the virtual bridge component.
In another example, the virtual bridge component may not include a complete javascript bridge module, but only provide the first interface for intercepting the first request.
In a possible implementation manner, before the virtual bridging component obtains the first request initiated by the target page, the terminal displays the configuration interface of the virtual bridging component, and generates configuration information based on configuration operation on the configuration item.
And the configuration interface comprises configuration items corresponding to the configuration information. The configuration information may be network connection state information of the terminal.
In one possible implementation manner, the network connection state information of the terminal is acquired as the configuration information of the virtual bridging component.
Illustratively, the configuration interface displays the corresponding relationship between the network connection state of the terminal and the corresponding storage location for acquiring the static data. For example, the configuration may be such that when the terminal is not connected to the network, only the locally stored static data is allowed to be acquired, when the terminal is in the shared network, the locally stored static data is allowed to be acquired, and the static data stored in the cloud terminal is not allowed to be acquired, and when the terminal is in the private network, the locally stored static data or the static data stored in the cloud terminal is allowed. By setting the static data stored in the cloud can be acquired only when the terminal is in the private network, so that the static data can be acquired in a trustworthy network state, and the data communication safety can be enhanced.
Or, when the terminal is connected with a wireless network, the network strength of the wireless network connection can be configured, and the corresponding static data storage position allowed to be acquired is also configured. For example, when the network strength is greater than the specified threshold value, the static data stored in the cloud can be preferentially acquired, so that static data loss caused by network fluctuation in the process of acquiring the static data is avoided, and the amount of the acquired static data is expanded.
In one possible implementation manner, before the virtual bridging component acquires the first request initiated by the target page, the terminal displays the address setting interface. And acquiring the address of the server based on the setting operation of the setting item.
The address setting interface comprises setting items corresponding to the address of the server.
For example, the address setting interface displayed by the terminal may set a server address corresponding to the application program, and when the terminal ends the debugging of the target page in one application program and starts the debugging of the target page in another application program, the address setting interface may reset the server address. Alternatively, the server address may be an address corresponding to a server storing static data.
The terminal can pre-store the corresponding relation between at least one application program and the corresponding server address, and the terminal automatically sets the server address corresponding to the application program by selecting the application program in the address setting interface. Alternatively, the correspondence between the application program and the server address corresponding to the static data for simulating the application program environment may be stored in advance, and the terminal may automatically set the server address of the server in which the static data corresponding to the application program is stored by selecting the application program in the address setting interface.
Step 402, calling a second interface to send a second request based on the request content of the first request through the virtual bridging component.
In this embodiment of the present application, after intercepting a first request, a virtual bridge component in a browser may obtain request content based on the received first request, and then convert a request format of the first request based on the obtained request content of the first request, and generate a second request having the same request content as the first request.
Wherein the second request can be generated and transmitted by the virtual bridging component invoking the second interface. The second request may be a hypertext transfer protocol, HTTP, request. The second interface is an interface used for realizing communication between the target page and the network side.
Illustratively, the second interface may be an XMLHttpRequest browser interface. The XMLHttpRequest browser interface object is used to interact with the server. The HTTP request can be sent to acquire data without refreshing the page through the XMLHttpRequest.
In one possible implementation, a second request is sent through the virtual bridge component that includes an identification of the virtual bridge component by invoking a second interface based on the request content of the first request.
When the virtual bridge component calls the second interface through the request content in the first request, the first request is converted into the second request, and the identification of the corresponding virtual bridge component can be added in the request content of the second request.
In another possible implementation, a second interface is invoked, via the virtual bridging component, based on the request content of the first request, to send the second request containing the address of the server, so that the service component retrieves the static data from the server.
The static data can be stored in a terminal to which the browser belongs, or can also be stored in a server in the cloud, and the server can be a server corresponding to a Native APP, or a server specially used for storing static data for testing.
In this embodiment, the virtual bridge component may add, to the second request, an identifier of the virtual bridge component or an address of the server according to the storage location of the static data, so as to instruct the service component to obtain the static data from the corresponding location.
In one possible implementation, in response to the presence of static data in the terminal, a second request is sent, via the virtual bridging component, that includes an identification of the virtual bridging component, invoking a second interface based on the request content of the first request.
The terminal can inquire static data through the virtual bridging component, and if the static data is inquired, a second request containing the virtual bridging component identification is sent.
That is, in response to receiving the first request in the virtual bridge component of the terminal browser, the storage condition of the static data in the terminal is acquired, and in response to storing the static data in the terminal, the virtual bridge component calls the second interface based on the request content of the first request, and sends the second request including the identifier of the virtual bridge component.
In one possible implementation, in response to the absence of the static data in the terminal, a second interface is invoked, via the virtual bridge component, based on the request content of the first request, to send the second request including the address of the server.
The method comprises the steps of inquiring whether static data exist in a terminal through a virtual bridging component, if the terminal is inquired that the static data do not exist, possibly storing the static data in a cloud server, converting request content of a first request and a server address of the cloud server storing the static data into a second request through the virtual bridging component, and sending the second request containing the server address. The server address corresponding to the cloud server may be a server address set in the address setting interface. So as to obtain the static data through the server address request corresponding to the cloud server in the second request.
In one possible implementation, in response to the configuration information of the virtual bridge component indicating that testing is to be performed with preference over local data, a second interface is invoked, via the virtual bridge component, based on the request content of the first request, to send the second request including the identification of the virtual bridge component.
In this embodiment, in addition to the manner of locally querying the static data of the first request to determine to add the identifier of the virtual bridge component or the address of the server to the second request, the virtual bridge component may also determine to add the identifier of the virtual bridge component or the address of the server to the second request through configuration information acquired in advance or in real time.
The configuration information is used for indicating that the test is preferentially carried out through local data or the test is preferentially carried out through cloud data; when the configuration information indicates that testing is to be conducted with preference to local data, the virtual bridge component may invoke a second interface, based on the request content of the first request, to send the second request containing an identification of the virtual bridge component.
Accordingly, when the configuration information indicates that the test is preferentially performed through the cloud data, the virtual bridging component may call the second interface based on the request content of the first request, and send a second request including the address of the server.
In an exemplary scenario, the configuration information may be configured by a tester through a configuration interface, and during the testing process, the virtual bridge component sends an identifier including the virtual bridge component according to the configuration of the tester, or sends a second request including an address of the server.
In one possible implementation manner, in response to the network connection state information indicating that the network connection is not smooth, a second interface is called through the virtual bridging component based on the request content of the first request, and the second request containing the identifier of the virtual bridging component is sent; and responding to the network connection state information indicating that the network connection is smooth, calling a second interface based on the request content of the first request through the virtual bridging component, and sending the second request containing the address of the server.
In an exemplary scheme, the configuration information may also be network connection status information of the terminal, and when the network connection of the terminal is not smooth, the terminal preferentially uses the local data for testing, and at this time, sends the second request including the identifier of the virtual bridge component; correspondingly, when the network connection of the terminal is smooth, the terminal is preferentially tested through the cloud data, and at the moment, a second request containing the address of the server is sent.
For the condition that the second request includes the address of the server, after the service component intercepts the second request, the service component can query and obtain static data set corresponding to the first request from the server according to the address of the server, and return the static data to the target page through the second interface, so that the target page performs page update based on the static data.
For the case where the second request includes the identification of the virtual bridge component, the process of the service component acquiring the static data may refer to the subsequent steps.
In step 403, a message channel between the virtual bridge component and the service component is established.
In an embodiment of the application, the virtual bridge component may create a message channel connecting between the virtual bridge component and the service component while receiving the first request. A message channel between the virtual bridging component and the service component can be used to transmit data.
Illustratively, the Service component may be a Service Worker Service component, and the Message Channel between the virtual bridging component and the Service component may be a Message Channel instance.
At step 404, a notification message sent by the service component through the message channel is received through the virtual bridge component.
And the notification message is sent by the service component based on the identifier of the virtual bridging component after the service component intercepts the second request. The identifier of the virtual bridge component may be an address of the virtual bridge component, or a channel identifier of a message channel between the virtual bridge component and the service component.
The service component, upon intercepting the second request, may send the notification message to the virtual bridging component based on an address of the virtual bridging component or based on a channel identification of a message channel between the virtual bridging component and the service component.
In a possible implementation manner, the notification message may be used to indicate that the process that the virtual bridge component will receive the first request and send the second request through the second interface is suspended, and indicate that the process that the virtual bridge component sends the second request through the second interface is awakened after the static data matching is successfully performed.
For example, fig. 5 is a schematic diagram of data transmission of a message channel according to an embodiment of the present application. As shown in fig. 5, when a request sent by the XMLHttpRequest browser interface 51 in the Web page 50 is intercepted by the Service Worker Service component 53, and after the Service Worker Service component 53 intercepts the request, a Message Channel is instantiated as a Channel object, where there are a port1 and a port2, the intercepted request data and a port2 after the Message Channel is instantiated are sent to the virtual bridge component 52 through a Message Channel, the virtual bridge component 52 receives the intercepted request data and a port2 after the Message Channel is instantiated by monitoring a Message from the Service Worker Service component 53, and then sends the matched static data to the Service Worker Service component 53 through a Message Channel corresponding to a port2 through a port2 after the Message Channel is instantiated. The Service Worker Service component 53 receives the static data and sends the static data to the XMLHttpRequest browser interface 51, and then the XMLHttpRequest browser interface 51 sends the static data to the Web page 50.
Step 405, in response to receiving the notification message sent by the service component through the virtual bridge component, sends the static data to the service component.
In an embodiment of the application, in response to the virtual bridging component receiving the notification message transmitted over the message channel, the second request is matched with the static data, and the matched static data is sent to the service component.
And responding to the interception of the second request by the service component, sending the second request to a data matching logic module in the virtual bridging component by the service component through a message channel, acquiring static data, matching the static data with the request content in the second request, and acquiring the matched static data. And the virtual bridging component sends the matched static data to the service component through a message channel.
In one possible implementation, the service component returns the static data to the target page to update the target page based on the static data.
The service component can package the received matched static data into a response body, send the response body to the browser interface, and return the packaged static data to the target page through the browser interface.
Fig. 6 is a schematic diagram illustrating a target page debugging process according to an embodiment of the present application. As shown in fig. 6, when the Web page 64 in the browser generates the first request based on the javascript code, the Web page 64 calls the virtual bridge component 61 to receive the first request, converts the first request into an HTTP request through the virtual bridge component 61, and sends the HTTP request to the XMLHttpRequest browser interface 62, where the XMLHttpRequest browser interface 62 is an interface for sending the HTTP request to the server. In the process of sending the converted HTTP request to the server through the XMLHttpRequest browser interface 62, the HTTP request is intercepted by the Service broker Service component 63 in the browser, the Service broker Service component 63 sends the intercepted HTTP request to the data matching logic module in the virtual bridging component 61 through the Message Channel, the data matching logic module obtains the static data matched with the request content of the HTTP request based on the received HTTP request, and if the matching is successful, the successfully matched static data is returned to the Service Worker Service component 63 through the Message Channel, then, the Service Worker Service component 63 returns the received matched static data to the XMLHttpRequest browser interface 62, the XMLHttpRequest browser interface 62 returns the matched static data to the Web page 64, and the Web page 64 updates the target page according to the received static data.
When the web page in the browser directly generates the second request based on the javascript code, fig. 7 is a schematic diagram of a target page debugging process according to an embodiment of the present application. As shown in fig. 7, when a request generated by a Web page 74 based on javascript code needs to send a request to a server of a local application to obtain response data, sending a second request to an XMLHttpRequest browser interface 72, intercepting the second request sent by the XMLHttpRequest browser interface 72 by a Service Worker Service component 73, then sending the intercepted second request to a data matching logic module in a virtual bridge component 71, matching the second request with static data when the data matching logic module receives the second request, obtaining matched static data, and returning the successfully matched static data to the Service Worker Service component 73 through a Message Channel, then returning the received matched static data to the XMLHttpRequest browser interface 72, returning the matched static data to the Web page 74 by the XMLHttpRequest browser interface 72, the Web page 74 updates the target page based on the received static data.
That is to say, static data required by page testing is transmitted through the browser-owned components (such as an XMLHttpRequest browser interface and a Service Worker Service component), so that the page of the application program is tested in an environment without a local application program, and a complete interface between the application program and the browser does not need to be simulated, thereby improving the testing efficiency.
In addition, static data can be stored locally in the terminal or in the server, and static data required by page testing is transmitted through a component carried by the browser, so that the static data stored in the local storage and the server can be compatible, and the flexibility of testing is improved.
In addition, when the data matching logic module does not receive the static data successfully matched, the second request may be sent to the network side based on the server address in the request content, and the server on the network side returns a request response and returns the called data to the HTTP request. By sending the request to the network side server, the data can be tried to be called to the server under the condition that the static data matching fails, the possible mode of carrying out the data request in the testing process is increased, and the testing effect is improved.
And step 406, outputting the test information of the target page based on the target page before and after updating.
In the embodiment of the application, the target pages before and after the update can be directly displayed in the browser of the terminal, and the test information of the target pages can be generated by analyzing and comparing the target pages before and after the update. The test information can be directly displayed on the terminal.
In one possible implementation, the test information may be downloaded or uploaded to the cloud for other developers to share the test information.
To sum up, in the solution shown in the embodiment of the present application, a page is opened in a browser of a terminal (such as a computer) that is different from a system environment of a mobile terminal, a communication request between the page and an APP is converted into a communication request between the page and a network side, then a service component originally supported by the browser is used to intercept the communication request, and static data corresponding to the communication request is returned to the page; therefore, the response to the communication request between the page and the application program is realized in the browser environment, the page in the application program is directly tested through the browser in the terminal with different system environments of the mobile terminal, the page in the application program does not need to be opened by operating the mobile terminal, and the test information does not need to be derived from the mobile terminal, so that the test efficiency is greatly improved.
FIG. 8 is a block diagram illustrating a page test information acquisition method according to an example embodiment. As shown in fig. 8, in a browser 80 of a computer, a target page to be debugged is a Web page 81, the Web page 81 includes a virtual bridge component 82, based on javascript code written by a developer, a javascript bridge (JSBridge) module 821 in the virtual bridge component 82 is called, since it is detected that the virtual bridge component is in a development test environment at this time, a data acquisition Message based on javascript bridge technology is converted into an HTTP request by the JSBridge module 821, the virtual bridge component 82 transmits the HTTP request generated by the conversion to an XMLHttpRequest browser interface 83, the HTTP request is transmitted to a network side by the XMLHttpRequest browser interface 83, and is intercepted at a Service Worker Service component 84 in the browser 80, when the HTTP request is intercepted by the Service Worker Service component 84, a Message Channel is created between the Service Worker Service component 84 and the virtual bridge component 82, and the HTTP Message Channel 822 is transmitted to the virtual bridge component 82 to match the data logic of the virtual bridge component 822, when the data matching logic module 822 receives the HTTP request, static data 85 stored on the terminal side or stored in the cloud is acquired, the HTTP request is matched with the static data, if the corresponding static data is matched, the static data is sent to the Service Worker Service component 84 through a Message Channel and returned to the XMLHttpRequest browser interface 83, and finally returned to the Web page 81, and the Web page 81 performs page update based on the static data. Therefore, debugging of the page is completed, and the test information of the target page is obtained.
To sum up, in the solution shown in the embodiment of the present application, a page is opened in a browser of a terminal (such as a computer) that is different from a system environment of a mobile terminal, a communication request between the page and an APP is converted into a communication request between the page and a network side, then a service component originally supported by the browser is used to intercept the communication request, and static data corresponding to the communication request is returned to the page; therefore, the response to the communication request between the page and the application program is realized in the browser environment, the page in the application program is directly tested through the browser in the terminal with different system environments of the mobile terminal, the page in the application program does not need to be opened by operating the mobile terminal, and the test information does not need to be derived from the mobile terminal, so that the test efficiency is greatly improved.
Fig. 9 is a block diagram illustrating a page test information acquisition apparatus according to an exemplary embodiment, as shown in fig. 9, which is used in a terminal operating in a first system environment to perform all or part of the steps of the method shown in the corresponding embodiment of fig. 2 or 4. The page test information acquisition apparatus may include:
a first request obtaining module 910, configured to obtain a first request initiated by a target page; the first request is sent according to a communication mode between the target page and the application program; the target page is a page opened in a browser of the terminal, and the target page is developed based on an application program running in a second system environment;
a second request initiating module 920, configured to initiate a second request based on the first request; the second request is sent according to a communication mode between the target page and a network side; the second request is used for indicating the service assembly to acquire static data corresponding to the first request when the second request is intercepted by the service assembly of the target page, and returning the static data to the target page so as to update based on the static data;
an information output module 930, configured to output the test information of the target page based on the target page before and after the update.
In one possible implementation manner, a virtual bridging component runs in the terminal; the virtual bridging component is provided with a first interface, and the first interface is used for realizing communication between the target page and the application program;
the first request obtaining module 910 includes:
the first request acquisition sub-module is used for intercepting the first request sent by the first interface called by the target page through the virtual bridging component;
the second request initiation module 920 includes:
the second request acquisition sub-module is used for calling a second interface to send the second request based on the request content of the first request through the virtual bridging component; the second interface is an interface used for realizing communication between the target page and a network side.
In a possible implementation manner, the second request sending sub-module includes:
a second request sending unit, configured to invoke, through the virtual bridge component, a second interface based on request content of the first request, and send the second request including an identifier of the virtual bridge component;
the device further comprises:
the data sending submodule is used for responding to a notification message sent by the service component and received through the virtual bridging component and sending the static data to the service component; and the notification message is sent by the service component based on the identifier of the virtual bridging component after the service component intercepts the second request.
In one possible implementation, the apparatus further includes:
the channel establishing submodule is used for establishing a message channel between the virtual bridging component and the service component before sending the static data to the service component in response to receiving a notification message sent by the service component through the virtual bridging component;
and the message receiving submodule is used for receiving the notification message sent by the service component through the message channel.
In a possible implementation manner, the second request sending unit is configured to,
and responding to the static data in the terminal, calling a second interface through the virtual bridging component based on the request content of the first request, and sending the second request containing the identification of the virtual bridging component.
In a possible implementation manner, the second request sending unit is configured to,
and responding to the configuration information of the virtual bridging component to indicate that local data is preferentially passed for testing, calling a second interface through the virtual bridging component based on the request content of the first request, and sending the second request containing the identification of the virtual bridging component.
In one possible implementation, the apparatus further includes:
the configuration interface display module is used for displaying a configuration interface of the virtual bridging component before acquiring a first request initiated by a target page, wherein the configuration interface comprises a configuration item corresponding to the configuration information;
and the configuration information generating module is used for generating the configuration information based on the configuration operation of the configuration items.
In one possible implementation, the apparatus further includes:
a network status acquiring unit, configured to respond to a configuration information indication of the virtual bridging component that a test is performed preferentially by using local data, invoke, by the virtual bridging component, a second interface based on a request content of the first request, and acquire, before sending the second request including an identifier of the virtual bridging component, network connection status information of the terminal as the configuration information of the virtual bridging component;
the second request sending unit is configured to,
and responding to the network connection state information indicating that the network connection is not smooth, calling a second interface through the virtual bridging component based on the request content of the first request, and sending the second request containing the identification of the virtual bridging component.
In a possible implementation manner, the second request obtaining sub-module includes:
and the request sending unit is used for calling a second interface based on the request content of the first request through the virtual bridging component and sending the second request containing the address of the server so that the service component can acquire the static data from the server.
In a possible implementation manner, the request sending unit is configured to,
and responding to the absence of the static data in the terminal, calling a second interface through the virtual bridging component based on the request content of the first request, and sending the second request containing the address of the server.
In one possible implementation, the apparatus further includes:
the address interface display module is used for displaying an address setting interface before acquiring a first request initiated by a target page, wherein the address setting interface comprises a setting item corresponding to the address of the server;
and the address acquisition module is used for acquiring the address of the server based on the setting operation of the setting item.
In a possible implementation manner, the first request is a data acquisition message sent based on a javascript bridge technology; the second request is a hypertext transfer protocol, HTTP, request.
To sum up, in the solution shown in the embodiment of the present application, a page is opened in a browser of a terminal (such as a computer) that is different from a system environment of a mobile terminal, a communication request between the page and an APP is converted into a communication request between the page and a network side, then a service component originally supported by the browser is used to intercept the communication request, and static data corresponding to the communication request is returned to the page; therefore, the response to the communication request between the page and the application program is realized in the browser environment, the page in the application program is directly tested through the browser in the terminal with different system environments of the mobile terminal, the page in the application program does not need to be opened by operating the mobile terminal, and the test information does not need to be led out from the mobile terminal, so that the test efficiency is greatly improved.
FIG. 10 is a block diagram illustrating a computer device according to an example embodiment. The computer device may be implemented as a distributed system in the various method embodiments described above. The computer apparatus 1000 includes a Central Processing Unit (CPU) 1001, a system Memory 1004 including a Random Access Memory (RAM) 1002 and a Read-Only Memory (ROM) 1003, and a system bus 1005 connecting the system Memory 1004 and the Central Processing Unit 1001. The computer device 1000 also includes a basic input/output system 1006, which facilitates the transfer of information between various components within the computer, and a mass storage device 1007, which stores an operating system 1013, application programs 1014, and other program modules 1015.
The mass storage device 1007 is connected to the central processing unit 1001 through a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1007 and its associated computer-readable media provide non-volatile storage for the computer device 1000. That is, the mass storage device 1007 may include a computer-readable medium (not shown) such as a hard disk or Compact disk Read-Only Memory (CD-ROM) drive.
Without loss of generality, the computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, flash memory or other solid state storage technology, CD-ROM, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the foregoing. The system memory 1004 and mass storage device 1007 described above may be collectively referred to as memory.
The computer device 1000 may be connected to the internet or other network devices through a network interface unit 1011 connected to the system bus 1005.
The memory further includes one or more programs, the one or more programs are stored in the memory, and the cpu 1001 implements all or part of the steps of the method shown in fig. 2 or 4 by executing the one or more programs.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as a memory comprising computer programs (instructions), executable by a processor of a computer device to perform the methods shown in the various embodiments of the present application, is also provided. For example, the non-transitory computer readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product or computer program is also provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the methods shown in the various embodiments described above.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (15)

1. A method for acquiring page test information, which is executed by a terminal running a first system environment, comprises the following steps:
acquiring a first request initiated by a target page; the first request is sent according to a communication mode between the target page and the application program; the target page is a page opened in a browser of the terminal, and the target page is developed based on an application program running in a second system environment;
initiating a second request based on the first request; the second request is sent according to a communication mode between the target page and a network side; the second request is used for indicating the service assembly to acquire static data corresponding to the first request when the second request is intercepted by the service assembly of the target page, and returning the static data to the target page so as to update based on the static data;
and outputting the test information of the target page based on the target page before and after updating.
2. The method according to claim 1, characterized in that a virtual bridging component is running in the terminal; the virtual bridging component is provided with a first interface, and the first interface is used for realizing communication between the target page and the application program;
the acquiring the first request initiated by the target page includes:
intercepting the first request sent by the first interface called by the target page through the virtual bridging component;
the initiating a second request based on the first request comprises:
calling a second interface to send the second request based on the request content of the first request through the virtual bridging component; the second interface is an interface used for realizing communication between the target page and a network side.
3. The method of claim 2, wherein said invoking, by the virtual bridge component, a second interface to send the second request based on the request content of the first request comprises:
calling a second interface based on the request content of the first request through the virtual bridging component, and sending the second request containing the identification of the virtual bridging component;
the method further comprises the following steps:
in response to receiving a notification message sent by the service component through the virtual bridge component, sending the static data to the service component; and the notification message is sent by the service component based on the identifier of the virtual bridging component after the service component intercepts the second request.
4. The method of claim 3, wherein before sending the static data to the service component in response to receiving a notification message sent by the service component through the virtual bridge component, the method further comprises:
establishing a message channel between the virtual bridging component and the service component;
and receiving the notification message sent by the service component through the message channel.
5. The method according to claim 3, wherein said sending, via the virtual bridge component, the second request including the identity of the virtual bridge component by invoking a second interface based on the request content of the first request comprises:
and responding to the static data in the terminal, calling a second interface through the virtual bridging component based on the request content of the first request, and sending the second request containing the identification of the virtual bridging component.
6. The method according to claim 3, wherein said sending, via the virtual bridge component, the second request including the identity of the virtual bridge component by invoking a second interface based on the request content of the first request comprises:
and responding to the configuration information of the virtual bridging component to indicate that local data is preferentially passed for testing, calling a second interface through the virtual bridging component based on the request content of the first request, and sending the second request containing the identification of the virtual bridging component.
7. The method of claim 6, wherein before the obtaining the first request initiated by the target page, further comprising:
displaying a configuration interface of the virtual bridging component, wherein the configuration interface comprises configuration items corresponding to the configuration information;
generating the configuration information based on a configuration operation on the configuration item.
8. The method as claimed in claim 6, wherein, prior to sending the second request including the identification of the virtual bridge component, the method further comprises, in response to the configuration information of the virtual bridge component indicating that testing is to be performed with preference to local data, invoking a second interface via the virtual bridge component based on the request content of the first request:
acquiring network connection state information of the terminal as configuration information of the virtual bridging component;
said sending, via said virtual bridge component, a second request including an identification of said virtual bridge component when said configuration information for said virtual bridge component indicates a preference for testing via local data based on request content of said first request, comprising:
in response to the network connection status information indicating that the network connection is not clear, invoking, by the virtual bridging component, a second interface based on request content of the first request, sending the second request including an identification of the virtual bridging component.
9. The method of claim 2, wherein said invoking, by the virtual bridge component, a second interface to send the second request based on the request content of the first request comprises:
and calling a second interface based on the request content of the first request through the virtual bridging component, and sending the second request containing the address of the server so that the service component can acquire the static data from the server.
10. The method according to claim 9, wherein said invoking, via the virtual bridge component, a second interface based on the request content of the first request, sending the second request including an address of a server, so that the service component obtains the static data from the server, comprises:
and responding to the absence of the static data in the terminal, calling a second interface through the virtual bridging component based on the request content of the first request, and sending the second request containing the address of the server.
11. The method of claim 9, wherein before the obtaining the first request initiated by the target page, further comprising:
displaying an address setting interface, wherein the address setting interface comprises a setting item corresponding to the address of the server;
and acquiring the address of the server based on the setting operation of the setting item.
12. The method of any one of claims 1 to 11, wherein the first request is a data acquisition message sent based on javascriptbtbridge technology; the second request is a hypertext transfer protocol, HTTP, request.
13. A page test information acquisition apparatus, wherein the apparatus is used for a terminal operating a first system environment, and the apparatus comprises:
the first request acquisition module is used for acquiring a first request initiated by a target page; the first request is sent according to a communication mode between the target page and the application program; the target page is a page opened in a browser of the terminal, and the target page is developed based on an application program running in a second system environment;
a second request initiating module, configured to initiate a second request based on the first request; the second request is sent according to the communication mode between the target page and the network side; the second request is used for indicating the service assembly to acquire static data corresponding to the first request when the second request is intercepted by the service assembly of the target page, and returning the static data to the target page so as to update based on the static data;
and the information output module is used for outputting the test information of the target page based on the target page before and after updating.
14. A computer device comprising a processor and a memory, wherein the memory has stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by the processor to implement the page test information acquisition method according to any one of claims 1 to 12.
15. A computer-readable storage medium, wherein at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the storage medium, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by a processor to implement the page test information acquisition method according to any one of claims 1 to 12.
CN202110002130.9A 2021-01-04 2021-01-04 Page test information acquisition method and device, computer equipment and storage medium Pending CN114721927A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110002130.9A CN114721927A (en) 2021-01-04 2021-01-04 Page test information acquisition method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110002130.9A CN114721927A (en) 2021-01-04 2021-01-04 Page test information acquisition method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114721927A true CN114721927A (en) 2022-07-08

Family

ID=82233520

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110002130.9A Pending CN114721927A (en) 2021-01-04 2021-01-04 Page test information acquisition method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114721927A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115794634B (en) * 2022-11-29 2023-12-01 北京五八信息技术有限公司 Communication method and device of application program, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115794634B (en) * 2022-11-29 2023-12-01 北京五八信息技术有限公司 Communication method and device of application program, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10831858B2 (en) Mobile enablement of existing web sites
CN109800173B (en) Program debugging method, device and storage medium
KR102244281B1 (en) Kernel module loading method and device
US10540269B2 (en) Inter-process communication automated testing framework
EP2909998B1 (en) Webpages with onboard hardware functions
CN106874519B (en) Page display method and device
CN107678778B (en) Hybrid-based compatible method, adapter, operation device and system
CN106878361B (en) Debugging method and device for terminal application page and client
CN110297637B (en) Resource file hot-reloading development tool and method applicable to full-platform client software
CN104821954A (en) Cross-platform remote procedure call method
CN109558323B (en) System, method and apparatus for debugging pages
US20130046878A1 (en) Asynchronous request interception for testing a request life-cycle
US20130219411A1 (en) Device Connectivity Framework
CN109582317B (en) Method and apparatus for debugging hosted applications
CN113010827A (en) Page rendering method and device, electronic equipment and storage medium
CN103618699A (en) Method and device for calling component
CN113805973A (en) Application program control method and device and application program development method and device
CN112685105A (en) Front-end component sharing method and device, computer equipment and storage medium
CN114721927A (en) Page test information acquisition method and device, computer equipment and storage medium
CN109299331B (en) Method and device for displaying hypertext markup language HTML5 page by Air
US20160105319A1 (en) Device Connectivity Framework
CN111782306A (en) Interface calling information processing method and device, electronic equipment and storage medium
CN109582580B (en) System, method and apparatus for debugging pages
WO2022247366A1 (en) Game translation method and apparatus
CN113315829B (en) Client offline H5 page loading method and device, computer equipment and 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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40071530

Country of ref document: HK