CN115827457A - Browser compatibility testing method and related equipment - Google Patents
Browser compatibility testing method and related equipment Download PDFInfo
- Publication number
- CN115827457A CN115827457A CN202211542929.8A CN202211542929A CN115827457A CN 115827457 A CN115827457 A CN 115827457A CN 202211542929 A CN202211542929 A CN 202211542929A CN 115827457 A CN115827457 A CN 115827457A
- Authority
- CN
- China
- Prior art keywords
- browser
- page
- test
- browsers
- service test
- 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
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The application discloses a browser compatibility testing method and related equipment, which can deploy different types of browsers to different containers; distributing target service test scripts aiming at the browser to each container; starting all the containers in parallel to enable the browser deployed in each container to synchronously execute the target service test script; and feeding back test operation data generated by executing the target service test script by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page. The method and the device can execute the same service test script on a plurality of browsers of different types at the same time, so that the compatibility test time of the browsers can be greatly saved, and the test efficiency is improved; moreover, test operation data of multiple browsers of different types at the same time are simultaneously displayed on a service test result page, so that the test personnel can conveniently and quickly compare the test operation data and find the difference of page display.
Description
Technical Field
The application relates to the technical field of computers, in particular to a browser compatibility testing method and related equipment.
Background
In the development process of software projects, particularly in the development process of projects at the front end of a web, the compatibility of a browser is a very important part in the development of the front end, and in order to ensure that the developed front end page can normally run and correctly display under various types of browsers and browsers with various versions, a browser compatibility test is indispensable.
In the related art, the browser compatibility test is generally performed by a tester repeatedly performing the same service test on different types of browsers respectively. This takes a significant amount of time, affecting the project testing progress.
Disclosure of Invention
The embodiment of the application provides a browser compatibility testing method and related equipment, wherein the related equipment can comprise a browser compatibility testing device, electronic equipment, a computer readable storage medium and a computer program product, so that the browser compatibility testing time can be saved, and the testing efficiency can be improved.
The embodiment of the application provides a browser compatibility testing method, which comprises the following steps:
determining at least two types of browsers to be tested, and deploying the different types of browsers to different containers in a container cluster;
distributing target service test scripts aiming at the browser to each container;
starting all containers in parallel to enable browsers deployed in all containers to synchronously execute the target service test scripts;
and feeding back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page.
Correspondingly, an embodiment of the present application provides a device for testing compatibility of a browser, including:
the determining unit is used for determining at least two types of browsers to be tested and deploying the different types of browsers to different containers in the container cluster;
the distribution unit is used for distributing the target service test script aiming at the browser to each container;
the execution unit is used for starting all the containers in parallel so as to enable the browser deployed in each container to synchronously execute the target service test script;
and the display unit is used for feeding back the test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page.
The electronic device provided by the embodiment of the application comprises a processor and a memory, wherein a plurality of instructions are stored in the memory, and the processor loads the instructions to execute the steps in the browser compatibility testing method provided by the embodiment of the application.
The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the browser compatibility testing method provided in the embodiment of the present application.
In addition, a computer program product is further provided in the embodiments of the present application, and includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the steps in the browser compatibility testing method provided in the embodiments of the present application are implemented.
The embodiment of the application provides a browser compatibility testing method and related equipment, which can determine at least two types of browsers to be tested and deploy the different types of browsers to different containers in a container cluster; distributing target service test scripts aiming at the browser to each container; starting all containers in parallel to enable browsers deployed in all containers to synchronously execute the target service test scripts; and feeding back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page. The method and the device can execute the same service test script on a plurality of browsers of different types at the same time, so that the compatibility test time of the browsers can be greatly saved, and the test efficiency is improved; moreover, test operation data of multiple browsers of different types at the same time are simultaneously displayed on a service test result page, so that the test personnel can conveniently and quickly compare the test operation data and find the difference of page display.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1a is a scene schematic diagram of a browser compatibility testing method provided in an embodiment of the present application;
fig. 1b is a flowchart of a browser compatibility testing method provided in an embodiment of the present application;
fig. 1c is a flowchart of a browser compatibility testing method provided in an embodiment of the present application;
fig. 2 is another flowchart of a browser compatibility testing method provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a browser compatibility testing apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a browser compatibility testing method and related equipment. The browser compatibility testing device may be specifically integrated in an electronic device, and the electronic device may be a terminal or a server.
It is to be understood that the browser compatibility testing method of the present embodiment may be executed on the terminal, may also be executed on the server, and may also be executed by both the terminal and the server. The above examples should not be construed as limiting the present application.
As shown in fig. 1a, a method for performing a browser compatibility test by a terminal and a server together is taken as an example. The browser compatibility testing system provided by the embodiment of the application comprises a terminal 10, a server 11 and the like; the terminal 10 and the server 11 are connected via a network, for example, a wired or wireless network connection, etc., wherein the browser compatibility testing device may be integrated in the server.
The server 11 may be configured to: determining at least two types of browsers to be tested, and deploying the different types of browsers to different containers in a container cluster; distributing target service test scripts aiming at the browser to each container; starting all containers in parallel to enable browsers deployed in all containers to synchronously execute the target service test scripts; and feeding back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page. The server 11 may be a single server, or may be a server cluster or a cloud server composed of a plurality of servers.
Wherein, the terminal 10 may be configured to: and receiving test operation data generated by the target service test script executed by each browser fed back by the server 11, and synchronously displaying the test operation data corresponding to different types of browsers through a service test result page. The terminal 10 may include a mobile phone, a smart television, a tablet Computer, a notebook Computer, a Personal Computer (PC), or the like. A client, which may be an application client or a browser client or the like, may also be provided on the terminal 10.
The embodiment of the application provides a browser compatibility testing method, which relates to a computer vision technology in the field of artificial intelligence.
Among them, artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making. The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
Computer Vision technology (CV) is a science for researching how to make a machine see, and further means that a camera and a Computer are used for replacing human eyes to perform machine Vision such as identification, tracking and measurement on a target, and further image processing is performed, so that the Computer processing becomes an image more suitable for human eyes to observe or is transmitted to an instrument to detect. As a scientific discipline, computer vision research-related theories and techniques attempt to build artificial intelligence systems that can capture information from images or multidimensional data. The computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content/behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, synchronous positioning and map construction, automatic driving, intelligent transportation and other technologies, and also includes common biometric identification technologies such as face recognition and fingerprint recognition.
The following are detailed below. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
In this embodiment, a browser compatibility testing apparatus may be specifically integrated in an electronic device, and the electronic device may be a server or a terminal.
It is understood that in the specific implementation of the present application, related data such as user information, when the above embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
As shown in fig. 1b, a specific process of the browser compatibility testing method may be as follows:
101. at least two types of browsers to be tested are determined, and different types of browsers are deployed to different containers in the container cluster.
Specifically, in this embodiment, the browser to be tested may be a browser to be tested for page compatibility, or the browser to be tested is a browser that needs to access a web page to be tested. The web page to be tested may be a web page that is completely manufactured by a developer but has not passed the compatibility test, and optionally, the web page to be tested may be a plain Text file containing an HTML (hypertext Markup Language) tag, and be in a hypertext Markup Language format, for example, the web page to be tested may be an HTML 5 page, and the like.
In this embodiment, the browser to be tested may include at least two types, such as an IE browser, a Firefox browser, a google browser, a Safari browser, and the like. It is understood that the type herein may refer not only to the kind of browser, but also to the scene type of the browser, for example, an IE browser in different scenes may be regarded as two different types of browsers; and also can refer to the version type of the browser, for example, the IE7 browser and the IE11 browser can be viewed as two different types of browsers.
Optionally, in this embodiment, each browser to be tested may operate in the same terminal, or may operate in multiple terminals.
Wherein the container cluster contains at least one container, the container being an executable unit of software, wherein the application code is packaged together with the libraries and dependencies in a generic way. The container uses the virtualization form of the operating system, and allows a plurality of applications to share the operating system by isolating processes and controlling the amount of Central Processing Units (CPUs), memory and disks that the processes can access.
In the process of developing a project at a web front end, a browser compatibility problem is a very important part in the front end development, and the browser compatibility problem is also called as a webpage compatibility or website compatibility problem, which means that the display effect of a webpage on various browsers may be inconsistent to generate a compatibility problem between the browser and the webpage. In the design and manufacture of the website, the compatibility of browsers is well made, and the website can be normally displayed under different browsers.
The browser compatibility testing method provided by the application can execute the same service testing script on a plurality of browsers of different types at the same time, so that the browser compatibility testing time can be greatly saved, and the testing efficiency is improved; moreover, test operation data of multiple browsers of different types at the same time are simultaneously displayed on a service test result page, so that the test personnel can conveniently and quickly compare the test operation data and find the difference of page display.
102. And distributing the target service test script aiming at the browser to each container.
The target service test script may be a UI (User Interface) automation script written by using selenium, airtest, or the like. The target business test script may be a test case for testing browser page compatibility. Specifically, the target service test script is a script for detecting whether the browser can normally access and normally displaying the webpage to be tested.
In a specific scenario, a Selenium script corresponding to a web page compatibility test may be run in a browser deployed in a container. Selenium is a browser automation testing framework, and supported browsers can comprise IE (7, 8,9,10, 11), mozilla Firefox, safari, google Chrome, opera and the like, namely, the method is suitable for various types of browsers and has extremely high compatibility. Furthermore, the Selenium runs directly in the browser as if it were a real user, and this is based on the Selenium automatically recording actions and automatically generating test scripts in different languages, such as Net, java, perl, etc. That is to say, the Selenium script is generated by automatically recording the actions of the user in the daily operation of the client, which replaces the process of manually writing the test script, reduces the labor cost and the error rate, and greatly improves the efficiency of the webpage compatibility test.
103. And starting the containers in parallel so that the browsers deployed in the containers synchronously execute the target service test script.
The container can place the test object (i.e. the browser) in the container, and is isolated from the overall environment of the server, so that a developer can set the environment configuration information required by the test object in the container without influencing the environment configuration of the server. Meanwhile, a plurality of containers can be arranged in the server and used for testing different test objects at the same time, environment configuration information required by the test objects of the plurality of containers is respectively arranged in the plurality of containers, and the plurality of containers are isolated from each other, so that the testing of the different test objects at the same time can not generate mutual interference. Therefore, the diversity of the test environment in the same server and the compatibility among different browser tests can be realized by introducing the container, the environment configuration information of the server can be prevented from being greatly modified by developers during each test, the labor cost is reduced, and the efficiency of webpage compatibility test is improved.
Optionally, in this embodiment, before the step "starting each container in parallel to enable the browser deployed in each container to execute the target service test script synchronously", the method may further include:
acquiring an environment configuration instruction; configuring a test environment of each container in the container cluster based on the environment configuration instruction;
the step of starting each container in parallel to enable the browser deployed in each container to synchronously execute the target service test script may include:
and starting all the containers in parallel to enable the browser deployed in each container to synchronously execute the target service test script under the corresponding test environment.
The environment configuration information includes a CPU ratio, a memory ratio, a disk space size, and the like, which is not limited in this embodiment.
The generated Docker mirror image can be obtained, and environment configuration is carried out on the Docker mirror image according to the environment configuration instruction, so that the configured Docker mirror image contains a test environment for starting the container in operation. By running the Docker image, a container is started to run the target service test script in the test environment of the container.
Wherein Docker is an open source application container engine; is a lightweight container technology; docker supports compiling software into a mirror image; then various kinds of software are configured in the mirror image, the mirror image is released, and other users can directly use the mirror image; this mirror image in operation is called a container, and container startup is very fast.
The Docker image is a special file system, which provides files of programs, libraries, resources, configuration, etc. required by the container runtime, and also contains some configuration parameters (such as anonymous volumes, environment variables, users, etc.) prepared for the runtime.
In the embodiment, based on the characteristic that the operating environment of the Docker container is completely isolated from the outside, the automatic test script is operated in the container, so that the test of the browser to be tested is realized.
104. And feeding back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page.
And the service test result page is a page at the front end of the web.
Specifically, the browser to be tested can transmit test operation data generated by executing the target service test script to the container server through the websocket, the container server transmits the test operation data to the server for managing the test, and the server transmits the test operation data to the service test result page of the web front end for display.
The websocket is a full-duplex communication protocol based on TCP, and is an independent protocol created on TCP.
The test operation data of each browser is displayed on the service test result page at the same time, so that a tester can compare the same pages of a plurality of browsers at the same time conveniently.
Optionally, in this embodiment, the test operation data includes log information and page image information generated when the browser executes the target service test script.
The log information can be used for analyzing the test result of the browser to be tested. The page image information is specifically a page view when the browser runs the target service test script.
Optionally, in this embodiment, the test operation data includes page image information;
after the step of feeding back the test running data generated by the target service test script executed by each browser to the service test result page in real time so as to synchronously display the test running data corresponding to different types of browsers through the service test result page, the method may further include:
comparing and analyzing the page image information of each browser displayed in the service test result page in batches according to preset standard page image information;
and performing browser page compatibility analysis according to the comparison analysis result, and outputting a browser page compatibility report.
The preset standard page image information can be preset to be the standard page view of the webpage to be tested.
In this embodiment, technologies such as artificial intelligence and the like may be used to analyze page image information, including but not limited to the position of each button in a page view, whether the page view is consistent, whether an image is missing, and the like, so as to determine whether a browser has a page compatibility problem.
Optionally, in this embodiment, the step of performing batch comparison analysis on the page image information of each browser displayed in the service test result page according to preset standard page image information may include:
extracting standard characteristic information of preset standard page image information under multiple dimensions;
extracting feature information of the page image information of the browser under multiple dimensions aiming at the page image information of each browser displayed in the service test result page;
and determining the similarity between the preset standard page image information and the page image information of the browser according to the standard feature information under the multiple dimensions and the feature information of the page image information of the browser under the multiple dimensions.
Wherein, the feature information under multiple dimensions can be extracted through a neural network model.
In this embodiment, vector distances between the standard feature information in the multiple dimensions and the feature information of the page image information of the browser in the multiple dimensions may be calculated, and according to the vector distances, the similarity between the preset standard page image information and the page image information of the browser is determined. The larger the vector distance is, the smaller the similarity is; conversely, the smaller the vector distance, the greater the similarity.
Optionally, in this embodiment, the step "performing browser page compatibility analysis according to the comparison analysis result, and outputting a browser page compatibility report" may include:
when the similarity between the preset standard page image information and the page image information of the browser is smaller than a preset similarity threshold value, determining that the page compatibility test result of the browser is incompatible;
when the similarity between the preset standard page image information and the page image information of the browser is not smaller than a preset similarity threshold value, determining that the page compatibility test result of the browser is compatible;
and outputting a browser page compatibility report according to the page compatibility test result of each browser.
The preset similarity threshold value can be set according to actual conditions.
In an embodiment, as shown in fig. 1c, a flowchart of a browser compatibility testing method according to the present application is specifically described as follows:
the web front end may obtain display information (i.e., page image information in the above embodiment) of each browser through calling an image display information interface (Api, application programming interface) of the server, so as to display on a front-end page (i.e., a service test result page in the above embodiment), and may also obtain log information of each browser through calling a log information interface Api of the server, so as to display on the front-end page; in addition, the web front end can also manage testing tasks and testing scripts.
The server side can provide test script for adding, deleting, modifying and checking, the test script executes the management of the task queue, and the execution result is recorded to a related database and other related interfaces for the front end to use. In addition, the vnc server can be connected with the client, simultaneously receives image information of the browser transmitted by the client, simultaneously displays browser running log information uploaded by the websocket client on the container in real time, and converts the browser running log information into a related interface for the front end to use.
The embodiment can realize synchronous execution of the multi-node test script, specifically, different browsers under different containers are used as test script execution nodes by using a selenium-gird mode, and after the execution command is up and down reached by the control center, the service test script is distributed to different browsers under different containers to start execution. The control center may be deployed at the web front end.
The Selenium-gidd is part of the Selenium suite, and can be used for running a plurality of test cases on different browsers, operating systems and machines in parallel. Selenium is a tool for Web application testing.
In order to save hardware resources and realize that the same type of browser is installed with different versions, a plurality of selected-ui (a container capable of deploying a browser image interface) containers (dockers) can be deployed on a machine of a cloud resource pool for deploying the browser, and then different types of browsers (such as Safari, chrome, IE, firefox and the like) with different versions are deployed in different dockers.
The VNC client side is used for transmitting page image information of the browser installed in the container to a control center page in real time, and browser page synchronization is achieved. VNC (Virtual Network Console is an abbreviation for Virtual Network Console. It is an excellent software for remote control tools.
In addition, the browser logs can be uploaded to the web front end synchronously in real time, specifically, a container with different installed browsers is connected with the control center in a websocket mode (the real-time performance of log data is guaranteed), and when the browser executes a test script, the logs of the operation of the browser are uploaded to the control center in real time.
The method simultaneously executes the same test case in different types and versions of browsers, and synchronously displays the page views of different browsers on the control center page in a VNC mode, so that a tester can simultaneously execute the same test case on a plurality of browsers of different types and versions, and the compatibility test time of the browsers can be greatly saved; the page views of a plurality of browsers with different types and different versions at the same time can be simultaneously displayed on the page of the control center, so that testers can conveniently and quickly compare the pages and find differences of page display.
As can be seen from the above, the embodiment may determine at least two types of browsers to be tested, and deploy the different types of browsers to different containers in the container cluster; distributing target service test scripts aiming at the browser to each container; starting all containers in parallel to enable browsers deployed in all containers to synchronously execute the target service test scripts; and feeding back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page. The method and the device can execute the same service test script on a plurality of browsers of different types at the same time, so that the compatibility test time of the browsers can be greatly saved, and the test efficiency is improved; moreover, test operation data of multiple browsers of different types at the same time are simultaneously displayed on a service test result page, so that the test personnel can conveniently and quickly compare the test operation data and find the difference of page display.
The method described in the foregoing embodiment will be described in further detail below with an example in which the browser compatibility testing apparatus is specifically integrated in a server.
An embodiment of the present application provides a method for testing browser compatibility, and as shown in fig. 2, a specific process of the method for testing browser compatibility may be as follows:
201. the server determines at least two types of browsers to be tested and deploys the different types of browsers onto different containers in the container cluster.
Specifically, in this embodiment, the browser to be tested may be a browser to be tested for page compatibility, or the browser to be tested is a browser that needs to access a web page to be tested. The webpage to be tested can be a webpage which is completely manufactured by a developer and does not pass the compatibility test.
Optionally, in this embodiment, each browser to be tested may operate in the same terminal, or may operate in multiple terminals.
202. The server acquires an environment configuration instruction; and configuring the test environment of each container in the container cluster based on the environment configuration instruction.
The container can place the test object (i.e. the browser) in the container, and is isolated from the overall environment of the server, so that a developer can set the environment configuration information required by the test object in the container without influencing the environment configuration of the server. Meanwhile, a plurality of containers can be arranged in the server and used for testing different test objects at the same time, environment configuration information required by the test objects of the plurality of containers is respectively arranged in the plurality of containers, and the plurality of containers are isolated from each other, so that the testing of the different test objects at the same time can not generate mutual interference. Therefore, the diversity of the test environment in the same server and the compatibility among different browser tests can be realized by introducing the container, the environment configuration information of the server can be prevented from being greatly modified by developers during each test, the labor cost is reduced, and the efficiency of webpage compatibility test is improved.
The environment configuration information includes a CPU ratio, a memory ratio, a disk space size, and the like, which is not limited in this embodiment.
203. And the server distributes the target service test script aiming at the browser to each container.
The target service test script may be a UI (User Interface) automation script written by using selenium, airtest, or the like. The target business test script may be a test case for testing browser page compatibility. Specifically, the target service test script is a script for detecting whether a browser can normally access and normally displaying the webpage to be tested.
204. And the server starts each container in parallel so as to enable the browser deployed in each container to synchronously execute the target service test script under the corresponding test environment.
The generated Docker mirror image can be obtained, and environment configuration is performed on the Docker mirror image according to the environment configuration instruction, so that the configured Docker mirror image comprises a test environment for starting the container in operation. By running the Docker image, a container is started to run the target service test script in the test environment of the container.
Wherein Docker is an open source application container engine; is a lightweight container technology; docker supports compiling software into a mirror image; then various kinds of software are configured in the mirror image, the mirror image is released, and other users can directly use the mirror image; this mirror image in operation is called a container and container start-up is very fast.
In the embodiment, based on the characteristic that the operating environment of the Docker container is completely isolated from the outside, the automatic test script is operated in the container, so that the test of the browser to be tested is realized.
205. And the server feeds back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page.
And the service test result page is a page at the front end of the web.
Specifically, the browser to be tested can transmit test operation data generated by executing the target service test script to the container server through the websocket, the container server transmits the test operation data to the server for managing the test, and the server transmits the test operation data to the service test result page of the web front end for display.
The websocket is a full-duplex communication protocol based on TCP, and is an independent protocol created on TCP.
The test operation data of each browser is displayed on the service test result page at the same time, so that a tester can compare the same pages of a plurality of browsers at the same time conveniently.
Optionally, in this embodiment, the test operation data includes log information and page image information generated when the browser executes the target service test script.
The log information can be used for analyzing the test result of the browser to be tested. The page image information is specifically a page view when the browser runs the target service test script.
As can be seen from the above, in this embodiment, at least two types of browsers to be tested can be determined by the server, and the different types of browsers are deployed to different containers in the container cluster; acquiring an environment configuration instruction; configuring a test environment of each container in the container cluster based on the environment configuration instruction; distributing target service test scripts aiming at the browser to each container; starting all the containers in parallel to enable the browser deployed in each container to synchronously execute the target service test script under the corresponding test environment; and feeding back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page. The method and the device can execute the same service test script on a plurality of browsers of different types at the same time, so that the compatibility test time of the browsers can be greatly saved, and the test efficiency is improved; moreover, test operation data of multiple browsers of different types at the same time are simultaneously displayed on a service test result page, so that the test personnel can conveniently and quickly compare the test operation data and find the difference of page display.
In order to better implement the above method, an embodiment of the present application further provides a browser compatibility testing apparatus, as shown in fig. 3, the browser compatibility testing apparatus may include a determining unit 301, a distributing unit 302, an executing unit 303, and a presenting unit 304, as follows:
(1) A determination unit 301;
the determining unit is used for determining at least two types of browsers to be tested and deploying the different types of browsers to different containers in the container cluster.
(2) A distribution unit 302;
and the distribution unit is used for distributing the target service test script aiming at the browser to each container.
(3) An execution unit 303;
and the execution unit is used for starting all the containers in parallel so as to enable the browser deployed in each container to synchronously execute the target service test script.
Optionally, in some embodiments of the present application, the execution unit may include an environment configuration subunit and an execution subunit, as follows:
the environment configuration subunit is used for acquiring an environment configuration instruction; configuring a test environment of each container in the container cluster based on the environment configuration instruction;
and the execution subunit is used for starting the containers in parallel so as to enable the browser deployed in each container to synchronously execute the target service test script under the corresponding test environment.
(4) A presentation unit 304;
and the display unit is used for feeding back the test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page.
Optionally, in some embodiments of the present application, the test operation data includes log information generated when the browser executes the target service test script, and page image information.
Optionally, in some embodiments of the present application, the test operation data includes page image information;
the browser compatibility testing device can further comprise a comparison unit and a compatibility analysis unit, and the comparison unit and the compatibility analysis unit are as follows:
the comparison unit is used for comparing and analyzing the page image information of each browser displayed in the service test result page in batches according to preset standard page image information;
and the compatibility analysis unit is used for carrying out browser page compatibility analysis according to the comparison analysis result and outputting a browser page compatibility report.
Optionally, in some embodiments of the present application, the comparing unit may be specifically configured to extract standard feature information of preset standard page image information in multiple dimensions; extracting feature information of the page image information of the browser under multiple dimensions aiming at the page image information of each browser displayed in the service test result page; and determining the similarity between the preset standard page image information and the page image information of the browser according to the standard feature information under the multiple dimensions and the feature information of the page image information of the browser under the multiple dimensions.
Optionally, in some embodiments of the application, the compatibility analysis unit may be specifically configured to determine that a page compatibility test result of the browser is incompatible when a similarity between the preset standard page image information and the page image information of the browser is smaller than a preset similarity threshold; when the similarity between the preset standard page image information and the page image information of the browser is not smaller than a preset similarity threshold value, determining that the page compatibility test result of the browser is compatible; and outputting a browser page compatibility report according to the page compatibility test result of each browser.
As can be seen from the above, in this embodiment, the determining unit 301 may determine at least two types of browsers to be tested, and deploy the different types of browsers to different containers in the container cluster; distributing the target service test script for the browser to each container through a distribution unit 302; starting all the containers in parallel through the execution unit 303, so that the browsers deployed in all the containers synchronously execute the target service test script; the display unit 304 feeds back the test operation data generated by the target service test script executed by each browser to the service test result page in real time, so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page. The method and the device can execute the same service test script on a plurality of browsers of different types at the same time, so that the compatibility test time of the browsers can be greatly saved, and the test efficiency is improved; moreover, test operation data of multiple browsers of different types at the same time are simultaneously displayed on a service test result page, so that the test personnel can conveniently and quickly compare the test operation data and find the difference of page display.
An electronic device according to an embodiment of the present application is further provided, as shown in fig. 4, and shows a schematic structural diagram of the electronic device according to the embodiment of the present application, where the electronic device may be a terminal or a server, and specifically:
the electronic device may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 4 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 401 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and browser compatibility tests by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The electronic device further comprises a power supply 403 for supplying power to the various components, and preferably, the power supply 403 is logically connected to the processor 401 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 404, and the input unit 404 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing various functions as follows:
determining at least two types of browsers to be tested, and deploying the different types of browsers to different containers in a container cluster; distributing target service test scripts aiming at the browser to each container; starting all containers in parallel to enable browsers deployed in all containers to synchronously execute the target service test scripts; and feeding back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
As can be seen from the above, the embodiment may determine at least two types of browsers to be tested, and deploy the different types of browsers to different containers in the container cluster; distributing target service test scripts aiming at the browser to each container; starting all the containers in parallel to enable the browser deployed in each container to synchronously execute the target service test script; and feeding back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page. The method and the device can execute the same service test script on a plurality of browsers of different types at the same time, so that the compatibility test time of the browsers can be greatly saved, and the test efficiency is improved; moreover, test operation data of multiple browsers of different types at the same time are simultaneously displayed on a service test result page, so that the test personnel can conveniently and quickly compare the test operation data and find the difference of page display.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute steps in any one of the methods for testing compatibility of a browser provided in the embodiments of the present application. For example, the instructions may perform the steps of:
determining at least two types of browsers to be tested, and deploying the different types of browsers to different containers in a container cluster; distributing target service test scripts aiming at the browser to each container; starting all containers in parallel to enable browsers deployed in all containers to synchronously execute the target service test scripts; and feeding back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the computer-readable storage medium may include: read Only Memory (ROM), random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the computer-readable storage medium may execute the steps in any one of the browser compatibility testing methods provided in the embodiments of the present application, beneficial effects that can be achieved by any one of the browser compatibility testing methods provided in the embodiments of the present application may be achieved, which are detailed in the foregoing embodiments and will not be described herein again.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the methods provided in the various alternative implementations of the browser compatibility testing aspect described above.
The browser compatibility testing method and the related devices provided by the embodiment of the application are described in detail above, a specific example is applied in the description to explain the principle and the implementation of the application, and the description of the embodiment is only used to help understand the method and the core idea of the application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (10)
1. A browser compatibility testing method is characterized by comprising the following steps:
determining at least two types of browsers to be tested, and deploying the different types of browsers to different containers in a container cluster;
distributing target service test scripts aiming at the browser to each container;
starting all containers in parallel to enable browsers deployed in all containers to synchronously execute the target service test scripts;
and feeding back test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page.
2. The method according to claim 1, wherein before the parallel launching of the containers to enable the browsers deployed in the containers to synchronously execute the target service test script, the method further comprises:
acquiring an environment configuration instruction; configuring a test environment of each container in the container cluster based on the environment configuration instruction;
the parallel starting of each container to enable the browser deployed in each container to synchronously execute the target service test script comprises the following steps:
and starting all the containers in parallel to enable the browser deployed in each container to synchronously execute the target service test script under the corresponding test environment.
3. The method of claim 1, wherein the test run data comprises log information generated when the browser executes the target service test script, and page image information.
4. The method of claim 1, wherein the test run data comprises page image information;
after the test running data generated by the target service test script executed by each browser is fed back to a service test result page in real time so as to synchronously display the test running data corresponding to different types of browsers through the service test result page, the method further comprises the following steps:
comparing and analyzing the page image information of each browser displayed in the service test result page in batches according to preset standard page image information;
and performing browser page compatibility analysis according to the comparison analysis result, and outputting a browser page compatibility report.
5. The method according to claim 4, wherein the comparing and analyzing the page image information of each browser displayed in the service test result page in batches according to preset standard page image information comprises:
extracting standard characteristic information of preset standard page image information under multiple dimensions;
extracting feature information of the page image information of the browser under multiple dimensions aiming at the page image information of each browser displayed in the service test result page;
and determining the similarity between the preset standard page image information and the page image information of the browser according to the standard feature information under the multiple dimensions and the feature information of the page image information of the browser under the multiple dimensions.
6. The method of claim 5, wherein the analyzing the compatibility of the browser page according to the comparison analysis result and outputting a browser page compatibility report comprises:
when the similarity between the preset standard page image information and the page image information of the browser is smaller than a preset similarity threshold value, determining that the page compatibility test result of the browser is incompatible;
when the similarity between the preset standard page image information and the page image information of the browser is not smaller than a preset similarity threshold value, determining that the page compatibility test result of the browser is compatible;
and outputting a browser page compatibility report according to the page compatibility test result of each browser.
7. A browser compatibility testing apparatus, comprising:
the determining unit is used for determining at least two types of browsers to be tested and deploying the different types of browsers to different containers in the container cluster;
the distribution unit is used for distributing the target service test script aiming at the browser to each container;
the execution unit is used for starting all the containers in parallel so as to enable the browser deployed in each container to synchronously execute the target service test script;
and the display unit is used for feeding back the test operation data generated by the target service test script executed by each browser to a service test result page in real time so as to synchronously display the test operation data corresponding to different types of browsers through the service test result page.
8. An electronic device comprising a memory and a processor; the memory stores an application program, and the processor is configured to execute the application program in the memory to perform the operations of the browser compatibility testing method according to any one of claims 1 to 6.
9. A computer readable storage medium storing instructions adapted to be loaded by a processor to perform the steps of the browser compatibility testing method of any one of claims 1 to 6.
10. A computer program product comprising a computer program or instructions, characterized in that the computer program or instructions, when executed by a processor, implement the steps in the browser compatibility testing method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211542929.8A CN115827457A (en) | 2022-12-02 | 2022-12-02 | Browser compatibility testing method and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211542929.8A CN115827457A (en) | 2022-12-02 | 2022-12-02 | Browser compatibility testing method and related equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115827457A true CN115827457A (en) | 2023-03-21 |
Family
ID=85545010
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211542929.8A Pending CN115827457A (en) | 2022-12-02 | 2022-12-02 | Browser compatibility testing method and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115827457A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117312713A (en) * | 2023-10-10 | 2023-12-29 | 中国电力科学研究院有限公司 | Method and system for processing information creation environment based on browser automatic flow |
-
2022
- 2022-12-02 CN CN202211542929.8A patent/CN115827457A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117312713A (en) * | 2023-10-10 | 2023-12-29 | 中国电力科学研究院有限公司 | Method and system for processing information creation environment based on browser automatic flow |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20060265469A1 (en) | XML based scripting framework, and methods of providing automated interactions with remote systems | |
CN102591696A (en) | Method and system for extracting behavioral data of mobile phone software | |
US11237948B2 (en) | Rendering engine component abstraction system | |
CN105975393B (en) | Page display detection method and system | |
CN113791765B (en) | Resource arrangement method, device and equipment of cloud service and storage medium | |
CN113868126A (en) | Application debugging method, device and storage medium of equipment | |
CN107526623B (en) | Data processing method and device | |
CN115061679B (en) | Offline RPA element picking method and system | |
CN113505082B (en) | Application program testing method and device | |
CN112035768A (en) | Page rendering method and device for fast application, storage medium and electronic equipment | |
WO2023040151A1 (en) | Algorithm application element generating method and apparatus, electronic device, computer readable storage medium, and computer program product | |
CN117370203B (en) | Automatic test method, system, electronic equipment and storage medium | |
WO2021061185A1 (en) | Test automation of application | |
CN112732587A (en) | Method and device for acquiring automatic test log, electronic equipment and storage medium | |
Tuovenen et al. | MAuto: Automatic mobile game testing tool using image-matching based approach | |
CN113704590A (en) | Webpage data acquisition method and device, electronic equipment and storage medium | |
CN115827457A (en) | Browser compatibility testing method and related equipment | |
CN111367501A (en) | Software online development method, device, equipment and storage medium | |
CN112783660B (en) | Resource processing method and device in virtual scene and electronic equipment | |
CN116756016A (en) | Multi-browser testing method, device, equipment, medium and program product | |
CN111176924B (en) | GPU card dropping simulation method, system, terminal and storage medium | |
CN111679828A (en) | Data processing method and device, electronic equipment and storage medium | |
CN110737900A (en) | Webpage function testing method and device, server and computer readable storage medium | |
CN115509913A (en) | Software automation test method, device, machine readable medium and equipment | |
CN114968741A (en) | Performance test method, system, equipment and medium based on scene platform |
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 |