CN112579447A - Browser testing method and device - Google Patents

Browser testing method and device Download PDF

Info

Publication number
CN112579447A
CN112579447A CN202011455758.6A CN202011455758A CN112579447A CN 112579447 A CN112579447 A CN 112579447A CN 202011455758 A CN202011455758 A CN 202011455758A CN 112579447 A CN112579447 A CN 112579447A
Authority
CN
China
Prior art keywords
browser
task
script
test
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011455758.6A
Other languages
Chinese (zh)
Inventor
王晓广
赵薇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Shuke Haiyi Information Technology Co Ltd
Original Assignee
Jingdong Shuke Haiyi Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Shuke Haiyi Information Technology Co Ltd filed Critical Jingdong Shuke Haiyi Information Technology Co Ltd
Priority to CN202011455758.6A priority Critical patent/CN112579447A/en
Publication of CN112579447A publication Critical patent/CN112579447A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING; 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/3692Test management for test results analysis

Abstract

The invention discloses a browser testing method and device, and relates to the technical field of computers. One embodiment of the method comprises: receiving a test request, and generating a task message of a test task to be stored in a message queue; receiving subscription messages which are sent to a message queue by one or more task execution engines and request for testing; and responding to the subscription message, extracting corresponding one to more task messages from the message queue, respectively sending the one to more task messages to one to more task execution engines, and calling corresponding scripts to test corresponding browsers through the one to more task execution engines based on script identifiers and browser information in the task messages. According to the embodiment, the task message of the test task can be stored through the message queue, the task execution engine monitors the message queue to extract the corresponding task message, and then the corresponding script and the browser are called by the task execution engine based on the task message to perform testing, so that the parallel execution of the test task is realized, and the testing efficiency is improved.

Description

