[go: up one dir, main page]

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
test
script
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

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

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.一种浏览器测试方法,其特征在于,包括:1. a browser testing method, is characterized in that, comprises: 接收测试请求,生成测试任务的任务消息以存入消息队列;Receive test requests and generate task messages of test tasks to store in the message queue; 接收一至多个任务执行引擎向消息队列发送的请求测试的订阅消息;Receive a subscription message requesting test sent by one or more task execution engines to the message queue; 响应于所述订阅消息从所述消息队列中提取相应的一至多个任务消息,以将所述一至多个任务消息分别发送至该一至多个任务执行引擎,进而通过该一至多个任务执行引擎基于所述任务消息中的脚本标识和浏览器信息,调用对应脚本对对应浏览器进行测试。In response to the subscription message, corresponding one or more task messages are extracted from the message queue, so as to send the one or more task messages to the one or more task execution engines respectively, and then pass the one or more task execution engines. Based on the script identifier and browser information in the task message, the corresponding script is invoked to test the corresponding browser. 2.根据权利要求1所述的方法,其特征在于,所述测试任务是根据预先选择的脚本和浏览器生成的;2. The method according to claim 1, wherein the test task is generated according to a preselected script and a browser; 以及,在生成所述测试任务之前,还包括:And, before generating the test task, it also includes: 通过客户端展示用于浏览器测试的脚本的第一信息、待测试的浏览器的第二信息,接收基于所述第一信息和第二信息选择的脚本和浏览器;Display the first information of the script used for browser testing and the second information of the browser to be tested by the client, and receive the script and browser selected based on the first information and the second information; 其中,所述脚本的第一信息包括:脚本标识、脚本的可用状态;所述浏览器的第二信息包括:浏览器所在设备信息、浏览器标识、浏览器被测试状态信息。Wherein, the first information of the script includes: a script identifier and an available state of the script; the second information of the browser includes: information of the device where the browser is located, the browser identifier, and the browser tested state information. 3.根据权利要求2所述的方法,其特征在于,在通过客户端展示用于浏览器测试的脚本的第一信息、待测试的浏览器的第二信息之前,还包括:3. The method according to claim 2, wherein before displaying the first information of the script used for browser testing and the second information of the browser to be tested by the client, the method further comprises: 从脚本库中确定用于浏览器测试的脚本文件,并将所述脚本文件分发至所述任务执行引擎所在的设备;其中,所述设备上的任务执行引擎与所述设备上安装的浏览器相对应。Determine a script file for browser testing from the script library, and distribute the script file to the device where the task execution engine is located; wherein the task execution engine on the device and the browser installed on the device Corresponding. 4.根据权利要求3所述的方法,其特征在于,在将所述脚本文件分发至所述任务执行引擎所在的设备之前,还包括:4. The method according to claim 3, wherein before distributing the script file to the device where the task execution engine is located, the method further comprises: 从浏览器库中确定待安装的浏览器;基于预设安装流程将所述待安装的浏览器安装至所述设备,并配置与浏览器对应的任务执行引擎。Determine the browser to be installed from the browser library; install the browser to be installed to the device based on a preset installation process, and configure a task execution engine corresponding to the browser. 5.根据权利要求3所述的方法,其特征在于,所述接收一至多个任务执行引擎向消息队列发送的请求测试的订阅消息;响应于所述订阅消息从所述消息队列中提取相应的一至多个任务消息,包括:5. The method according to claim 3, characterized in that, receiving a subscription message requesting a test sent by one or more task execution engines to a message queue; extracting a corresponding message from the message queue in response to the subscription message One or more task messages, including: 接收一至多个任务执行引擎基于其对应的浏览器信息发送的请求测试的订阅消息;Receive a subscription message requesting a test sent by one or more task execution engines based on its corresponding browser information; 响应于所述订阅消息,根据所述订阅消息中的浏览器信息,从所述消息队列中提取与该浏览器标识对应的一至多个任务消息。In response to the subscription message, one or more task messages corresponding to the browser identifier are extracted from the message queue according to the browser information in the subscription message. 6.根据权利要求3所述的方法,其特征在于,通过一至多个任务执行引擎基于所述任务消息中的脚本标识和浏览器信息,调用对应脚本对对应浏览器进行测试,包括:6. The method according to claim 3, wherein one or more task execution engines call corresponding scripts to test the corresponding browsers based on the script identifier and browser information in the task message, comprising: 通过一至多个任务执行引擎基于所述浏览器信息中的浏览器所在设备标识确定目标设备,以及基于所述浏览器信息中的浏览器标识确定所述目标设备上安装的目标浏览器;Determine a target device based on the device identifier of the browser in the browser information by one or more task execution engines, and determine the target browser installed on the target device based on the browser identifier in the browser information; 基于所述脚本标识调取所述目标设备中的目标脚本文件,并确定驱动参数,通过一至多个任务执行引擎利用所述驱动参数驱动所述目标脚本文件对所述目标浏览器进行测试。Based on the script identifier, a target script file in the target device is called, and driving parameters are determined, and one or more task execution engines use the driving parameters to drive the target script file to test the target browser. 7.根据权利要求1-6任一所述的方法,其特征在于,在对浏览器进行测试之后,还包括:7. The method according to any one of claims 1-6, characterized in that, after the browser is tested, further comprising: 将所述测试的结果存入预设数据库;所述结果包括:测试时间、脚本标识、浏览器标识、浏览器所在设备信息。The test results are stored in a preset database; the results include: test time, script identification, browser identification, and information on the device where the browser is located. 8.根据权利要求7所述的方法,其特征在于,在将所述测试的结果存入预设数据库之后,还包括:8. method according to claim 7, is characterized in that, after the result of described test is stored in preset database, also comprises: 接收对浏览器测试结果的查询请求,并响应于该查询请求返回预设格式的查询结果。A query request for the browser test result is received, and a query result in a preset format is returned in response to the query request. 9.一种浏览器测试装置,其特征在于,包括:9. A browser testing device, characterized in that, comprising: 接收模块,用于接收测试请求,生成测试任务的任务消息以存入消息队列;以及用于接收任务执行引擎向消息队列发送的请求测试的订阅消息;The receiving module is used for receiving the test request, and generating the task message of the test task to be stored in the message queue; and for receiving the subscription message of the request test sent by the task execution engine to the message queue; 执行模块,用于响应于所述订阅消息从所述消息队列中提取相应的一至多个任务消息,以将所述一至多个任务消息分别发送至该一至多个任务执行引擎,进而通过该任务执行引擎基于所述任务消息中的脚本标识和浏览器信息,调用对应脚本对对应浏览器进行测试。an execution module, configured to extract corresponding one or more task messages from the message queue in response to the subscription message, so as to send the one or more task messages to the one or more task execution engines respectively, and then pass the task The execution engine invokes the corresponding script to test the corresponding browser based on the script identifier and browser information in the task message. 10.一种浏览器测试电子设备,其特征在于,包括:10. A browser testing electronic device, comprising: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,storage means for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-8中任一所述的方法。The 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.一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1-8中任一所述的方法。11. A computer-readable medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the method according to any one of claims 1-8 is implemented.
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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704118A (en) * 2021-08-31 2021-11-26 平安普惠企业管理有限公司 System testing method, device, equipment and storage medium based on message body
CN113886270A (en) * 2021-10-25 2022-01-04 京东科技信息技术有限公司 Evaluation method and device for algorithm server
CN114726817A (en) * 2022-06-10 2022-07-08 深圳希施玛数据科技有限公司 Service notification method and device based on team mode

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170242784A1 (en) * 2016-02-19 2017-08-24 International Business Machines Corporation Failure recovery testing framework for microservice-based applications
CN107145448A (en) * 2017-05-09 2017-09-08 携程旅游信息技术(上海)有限公司 Test middleware, test system and method based on selenium
CN108845949A (en) * 2018-07-24 2018-11-20 浙江数链科技有限公司 A kind of performance test methods and platform
CN111367792A (en) * 2020-02-24 2020-07-03 天津满运软件科技有限公司 Test method, test device, storage medium and electronic equipment
US20200242015A1 (en) * 2019-01-28 2020-07-30 Salesforce.Com, Inc. Automated test case management systems and methods
CN111679985A (en) * 2020-06-08 2020-09-18 中国银行股份有限公司 Method and device for testing rendering performance of browser

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170242784A1 (en) * 2016-02-19 2017-08-24 International Business Machines Corporation Failure recovery testing framework for microservice-based applications
CN107145448A (en) * 2017-05-09 2017-09-08 携程旅游信息技术(上海)有限公司 Test middleware, test system and method based on selenium
CN108845949A (en) * 2018-07-24 2018-11-20 浙江数链科技有限公司 A kind of performance test methods and platform
US20200242015A1 (en) * 2019-01-28 2020-07-30 Salesforce.Com, Inc. Automated test case management systems and methods
CN111367792A (en) * 2020-02-24 2020-07-03 天津满运软件科技有限公司 Test method, test device, storage medium and electronic equipment
CN111679985A (en) * 2020-06-08 2020-09-18 中国银行股份有限公司 Method and device for testing rendering performance of browser

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704118A (en) * 2021-08-31 2021-11-26 平安普惠企业管理有限公司 System testing method, device, equipment and storage medium based on message body
CN113886270A (en) * 2021-10-25 2022-01-04 京东科技信息技术有限公司 Evaluation method and device for algorithm server
CN114726817A (en) * 2022-06-10 2022-07-08 深圳希施玛数据科技有限公司 Service notification method and device based on team mode
CN114726817B (en) * 2022-06-10 2022-09-13 深圳希施玛数据科技有限公司 Business notification method and device based on team mode

Similar Documents

Publication Publication Date Title
CN105262608B (en) Monitoring method and device for network service
CN109656799B (en) Test method and device
CN112579447A (en) Browser testing method and device
CN112131095B (en) Pressure testing method and device
CN113505302A (en) Method, device and system for supporting dynamic acquisition of buried point data and electronic equipment
CN113434384B (en) Pressure testing method and device
CN110795328A (en) Interface testing method and device
US12210443B2 (en) Multi-client orchestrated automated testing platform
CN110019158A (en) A kind of method and apparatus of monitoring data quality
CN114756227B (en) Resource release processing method and device
CN113448602B (en) Version update method and device
CN115996179B (en) Service node testing method, device, readable medium and electronic device
CN113378346A (en) Method and device for model simulation
CN109981546B (en) Method and device for acquiring remote call relation between application modules
CN114625458A (en) Page data processing method and device, electronic equipment and storage medium
CN112463616B (en) A chaos testing method and device for Kubernetes container platform
CN116258461A (en) A business process orchestration method, execution method and device
CN113761433B (en) Service processing method and device
CN110768855B (en) Method and device for testing linkmzation performance
CN113495747B (en) Gray scale release method and device
CN112988806A (en) Data processing method and device
CN113342633A (en) Performance test method and device
CN117850912B (en) APP application information dynamic configuration method and system
CN111831530A (en) Test method and apparatus
CN113783713B (en) A method, device and system for configuring an agent

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
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.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210330