Browser testing method and device
Technical Field
The invention relates to the technical field of computers, in particular to a browser testing method and device.
Background
A user accesses a web (web) application using a browser, and version update iteration of the browser is fast as internet technology develops, so that testing of the browser is very important, wherein testing of different versions and different functions of different browsers is involved. In the prior art, a technician usually deploys a browser and a script on each test device, and initiates a test task based on the browser and the script on the test device to complete testing of different functions of different browsers.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1) technicians only operate the test equipment respectively responsible for the test equipment, and the test of the browser depends on the normal operation of the test equipment, so the technicians cannot share the browser capable of being selectively tested, and the risk of incapability of testing caused by equipment failure exists;
2) scripts deployed on the test equipment can only specify one browser driver at a time, so test tasks can only be executed serially, resulting in inefficient testing.
Disclosure of Invention
In view of this, embodiments of the present invention provide a browser testing method and apparatus, which can store task messages of a test task through a message queue, so that a task execution engine monitors the message queue to extract corresponding task messages, and further, the task execution engine can call a corresponding script and a browser to perform a test based on the task messages, thereby implementing parallel execution of the test task and improving test efficiency.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a browser testing method, including:
receiving a test request, and generating a task message of a test task to be stored in a message queue;
receiving subscription messages which are sent to a message queue by one or more task execution engines and request for testing;
and responding to the subscription message to extract corresponding one to more task messages from the message queue so as to respectively send the one to more task messages to the one to more task execution engines, and then calling corresponding scripts to test corresponding browsers through the one to more task execution engines based on script identifications and browser information in the task messages.
Optionally, the test task is generated according to a preselected script and a browser;
and, before generating the test task, further comprising:
displaying first information of a script used for browser testing and second information of a browser to be tested through a client, and receiving the script and the browser selected based on the first information and the second information;
wherein the first information of the script includes: script identification and available state of the script; the second information of the browser includes: the device information of the browser, the browser identification and the tested state information of the browser.
Optionally, before the first information of the script for the browser test and the second information of the browser to be tested are exposed through the client, the method further includes:
determining a script file for browser testing from a script library, and distributing the script file to equipment where the task execution engine is located; wherein the task execution engine on the device corresponds to a browser installed on the device.
Optionally, before distributing the script file to the device where the task execution engine is located, the method further includes:
determining a browser to be installed from a browser library; and installing the browser to be installed to the equipment based on a preset installation flow, and configuring a task execution engine corresponding to the browser.
Optionally, the receiving one or more task execution engines send a subscription message requesting a test to a message queue; extracting the corresponding one to more task messages from the message queue in response to the subscription message, including:
receiving subscription messages which are sent by one or more task execution engines based on corresponding browser information and request for testing;
and responding to the subscription message, and extracting one to more task messages corresponding to the browser identification from the message queue according to the browser information in the subscription message.
Optionally, invoking, by one or more task execution engines, a corresponding script to test a corresponding browser based on the script identifier and the browser information in the task message, where the invoking includes:
determining target equipment based on the equipment identifier of the browser in the browser information through one or more task execution engines, and determining a target browser installed on the target equipment based on the browser identifier in the browser information;
and calling a target script file in the target equipment based on the script identification, determining driving parameters, and driving the target script file by using the driving parameters through one or more task execution engines to test the target browser.
Optionally, after the testing the browser, the method further includes:
storing the test result into a preset database; the results include: test time, script identification, browser identification and information of equipment where the browser is located.
Optionally, after storing the test result in a preset database, the method further includes:
and receiving a query request for the browser test result, and returning a query result in a preset format in response to the query request.
According to still another aspect of the embodiments of the present invention, there is provided a browser testing apparatus including:
the receiving module is used for receiving the test request and generating a task message of the test task to be stored in the message queue; the device comprises a task execution engine, a message queue and a data processing module, wherein the task execution engine is used for sending a message to the message queue;
and the execution module is used for responding to the subscription message, extracting corresponding one to more task messages from the message queue, respectively sending the one to more task messages to the one to more task execution engines, and calling the corresponding script to test the corresponding browser through the task execution engine based on the script identifier and the browser information in the task message.
Optionally, the test task is generated according to a preselected script and a browser;
and before the receiving module generates the test task, the method further comprises the following steps:
displaying first information of a script used for browser testing and second information of a browser to be tested through a client, and receiving the script and the browser selected based on the first information and the second information;
wherein the first information of the script includes: script identification and available state of the script; the second information of the browser includes: the device information of the browser, the browser identification and the tested state information of the browser.
Optionally, before the first information of the script for the browser test and the second information of the browser to be tested are displayed through the client, the receiving module is further configured to:
determining a script file for browser testing from a script library, and distributing the script file to equipment where the task execution engine is located; wherein the task execution engine on the device corresponds to a browser installed on the device.
Optionally, before distributing the script file to the device where the task execution engine is located, the receiving module further includes:
determining a browser to be installed from a browser library; and installing the browser to be installed to the equipment based on a preset installation flow, and configuring a task execution engine corresponding to the browser.
Optionally, the receiving module receives a subscription message requesting a test, which is sent to a message queue by a task execution engine, and the executing module extracts a corresponding task message from the message queue in response to the subscription message, including:
the receiving module receives a subscription message which is sent by the task execution engine based on the corresponding browser information and requests for testing;
and the execution module responds to the subscription message and extracts the task message corresponding to the browser identifier from the message queue according to the browser information in the subscription message.
Optionally, the executing module invokes, by one or more task executing engines, a corresponding script to test a corresponding browser based on the script identifier and the browser information in the task message, where the method includes:
determining target equipment based on the equipment identifier of the browser in the browser information through one or more task execution engines, and determining a target browser installed on the target equipment based on the browser identifier in the browser information;
and calling a target script file in the target equipment based on the script identification, determining driving parameters, and driving the target script file by using the driving parameters through one or more task execution engines to test the target browser.
Optionally, the browser testing apparatus provided by the invention further includes a storage module;
the storage module is used for: after testing the browser, storing the test result into a preset database; the results include: test time, script identification, browser identification and information of equipment where the browser is located.
Optionally, the browser testing apparatus provided by the invention further includes an inquiry module;
the query module is configured to: and after the test result is stored in a preset database, receiving a query request for the test result of the browser, and returning the query result in a preset format in response to the query request.
According to another aspect of the embodiments of the present invention, there is provided a browser test electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the browser testing method provided by the invention.
According to still another aspect of the embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements a browser testing method provided by the present invention.
One embodiment of the above invention has the following advantages or benefits: because the browser in the browser library is installed to the equipment and the script in the script library is issued to the equipment where the browser is located by utilizing the layered architecture, the test task is established by selecting the script and the browser through the client, and then the task message is generated and stored in the message queue, so that the task execution engine monitors the message queue to extract the corresponding task message and execute the task message, and further the technical means of parallel execution of the test task is realized, the technical problems that the browser capable of being selectively tested cannot be shared among technical personnel in the prior art and the risk that the test cannot be carried out due to equipment failure exists are solved, the technical problem that the test efficiency is low due to the fact that the test task can only be executed in series in the prior art is also solved, the test task can be established more flexibly and selectively, and the risk that the test can be carried out depending on the normal operation of the equipment is avoided, meanwhile, the testing efficiency is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a browser testing method according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating an effect of showing first information of a script to a user in a browser testing method according to a second embodiment of the present invention;
FIG. 3 is a schematic diagram of a browser testing method according to a third embodiment of the present invention;
FIG. 4 is a schematic diagram of the main modules of a browser testing apparatus according to a fifth embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a browser testing method according to an embodiment of the present invention, as shown in fig. 1, including:
step S101, receiving a test request, and generating a task message of a test task to be stored in a message queue;
step S102, receiving subscription messages of request test sent to a message queue by one or more task execution engines;
step S103, in response to the subscription message, extracting one to more corresponding task messages from the message queue to send the one to more task messages to the one to more task execution engines, and then invoking, by the one to more task execution engines, corresponding scripts to test the corresponding browsers based on the script identifiers and the browser information in the task messages.
In some embodiments, the test tasks are generated according to a preselected script and browser;
and, before generating the test task, further comprising: displaying first information of a script used for browser testing and second information of a browser to be tested through a client, and receiving the script and the browser selected based on the first information and the second information;
wherein the first information of the script includes: script identification and available state of the script; the second information of the browser includes: the device information of the browser, the browser identification and the tested state information of the browser.
In some embodiments, before exposing, by the client, the first information of the script for the browser test and the second information of the browser to be tested, the method further includes:
determining a script file for browser testing from a script library, and distributing the script file to equipment where the task execution engine is located; wherein the task execution engine on the device corresponds to a browser installed on the device.
The browser testing method of the invention can be realized by utilizing a layered architecture: the system comprises a client layer, a server layer and a task execution engine layer;
technicians can initiate a test request through the client, and the server can generate a test task and store task information of the test task as a message queue after receiving the test request; the task execution engine can monitor the message queue by sending the subscription message to the message queue, further extract the corresponding task message from the message queue, and then call the corresponding script according to the task message to test the corresponding browser; the task execution engine can realize the parallel execution of the test tasks, thereby improving the test efficiency.
The client layer can be realized by adopting a front-end frame (such as a exact frame), and can be used for managing scripts for testing the browser, the browser to be tested, equipment where the browser is located and testing tasks; a technician can upload, download, online modify, enable, disable scripts (which cannot be selected for testing the browser when the scripts are set to disabled) through the client, and can also upload files for browser installation for selective installation to a specified device; based on the script displayed on the client and the necessary information of the browser, a technician can select the script and the browser to initiate a test request, further generate a test task at the server and check the test task at the client layer; the script can be uploaded to a script library, and files for browser installation can be uploaded to a browser library;
the server layer can be implemented by adopting a web application framework (such as a flash framework), and can be used for receiving a test request sent by a client to generate a test task, maintaining the enabling/disabling state of a script, installing a selected browser on a specified device, and distributing the script to the device on which the browser is installed and a corresponding task execution engine is deployed; the distribution script can adopt a socket mode: the server side is a sending end (namely a socket client), and the sending end sends the file by specifying an IP address and a port of the equipment in a way of transmitting the file by a socket; a receiving end (namely, a server of the socket) can be deployed on each device and is used for receiving the script file and storing the script file under a specified path; socket transmission is adopted, so that the speed is high and the implementation is easy;
the task execution engine can be implemented by a distributed system framework (such as a celery framework) for processing messages; the task execution engine can be used for monitoring the message queue to extract corresponding task messages so as to execute the test task;
illustrated in a celery framework: the middleware in the celery framework can be used for being responsible for maintaining the message queue and coordinating and cooperating among the plurality of task execution engines; a plurality of task execution engines may be deployed on the device, where each task execution engine may be configured with browser information, and the browser information may include: browser identification and equipment identification; since the browser information also exists in the task information, the task information with the same browser information can be extracted to the task execution engine of the user by monitoring the browser information in the task information in the message queue, and then the corresponding test task is executed.
Fig. 2 is a schematic diagram illustrating an effect of showing first information of a script to a user in a browser testing method according to a second embodiment of the present invention, as shown in the drawing, the schematic diagram may be a schematic diagram for managing the script, and may include: script number, script name, script creation time, script creator, script availability state (enabled/disabled can be set to achieve valid/invalid state effect), and operation on the script.
In some embodiments, before distributing the script file to the device where the task execution engine is located, the method further includes:
determining a browser to be installed from a browser library; and installing the browser to be installed to the equipment based on a preset installation flow, and configuring a task execution engine corresponding to the browser.
The browser can be pre-installed on the equipment, or the browser can be downloaded and installed on the specified equipment based on the browser library according to requirements, and a corresponding task execution engine is deployed on the equipment, so that flexible configuration is achieved, and the test of the browser can not depend on normal operation of certain equipment any more.
In some embodiments, the receiving one or more subscription messages requesting the test, which are sent to the message queue by the task execution engines; extracting the corresponding one to more task messages from the message queue in response to the subscription message, including:
receiving subscription messages which are sent by one or more task execution engines based on corresponding browser information and request for testing;
and responding to the subscription message, and extracting one to more task messages corresponding to the browser identification from the message queue according to the browser information in the subscription message.
A browser information may be configured in each task execution engine, and the browser information may include: browser identification and equipment identification; since the browser information also exists in the task information, the task information with the same browser information can be extracted to the task execution engine of the user by monitoring the browser information in the task information in the message queue, and then the corresponding test task is executed.
In some embodiments, invoking, by one or more task execution engines, a corresponding script to test a corresponding browser based on the script identification and the browser information in the task message includes:
determining target equipment based on the equipment identifier of the browser in the browser information through one or more task execution engines, and determining a target browser installed on the target equipment based on the browser identifier in the browser information;
and calling a target script file in the target equipment based on the script identification, determining driving parameters, and driving the target script file by using the driving parameters through one or more task execution engines to test the target browser.
In some embodiments, after testing the browser, the method further comprises:
storing the test result into a preset database; the results include: test time, script identification, browser identification and information of equipment where the browser is located.
After the task execution is finished (namely, the running of the automation script is finished), the task execution engine can store the execution result into a preset database, so that the user can conveniently check the execution result.
In some embodiments, after storing the result of the test in a preset database, the method further includes: and receiving a query request for the browser test result, and returning a query result in a preset format in response to the query request.
A user can initiate task query at a client and can query according to the returned task and state; for the task whose status is execution completed, the query result (such as test result report) can be viewed, and the format of the query result can be picture, table, html format, etc.; for example: in some practical cases, when the technician clicks to view the report, he can jump to a new tab page, opening the report in html format.
Fig. 3 is a schematic architecture diagram of a browser testing method according to a third embodiment of the present invention, as shown in fig. 3, including: a client layer (web client), a server layer (server), middleware (message queue), a task execution engine layer (worker) and a storage layer (DB);
the client layer (web client) can be realized by adopting a front-end frame (such as a exact frame), and can be used for managing scripts for testing the browser, the browser to be tested, equipment where the browser is located and testing tasks; a technician can upload, download, online modify, enable, disable scripts (which cannot be selected for testing the browser when the scripts are set to disabled) through the client, and can also upload files for browser installation for selective installation to a specified device; based on the script displayed on the client and the necessary information of the browser, a technician can select the script and the browser to initiate a test request, further generate a test task at the server and check the test task at the client layer;
the server layer (server) may be implemented by a web application framework (e.g., a flash framework), and may be configured to receive a test request sent by a client to generate a test task, maintain an enabled/disabled state of a script, install a selected browser on a specified device, and distribute the script to devices on which the browsers and corresponding task execution engines are installed;
the middleware (message queue) and the task execution engine layer (worker) can be realized by a distributed system framework (such as a celery framework) for processing messages; specifically, the method comprises the following steps:
the middleware can be used for being responsible for maintaining a message queue and coordinating and cooperating among a plurality of task execution engines; the task execution engine can be used for monitoring the message queue to extract corresponding task messages so as to execute the test task;
a plurality of task execution engines can be deployed on the device, wherein each task execution engine can be configured with browser information (the browser information can include a browser identifier and an identifier of the device in which the browser is located); since the browser information also exists in the task information, the task information with the same browser information can be extracted to the task execution engine of the user by monitoring the browser information in the task information in the message queue, and then the corresponding test task is executed.
The storage layer (DB) may be used to record test task related information after initiation of a test task, such as: the execution state of the test task (such as execution and execution end), the test time, the script identification participating in the test, the browser identification, the information of the equipment where the browser is located, and the like;
for tasks that end of execution, reports on test results may also be stored in the storage layer (DB) for viewing by the user.
Fig. 4 is a schematic diagram of main blocks of a browser testing apparatus according to a fifth embodiment of the present invention, and as shown in fig. 4, the browser testing apparatus 400 includes:
a receiving module 401, configured to receive a test request, and generate a task message of a test task to be stored in a message queue; the device comprises a task execution engine, a message queue and a data processing module, wherein the task execution engine is used for sending a message to the message queue;
an executing module 402, configured to extract, in response to the subscription message, corresponding one to more task messages from the message queue, to send the one to more task messages to the one to more task execution engines, respectively, and then invoke, by the task execution engine, a corresponding script to test a corresponding browser based on a script identifier and browser information in the task message.
In some embodiments, the test tasks are generated according to a preselected script and browser;
and before the receiving module generates the test task, the method further comprises the following steps:
displaying first information of a script used for browser testing and second information of a browser to be tested through a client, and receiving the script and the browser selected based on the first information and the second information;
wherein the first information of the script includes: script identification and available state of the script; the second information of the browser includes: the device information of the browser, the browser identification and the tested state information of the browser.
In some embodiments, the receiving module is further configured to, before presenting, by the client, the first information of the script for the browser test and the second information of the browser to be tested:
determining a script file for browser testing from a script library, and distributing the script file to equipment where the task execution engine is located; wherein the task execution engine on the device corresponds to a browser installed on the device.
The browser testing method of the invention can be realized by utilizing a layered architecture: the system comprises a client layer, a server layer and a task execution engine layer;
technicians can initiate a test request through the client, and the server can generate a test task and store task information of the test task as a message queue after receiving the test request; the task execution engine can monitor the message queue by sending the subscription message to the message queue, further extract the corresponding task message from the message queue, and then call the corresponding script according to the task message to test the corresponding browser; the task execution engine can realize the parallel execution of the test tasks, thereby improving the test efficiency.
The client layer can be realized by adopting a front-end frame (such as a exact frame), and can be used for managing scripts for testing the browser, the browser to be tested, equipment where the browser is located and testing tasks; a technician can upload, download, online modify, enable, disable scripts (which cannot be selected for testing the browser when the scripts are set to disabled) through the client, and can also upload files for browser installation for selective installation to a specified device; based on the script displayed on the client and the necessary information of the browser, a technician can select the script and the browser to initiate a test request, further generate a test task at the server and check the test task at the client layer;
the server layer can be implemented by adopting a web application framework (such as a flash framework), and can be used for receiving a test request sent by a client to generate a test task, maintaining the enabling/disabling state of a script, installing a selected browser on a specified device, and distributing the script to the device on which the browser is installed and a corresponding task execution engine is deployed;
the task execution engine can be implemented by a distributed system framework (such as a celery framework) for processing messages; the task execution engine can be used for monitoring the message queue to extract corresponding task messages so as to execute the test task;
illustrated in a celery framework: the middleware in the celery framework can be used for being responsible for maintaining the message queue and coordinating and cooperating among the plurality of task execution engines; a plurality of task execution engines may be deployed on a device, where each task execution engine may be configured with browser information, and the browser information may include: browser identification and equipment identification; since the browser information also exists in the task information, the task information with the same browser information can be extracted to the task execution engine of the user by monitoring the browser information in the task information in the message queue, and then the corresponding test task is executed.
In some embodiments, before distributing the script file to the device on which the task execution engine is located, the receiving module further includes:
determining a browser to be installed from a browser library; and installing the browser to be installed to the equipment based on a preset installation flow, and configuring a task execution engine corresponding to the browser.
The browser can be pre-installed on the equipment, or the browser can be downloaded and installed on the specified equipment based on the browser library according to requirements, and a corresponding task execution engine is deployed on the equipment, so that flexible configuration is achieved, and the test of the browser can not depend on normal operation of certain equipment any more.
In some embodiments, the executing module receives a subscription message requesting a test, which is sent to a message queue by a task execution engine, and extracts a corresponding task message from the message queue in response to the subscription message, including:
receiving a subscription message for requesting test, which is sent by a task execution engine based on corresponding browser information;
and responding to the subscription message, and extracting the task message corresponding to the browser identifier from the message queue according to the browser information in the subscription message.
A browser information may be configured in each task execution engine, and the browser information may include: browser identification and equipment identification; since the browser information also exists in the task information, the task information with the same browser information can be extracted to the task execution engine of the user by monitoring the browser information in the task information in the message queue, and then the corresponding test task is executed.
In some embodiments, the executing module invokes, through the one or more task execution engines, a corresponding script to test the corresponding browser based on the script identifier and the browser information in the task message, including:
determining target equipment based on the equipment identifier of the browser in the browser information through one or more task execution engines, and determining a target browser installed on the target equipment based on the browser identifier in the browser information;
and calling a target script file in the target equipment based on the script identification, determining driving parameters, and driving the target script file by using the driving parameters through one or more task execution engines to test the target browser.
In some embodiments, the browser testing apparatus further includes a storage module 403;
the storage module is used for: after testing the browser, storing the test result into a preset database; the results include: test time, script identification, browser identification and information of equipment where the browser is located.
After the task execution is finished (namely, the running of the automation script is finished), the task execution engine can store the execution result into a preset database, so that the user can conveniently check the execution result.
In some embodiments, the browser testing apparatus provided by the present invention further includes a query module 404;
the query module is configured to: and after the test result is stored in a preset database, receiving a query request for the test result of the browser, and returning the query result in a preset format in response to the query request.
A user can initiate task query at a client and can query according to the returned task and state; for the task whose status is execution completed, the query result (such as test result report) can be viewed, and the format of the query result can be picture, table, html format, etc.; for example: in some practical cases, when the technician clicks to view the report, he can jump to a new tab page, opening the report in html format.
Fig. 5 illustrates an exemplary system architecture 500 to which the browser testing method or the browser testing apparatus of the embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. Various communication client applications may be installed on the terminal devices 501, 502, 503.
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for tests performed by users using the terminal devices 501, 502, 503. The background management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (e.g., a test report) to the terminal device.
It should be noted that the browser testing method provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the browser testing apparatus is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a receiving module, an executing module, a storing module, and a querying module. Wherein the names of the modules do not in some cases constitute a limitation of the module itself.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: step S101, receiving a test request, and generating a task message of a test task to be stored in a message queue; step S102, receiving subscription messages of request test sent to a message queue by one or more task execution engines; step S103, in response to the subscription message, extracting one to more corresponding task messages from the message queue to send the one to more task messages to the one to more task execution engines, and then invoking, by the one to more task execution engines, corresponding scripts to test the corresponding browsers based on the script identifiers and the browser information in the task messages.
According to the technical scheme of the embodiment of the invention, because the browser in the browser library is installed to the equipment and the script in the script library is issued to the equipment where the browser is located by utilizing the layered architecture, the script is selected by the client and the browser is used for establishing the test task so as to generate the task message to be stored in the message queue, so that the task execution engine monitors the message queue to extract the corresponding task message and execute the task message, and further the technical means of parallel execution of the test task is realized, the technical problems that the selectable test browser cannot be shared among technical personnel in the prior art and the risk of incapability of testing caused by equipment failure is solved, the technical problem that the test efficiency is low because the test task can only be executed in series in the prior art is also solved, the test task can be established more flexibly and selectively, and the risk caused by the normal operation of the equipment is avoided, meanwhile, the testing efficiency is improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A browser testing method is characterized by comprising the following steps:
receiving a test request, and generating a task message of a test task to be stored in a message queue;
receiving subscription messages which are sent to a message queue by one or more task execution engines and request for testing;
and responding to the subscription message to extract corresponding one to more task messages from the message queue so as to respectively send the one to more task messages to the one to more task execution engines, and then calling corresponding scripts to test corresponding browsers through the one to more task execution engines based on script identifications and browser information in the task messages.
2. The method of claim 1, wherein the test tasks are generated from a pre-selected script and browser;
and, before generating the test task, further comprising:
displaying first information of a script used for browser testing and second information of a browser to be tested through a client, and receiving the script and the browser selected based on the first information and the second information;
wherein the first information of the script includes: script identification and available state of the script; the second information of the browser includes: the device information of the browser, the browser identification and the tested state information of the browser.
3. The method of claim 2, before exposing, by the client, the first information of the script for the browser test, and the second information of the browser to be tested, further comprising:
determining a script file for browser testing from a script library, and distributing the script file to equipment where the task execution engine is located; wherein the task execution engine on the device corresponds to a browser installed on the device.
4. The method of claim 3, further comprising, prior to distributing the script file to a device on which the task execution engine is located:
determining a browser to be installed from a browser library; and installing the browser to be installed to the equipment based on a preset installation flow, and configuring a task execution engine corresponding to the browser.
5. The method according to claim 3, wherein the subscription message requesting the test sent by one or more task execution engines to a message queue is received; extracting the corresponding one to more task messages from the message queue in response to the subscription message, including:
receiving subscription messages which are sent by one or more task execution engines based on corresponding browser information and request for testing;
and responding to the subscription message, and extracting one to more task messages corresponding to the browser identification from the message queue according to the browser information in the subscription message.
6. The method of claim 3, wherein invoking, by one or more task execution engines, a corresponding script to test a corresponding browser based on the script identification and browser information in the task message comprises:
determining target equipment based on the equipment identifier of the browser in the browser information through one or more task execution engines, and determining a target browser installed on the target equipment based on the browser identifier in the browser information;
and calling a target script file in the target equipment based on the script identification, determining driving parameters, and driving the target script file by using the driving parameters through one or more task execution engines to test the target browser.
7. The method of any of claims 1-6, further comprising, after testing the browser:
storing the test result into a preset database; the results include: test time, script identification, browser identification and information of equipment where the browser is located.
8. The method of claim 7, further comprising, after storing the results of the testing in a predetermined database:
and receiving a query request for the browser test result, and returning a query result in a preset format in response to the query request.
9. A browser testing apparatus, comprising:
the receiving module is used for receiving the test request and generating a task message of the test task to be stored in the message queue; the device comprises a task execution engine, a message queue and a data processing module, wherein the task execution engine is used for sending a message to the message queue;
and the execution module is used for responding to the subscription message, extracting corresponding one to more task messages from the message queue, respectively sending the one to more task messages to the one to more task execution engines, and calling the corresponding script to test the corresponding browser through the task execution engine based on the script identifier and the browser information in the task message.
10. A browser testing electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202011455758.6A 2020-12-10 2020-12-10 Browser testing method and device Pending CN112579447A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011455758.6A CN112579447A (en) 2020-12-10 2020-12-10 Browser testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011455758.6A CN112579447A (en) 2020-12-10 2020-12-10 Browser testing method and device

Publications (1)

Publication Number Publication Date
CN112579447A true CN112579447A (en) 2021-03-30

Family

ID=75131423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011455758.6A Pending CN112579447A (en) 2020-12-10 2020-12-10 Browser testing method and device

Country Status (1)

Country Link
CN (1) CN112579447A (en)

Similar Documents

Publication Publication Date Title
CN107766509B (en) Method and device for static backup of webpage
US10404568B2 (en) Agent manager for distributed transaction monitoring system
CN109873731B (en) Test method, device and system
CN112748962A (en) Application loading method and device, electronic equipment and computer readable medium
CN112131095A (en) Pressure testing method and device
CN112579447A (en) Browser testing method and device
CN111414154A (en) Method and device for front-end development, electronic equipment and storage medium
CN109981546B (en) Method and device for acquiring remote call relation between application modules
CN110768855A (en) Method and device for testing linkmzation performance
CN110851194A (en) Method and device for acquiring code for realizing new interface
CN109218041B (en) Request processing method and device for server system
CN110324432B (en) Data processing method, device and medium applied to terminal and computing equipment
CN108984189B (en) Module parsing method and device
CN113760699A (en) Server performance test system and method
CN107644075B (en) Method and device for collecting page information
CN113220559A (en) Service interface abnormity simulation method, device and system and client
CN113326188A (en) Browser testing method and device
CN113434384A (en) Pressure testing method and device
CN113505302A (en) Method, device and system for supporting dynamic acquisition of buried point data and electronic equipment
CN112214370A (en) Debugging equipment and method for large-screen terminal
CN110795328A (en) Interface testing method and device
CN112579427A (en) Method and device for generating virtualization test code
CN113132447A (en) Reverse proxy method and system
CN113835796A (en) Method and apparatus for processing information
CN112559001A (en) Method and device for updating application

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 601, 6 / F, building 2, No. 18, Kechuang 11th Street, Beijing Economic and Technological Development Zone, Beijing 100176

Applicant after: Jingdong Technology Information Technology Co.,Ltd.

Address before: 601, 6 / F, building 2, No. 18, Kechuang 11th Street, Beijing Economic and Technological Development Zone, Beijing 100176

Applicant before: Jingdong Shuke Haiyi Information Technology Co., Ltd

CB02 Change of applicant information