CN116149998A - Browser testing method, browser testing device, electronic equipment and computer readable storage medium - Google Patents

Browser testing method, browser testing device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116149998A
CN116149998A CN202211694209.3A CN202211694209A CN116149998A CN 116149998 A CN116149998 A CN 116149998A CN 202211694209 A CN202211694209 A CN 202211694209A CN 116149998 A CN116149998 A CN 116149998A
Authority
CN
China
Prior art keywords
browser
drive
version
information
version 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
CN202211694209.3A
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.)
Mashang Xiaofei Finance Co Ltd
Original Assignee
Mashang Xiaofei Finance 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 Mashang Xiaofei Finance Co Ltd filed Critical Mashang Xiaofei Finance Co Ltd
Priority to CN202211694209.3A priority Critical patent/CN116149998A/en
Publication of CN116149998A publication Critical patent/CN116149998A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

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 present disclosure provides a browser testing method, apparatus, electronic device, and computer-readable storage medium, the method comprising: responding to the error reporting information tested by the browser, and analyzing the error reporting reason; analyzing that the error reporting reason is that the browser driving version is not matched, and acquiring the version information of the currently tested browser; obtaining a drive update address of the browser from the configuration file, obtaining different drive version information of the browser from pages corresponding to the drive update address, and matching the drive version information with the highest matching degree from the drive version information; combining the drive update address of the browser with the drive file name corresponding to the drive version information with the highest matching degree to obtain a drive file downloading address; and downloading the drive file from the drive downloading address, updating the drive file for the browser by using the drive file, and re-executing the browser test after the update of the drive file is completed. According to the embodiment of the invention, the stable operation of the browser test can be ensured.

Description

Browser testing method, browser testing device, electronic equipment and computer readable storage medium
Technical Field
The disclosure relates to the field of computer technology, and in particular relates to a browser testing method, a browser testing device, electronic equipment and a computer readable storage medium.
Background
With the continuous development of computer software, software testing is an important means for guaranteeing and improving the quality of software. At present, most User Interface (UI) tests can be completed based on a browser test framework, the test framework is compatible with most browsers, and realization and presentation methods based on different browser webpage (web) elements are different, so that most enterprises can use various browsers to perform compatibility tests when using the UI tests, and the driver files of the browsers are particularly important as bridges between the browser test framework and various browsers. Therefore, the driver file of the browser needs to be matched with the version of the browser, so that stable operation of the browser test is ensured.
Disclosure of Invention
The invention provides a browser testing method, a device, electronic equipment and a computer readable storage medium, which can realize the matching update of a browser version and a browser driving version in the browser testing process and ensure the stable operation of the browser testing.
In a first aspect, the present disclosure provides a browser testing method, including: responding to the error reporting information tested by the browser, and analyzing the error reporting reason of the error reporting information; acquiring version information of a currently tested browser under the condition that the error reporting reason is analyzed to be that the browser driving version is not matched; obtaining a drive update address of the browser from a preset configuration file, obtaining different drive version information of the browser from a page corresponding to the drive update address, and matching the drive version information with the highest matching degree with the version information of the browser from the obtained drive version information; combining the drive update address of the browser with the drive file name corresponding to the drive version information with the highest matching degree to obtain a download address of the corresponding drive file; downloading the drive file from the drive download address, updating the drive file for the browser by using the downloaded drive file, and re-executing the browser test after the update of the drive file is completed.
In a second aspect, the present disclosure provides a browser testing apparatus, comprising: the analysis module is used for responding to the error reporting information tested by the browser and analyzing the error reporting reason of the error reporting information; the acquisition module is used for acquiring version information of the currently tested browser under the condition that the error reporting reason is analyzed to be unmatched with the browser driving version; the matching module is used for acquiring a drive update address of the browser from a preset configuration file, acquiring different drive version information of the browser from a page corresponding to the drive update address, and matching the drive version information with the highest matching degree with the version information of the browser from the acquired drive version information; the generation module is used for combining the drive update address of the browser with the drive file name corresponding to the drive version information with the highest matching degree to obtain the download address of the corresponding drive file; and the updating module is used for downloading the driving file from the driving download address, updating the driving file of the browser by using the downloaded driving file, and re-executing the browser test after the updating of the driving file is completed.
In a third aspect, the present disclosure provides an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, the one or more computer programs being executable by the at least one processor to enable the at least one processor to perform the test method described above.
In a fourth aspect, the present disclosure provides a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor/processing core, implements the test method described above.
According to the embodiment provided by the disclosure, the error reasons can be automatically resolved in response to the error reporting information in the browser testing process, when the error reporting reasons are mismatching of browser driving versions, different driving version information of the browser is obtained from the page corresponding to the driving update address recorded in the preset configuration file, the driving version information with the highest matching degree with the version information of the currently tested browser in the obtained driving version information is matched, downloading and updating of the browser driving are carried out according to the driving version information with the highest matching degree, and the browser testing is automatically re-executed after updating is completed. According to the method, the browser version and the browser driving version can be automatically matched and updated, so that the browser test can be executed on different versions of browsers, even if the browser test frame is wrongly reported due to mismatching of the browser driving version, the browser driving version with the highest misreporting reason and the highest matching degree with the browser can be automatically analyzed, and the matching between the browser version and the driving version can be realized in an automatic downloading and updating driving mode, so that the browser test can be stably operated, the stability of the browser frame is greatly improved, and the test efficiency is greatly improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure, without limitation to the disclosure. The above and other features and advantages will become more readily apparent to those skilled in the art by describing in detail exemplary embodiments with reference to the attached drawings, in which:
fig. 1 is a flowchart of a browser testing method provided in an embodiment of the present disclosure;
FIG. 2 is a flow chart of a browser testing method according to an exemplary embodiment provided by the present disclosure;
FIG. 3 is a flow chart of another exemplary embodiment browser testing method provided by an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of corresponding driving file addresses of different system information corresponding to a browser driving version according to an embodiment of the present disclosure;
fig. 5 is a block diagram of a browser testing apparatus provided in an embodiment of the present disclosure;
Fig. 6 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
For a better understanding of the technical solutions of the present disclosure, exemplary embodiments of the present disclosure will be described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered as merely exemplary. Accordingly, one 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 present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Embodiments of the disclosure and features of embodiments may be combined with each other without conflict.
As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Most browser testers are now performing browser automation testing using the Web application testing tool (selenium). The Selenium is a browser UI test framework based on web pages, the framework is compatible with most browsers, and tests based on the Selenium framework can directly run in the browser as if a real user is operating. The browser supported by the Selenium framework may include, for example, but is not limited to: version 7, 8, 9, 10, 11 of web browser (Internet Explorer, IE), google browser, firefox browser, etc. The Selenium framework was originally created for testing browsers, web pages.
The Selenium is not a single specific piece of software, but is made up of a plurality of tools, each having a specific function. For example Selenium WebDriver, which is part of a Selenium-based browser, for driving different types of browsers to simulate manual operations; the method has strong flexibility, almost supports all browsers, and can perfectly support the operation of the system only by the browsers. Selenium WebDriver the operation of the browser is implemented through a browser native application programming interface (Application Programming Interface, API), which provides different implementation methods for different browsers, due to the different implementation and presentation methods of different browser web elements.
Because of different implementation and presentation methods of web elements of different browsers, and in order to ensure stability of each main stream browser (such as google browser, firefox browser, IE browser, etc.), most enterprises use multiple browsers to carry out compatibility test when using browser automation test. This makes browser driver files particularly important as a bridge between the Selenium framework and various browsers.
The corresponding browser driver is required to be installed in the Selenium framework, the browser self-determination test can be possibly driven, and various browsers can update iteration continuously, so that corresponding browser driver files can also update iteration timely. Taking google browser as an example, the google browser driver file (chromadriver) has been updated to iterate 132 versions, and iterates one version at intervals. Therefore, when the UI test is performed on the browser for updating iteration, the Selenium framework also needs to update the driving file of the browser, otherwise, only when the browser test is in error, whether the browser driving should be updated is clear through analyzing the log, so that the operation of updating the browser driving is passive; in the artificial analysis and processing process, the log is checked firstly, the browser version is checked, then the latest version matched with the corresponding website is checked, and the driver is updated after downloading, so that time and labor are wasted; because the browser driver is passively updated, the browser test framework can cause failure of test case execution due to the upgrading of the browser at any time, and if the browser is not upgraded, the compatibility of the application programs running on the browser cannot be verified; in the related art, the highest version of browser is usually used for testing the browser and the latest driver is updated manually at regular time, but if the test of the application program running on the browser cannot be aimed at different types of browsers or different versions of browsers, the compatibility of the application program cannot be ensured through the test.
The embodiment of the disclosure provides a browser testing method, which can automatically detect the error report of the browser test, match the driving version of the browser and automatically update the driving of the browser in the browser testing process, thereby improving the testing efficiency and the stability of a browser testing frame; and in the browser testing process, the automatic testing of the application programs operated on the browser is carried out aiming at the browsers of different versions, so that the compatibility of the application programs operated on the browser to the browsers of different versions is guaranteed.
The browser testing method according to the embodiments of the present disclosure may be performed by an electronic device such as a terminal device or a server, where the terminal device may be a vehicle-mounted device, a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like, and the method may be implemented by a processor invoking computer readable program instructions stored in a memory. The servers may include independent physical servers, a server cluster consisting of multiple servers, or cloud servers capable of cloud computing.
Fig. 1 is a flowchart of a browser testing method provided in an embodiment of the present disclosure. Referring to fig. 1, the browser test method may include the following steps.
S110, responding to the error reporting information tested by the browser, and analyzing the error reporting reason of the error reporting information.
In this step, browser testing is an automated test of browser operation. Such as automated testing of a web application running on a browser, browser operations including, for example, but not limited to, opening a UI interface of the web application, and the like.
In some embodiments, browser testing may be performed by a browser test framework, such as a Selenium framework, executing test cases. The automatic test framework can provide the most basic automatic test function, such as automatically opening a program, testing whether the UI interface can normally display, simulate a mouse and a keyboard to click or operate the tested object, and finally verifying the attribute of the tested object to judge the correctness of the program.
Taking a Selenium framework as an example, when the Selenium framework performs a browser test, the test content includes compatibility between a test application program and a browser. For example, testing whether an application can run on a different type of browser; the Selenium framework supports multiple types of browsers, so that test cases can be freely switched among different types of browsers, the operation of the browsers is kept uniform, and the overall efficiency of testing is improved. The test cases are used for providing test data for browser testing, and the test data are specially designed for testing data for operating application software on the browser to realize corresponding functions.
It should be appreciated that the browser test framework may also be other test frameworks other than a Selenium framework, such as an automated web test framework tellludium, a functional test tool (Quick Test Professional, QTP), and a Selenium-based browser test framework phoenix automation, etc., and embodiments of the present disclosure are not specifically limited.
And S120, acquiring version information of the currently tested browser under the condition that the error reporting reason is not matched with the browser driving version.
In the disclosed embodiment, when performing browser testing, the browser driver is to use the browser to simulate a file necessary to open the corresponding browser. Taking a Selenium frame as an example, after the browser driver is installed in the Selenium frame, the browser driver can drive the browser to simulate user operations, such as mouse clicking, keyboard input and the like, and meanwhile, acquisition, automatic downloading and the like of target content can also be realized.
In the step, the error reporting information can be automatically analyzed and error analyzed, and if the error reporting reason is analyzed: and if the version of the browser driver installed in the Sepenum framework is inconsistent with the version of the browser driver, firstly acquiring the version information of the currently tested browser, and providing information for the subsequent matching step of the browser driver for the browser version.
S130, acquiring a drive update address of the browser from a preset configuration file, acquiring different drive version information of the browser from a page corresponding to the drive update address, and matching the drive version information with the highest matching degree with the version information of the browser from the acquired drive version information.
Illustratively, assume that the version information of the browser is chrome109.0.5414.25, which means that: the type of the currently tested browser is a Chrome browser of google company, and the version number is 109.0.5414.25; if the different driving version information of the browser is obtained from the page corresponding to the driving update address, the method comprises the following steps: "108.0.5359.71", "109.0.5414.25", "108.0.5359.22", etc., wherein "109.0.5414.25" is identical to the version number "109.0.5414.25" of the currently tested browser, and thus the drive version information having the highest degree of matching is "109.0.5414.25".
Illustratively, assume that the version information of the browser is chrome105.0.5195.102, which means that: the type of the currently tested browser is a Chrome browser of google company, and the version number is 105.0.5195.102; if the different driving version information of the browser is obtained from the page corresponding to the driving update address, the method comprises the following steps: "105.0.5195.19", "105.0.5195.52", "105.0.5249.21", wherein "105.0.5195.52" is closest to version information of version number "105.0.5195.102" of the currently tested browser, and thus, the drive version information having the highest matching degree is "105.0.5195.52".
In the step, a configuration file can be pre-stored in a terminal device or a server running by a browser test framework, a drive update address of the browser is recorded in the configuration file, the drive update address is a page access address, and page contents of the drive update address can be obtained by accessing the page access address, wherein the page contents comprise different drive version information of the browser; by matching the version information of the browser with the drive version information, the drive version information with the highest matching degree can be obtained, wherein the highest matching degree indicates that the version numbers are consistent or the version numbers are closest.
And S140, combining the drive update address of the browser and the drive file name corresponding to the drive version information with the highest matching degree to obtain the download address of the corresponding drive file.
In this step, the drive update address of the browser may be a domain name (Domain Name Server) address or a IP (Internet Protocol Address) address indicated by a numeral.
Taking the example that the drive update address of the browser is a domain name address, for example, the domain name address of the drive update address of the browser is: http:// www.xxxx.com/index. Assuming that the driving version information having the highest matching degree with the version information of the browser is "3.9.0"; the drive version information may correspond to one or more drive file names, and may include, for example, file name 1"iedrive server_wind32_3.9.0.zip", file name 2"iedrive server_x64_3.9.0.zip", and the like.
For example, the drive update address "http:// www.xxxx.com/index. Html" is combined with the drive file name 1 corresponding to the drive version information with the highest matching degree, so as to obtain the download address of the corresponding drive file as follows: http:// www.xxxx.com/index. Html/3.9/IEDriverServer_Win32_3.9.0.zip;
for example, the drive update address "http:// www.xxxx.com/index. Html" is combined with the drive file name 2 corresponding to the drive version information with the highest matching degree, so as to obtain the download address of the corresponding drive file as follows: http:// www.xxxx.com/index. Html/3.9/IEDriverServer_x64_3.9.0.Zip.
In the step, the drive update address of the browser and the drive file name corresponding to the drive version information with the highest matching degree are combined, so that the download address of one or more drive files with the highest matching degree with the version of the browser can be obtained.
And S150, downloading the drive file from the drive download address, updating the drive file of the browser by using the downloaded drive file, and re-executing the browser test after the update of the drive file is completed.
In the step, after the drive file is downloaded, a file storage directory of the original drive file of the browser is obtained, the original drive file of the browser is obtained and deleted in the file storage directory, and the downloaded drive file is copied to the file storage directory to realize the update of the drive file. In some embodiments, if the driving file is in the form of a compressed file, the compressed file of the driving file may be decompressed first, and then the decompressed driving file may be copied to the file storage directory.
According to the testing method of the embodiment of the disclosure, error reasons can be automatically resolved in response to error reporting information in the browser testing process, when the error reporting reasons are mismatching of browser driving versions, different driving version information of the browser is obtained from pages corresponding to driving update addresses recorded in a preset configuration file, driving version information with highest matching degree with the version information of the currently tested browser in the matching is obtained, downloading and updating of browser driving are carried out according to the driving version information with highest matching degree, and browser testing is re-executed after updating is completed. According to the method, automatic matching update of browser versions and browser driving versions can be realized, so that browser testing can be performed on different versions of browsers, even if the browser testing frame reports errors due to mismatching of browser driving versions, the browser driving versions with highest error reporting reasons and matching and browser matching degrees can be automatically downloaded and updated in a driving mode, matching of the browser versions and the driving versions is realized, stable operation of browser testing is guaranteed, stability of the browser testing frame is greatly improved, testing efficiency is greatly improved, and according to the browser testing method, testing of application programs operated on different versions of browsers can be performed on the browsers in the browser testing process, and compatibility of the application programs operated on the browsers on the different versions of browsers is guaranteed.
In some embodiments, the method further comprises: prior to step S130, further comprising: acquiring version information of a currently tested browser and driving version information of the currently tested browser at intervals; after performing step S130, the method further comprises: if the matched driving version information with the highest matching degree is inconsistent with the driving version information of the currently tested browser, steps S140 and S150 are executed.
In the embodiment, the driving version of the browser can be updated regularly, so that the regular update of the driving version of the browser is maintained, the error reporting caused by unmatched driving versions of the browser in the browser testing process can be reduced, and the testing efficiency of the browser is improved.
In some embodiments, the browser test method further includes the following steps before step S110.
S11, acquiring a test command generated by a continuous integration tool; the test command is used for automatically starting a test task through the browser test framework, the test task is a task which is built by a continuous integration tool in advance according to configuration parameters, and the configuration parameters comprise: browser version information and version update switch information indicating whether or not to allow triggering of an update of the browser-driven version.
In some embodiments, the persistence integration tool is a persistence application based on an open source persistence integration server, supports the entire software development lifecycle from build, test, record, and deploy, and is used to monitor the constantly recurring work. Illustratively, the continuous integration tool may be a Jenkins automated deployment tool, or may be BuildMaster, microtica, circleCI or other continuous integration tools that may replace Jenkins, and embodiments of the disclosure are not limited in detail.
In some embodiments, the continuous integration tool may obtain the configuration parameters in a plurality of ways, for example, the continuous integration tool may provide a configuration interface through which configuration parameters input by a user are received; alternatively, the persistent integration tool may also read a configuration file of the predetermined storage location to obtain configuration parameters recorded in the configuration file.
S12, analyzing the test command to obtain browser version information and version update switch information.
In the step, when the continuous integration tool runs on the electronic equipment or the server, the configuration information contained in the command, namely browser version information and version update switch information, is obtained by analyzing the test command generated by the continuous integration tool.
In some embodiments, the version information of the browser may include a type of browser and a version number of the browser, and the version update switch information is used to indicate whether to allow triggering of an update to a browser driver version in case the version of the browser under test does not match a driver version of the browser used in the test environment. Specifically, if the version update switch information shows that the update switch is in an on state, the update of the browser driving version is allowed to be triggered; if the version update switch information indicates that the update switch is in an off state, the update of the browser driving version is not allowed to be triggered.
S13, automatically executing the browser testing operation corresponding to the browser version information through the browser testing framework, and performing browser testing through the testing operation.
Illustratively, jenkins is an open source software project, which is a persistent integration tool developed based on the Java development language, for monitoring persistent repetitive work. For example, using Jenkins automated deployment tools to create test tasks and automatically launch the test tasks through a browser test framework to run test code. For example, if the preset timing test time is 8 o 'clock a day, jenkins automatically executes the preset test task through the browser test frame when the current time is 8 o' clock a day, and monitors the running process of the browser test frame. Illustratively, when Jenkins monitor that an error occurs in the Selenium framework when a test task is executed, error information automatically generated by the Selenium framework can be obtained by reading a log file or checking a test report in the Selenium.
Through the steps S11-S13, the continuous integration tool creates a test task through configuration parameters and generates a corresponding test command, so that the browser test framework can automatically execute the corresponding automatic test task, and version information and version update switch information of the browser for which the browser test framework executes the test task can be obtained through analyzing the test command. In the browser testing process, if the Jenkins monitors that the browser tests and reports errors, and the error reporting reasons are analyzed to be mismatching of browser driving versions, the processing of automatically updating the browser driving can be triggered according to the fact that an update switch indicated by version update switch information is in an on state.
In some embodiments, the step of resolving the error reporting cause of the error reporting information in step S110 may specifically include: obtaining error prompt information in the error prompt information, and if the error prompt information comprises: and the fixed information is used for prompting that the browser driving version is not matched with the browser version, and determining that the error reporting reason is that the browser driving version is not matched.
Illustratively, the error message is "message: message session not created: this version of ChromeDriver only supports Chrome version 96Current browser version is 102.0.5005.63with binary path "; the meaning of the error reporting information is as follows: "message: no session is created; this version of google browser driver only supports the google browser 96 version, with the current browser version being 102.0.5005.63".
Wherein, "session not created" is a fixed hint information of the non-created session, and the hint information is generated by: the version of the current browser is inconsistent with the version of the browser driver; therefore, if the error reporting information contains the fixed prompt information, the reason for the error reporting can be determined to be that the browser driving version is not matched with the browser version.
In this embodiment, after the error reporting information is obtained, if the browser version and the driving version are not identical, the error reporting information includes a fixed error type and a prompt message; therefore, as long as the fixed error type and the prompt message are found in the error reporting information, the error reporting reason can be determined as follows: the browser driver version does not match the browser version.
In some embodiments, the step of obtaining version information of the currently tested browser in step S120 may specifically include: s21, analyzing the test command to obtain browser version information and version update switch information; s22, determining a drive version of the browser to be updated under the condition that version updating switch information is in an on state; s23, the browser version information obtained through analysis is used as the version information of the currently tested browser; or searching browser version information in the error reporting information according to a preset regular expression, wherein the regular expression is used for indicating the display rule of the version information of the browser in the error reporting information; and taking the searched browser version information meeting the display rule as the version information of the currently tested browser.
Illustratively, there are two ways to obtain version information of the currently tested browser. One way is to directly obtain the browser version information and version update switch information from the test command generated by the continuous integration tool, analyze the test command, and take the browser version information obtained by analysis as the obtained browser version information; another way is matching browser version information through regular expressions. For example, a matching function containing a regular expression is "re.findall (" Current browser version is (.?; the regular expression is "Current browser version is (x.
In this embodiment, under the condition that the version update switch information indicates that the version update switch is in an on state, the driving version of the browser is determined to be updated, and at this time, the browser version information of the current test can be automatically obtained in any one of the two modes.
In some embodiments, the version information of the browser includes a browser type and a browser version number; step S130 may specifically include the following steps.
S31, obtaining the mirror image address of the driving file corresponding to the browser type from the preset configuration file.
In this step, the link address of the mirror website where the file is located is driven when the address is mirrored. The mirror image website is a website which is deployed by placing the content of the website where the driving file is located on a server in another place, wherein the server can be a website which is purchased in advance and hosted, or can be a virtual server; the mirror image address of the mirror image website can play a role in shunting, and is beneficial to relieving the access pressure of the website where the driving file is located.
S32, accessing the mirror image address, and taking the page content corresponding to the obtained mirror image address as the first page content.
In the step, the address link of the mirror image address is accessed, and corresponding page content can be obtained as first page content; the first page content includes: version information of each version of the browser driver file corresponding to the browser type.
S33, acquiring at least one piece of drive version information corresponding to the browser type contained in the first page content; wherein the drive version information includes a drive version number.
And S34, performing similarity matching on each drive version number and the browser version number, and taking the drive version information of the drive version number with the highest similarity with the browser version number as the drive version information with the highest matching degree.
In this step, the similarity matching method of text similarity can be used to calculate the similarity between each drive version number and the browser version number, and perform similarity matching scoring (the higher the similarity is, the higher the similarity matching score is), and the drive version number with the highest score is selected according to the scoring result and is used as the version number with the highest matching degree.
Through the steps S31-S34, version information of each version of the browser driving file corresponding to the browser type under test can be obtained in the corresponding access page based on the access to the mirror image address of the driving file contained in the configuration file, and the driving version number with the highest similarity (closest) with the version number of the browser under test is matched from the version information of each version of the browser driving file, so that the driving version required by the version of the browser under test can be automatically obtained, the dependence on manually updating the browser driving is reduced, and the stability of the browser testing framework is improved.
In some embodiments, the drive version information further comprises: address links corresponding to each drive version number; in step S34, the step of using the driving version information belonging to the driving version number having the highest similarity to the browser version number as the driving version information having the highest matching degree may specifically include the following steps:
s41, accessing an address link corresponding to a drive version number with highest browser version number similarity, and taking page content corresponding to the obtained address link as second page content; s42, obtaining at least one piece of drive downloading information contained in the second page content, wherein each piece of drive downloading information comprises the following components: system information and drive file names; s43, taking the system information of the running environment tested by the browser as target system information, and acquiring a drive file name corresponding to the target system information from at least one drive download information as drive version information with highest matching degree.
In this embodiment, each driving version information may include: drive file names corresponding to different system information. At least one piece of drive downloading information can be obtained in the corresponding access page by accessing each piece of drive version information, namely address links corresponding to version numbers, wherein each piece of drive downloading information comprises system information and corresponding drive file names; and acquiring the system information of the current server, and acquiring the corresponding drive file name through the system information to obtain the drive file name with the highest matching degree with the browser type and the system information of the current test.
In some embodiments, step S140 may specifically include: and combining the drive update address of the browser, the drive version number with the highest similarity with the version number of the browser and the drive file name corresponding to the target system information into a download address as a drive download address.
Illustratively, taking the example that the browser type is google browser, the drive update address of the browser is:
"http:// chromadriver. Storage. Google apis. Com/index. Htmlpath="; the version number with the highest matching degree is 105.0.5195.52; drive file name corresponding to target system information: chromadriver_win32.zip; the combined drive download address is:
“http://chromedriver.storage.googleapis.com/index.htmlpath=105.0.5195.52/chromedriv er_win32.zip”。
in this embodiment, the download address of the browser driver file is generated by combining the driver update address, the matched version number, and the driver file name corresponding to the target system information, so as to download the corresponding browser driver file.
According to the browser testing method, the browser version and the browser driving version can be automatically matched and updated, so that the browser testing can be performed on different versions of browsers, even if the browser testing frame reports errors due to mismatching of the browser driving version, the browser driving version with the highest matching degree of the browser can be automatically downloaded and updated in a driving mode by automatically analyzing the error reporting reasons and automatically matching, matching of the browser version and the driving version is achieved, stable operation of the browser testing can be guaranteed, stability of the browser testing frame is greatly improved, testing efficiency is greatly improved, and according to the browser testing method, automatic testing of application programs operated on different versions of browsers can be conducted on the browsers in the browser testing process, compatibility of the application programs operated on the browsers on the different versions of browsers is guaranteed, and stable operation of user interfaces on different browsers and versions is also facilitated.
The process flow of the browser test method of the exemplary embodiment of the present disclosure is described below by way of fig. 2 to 3. FIG. 2 illustrates a flow chart of a browser testing method of an exemplary embodiment of the present disclosure; fig. 3 shows a flowchart of a browser testing method of another exemplary embodiment.
As shown in fig. 2, the browser testing method includes the following steps:
s201, starting a browser test.
In the step, a test command is generated through the continuous integration tool, a browser test frame is used for automatically executing the test operation of the browser corresponding to the browser version information according to the test command, and the browser test is carried out through the test operation.
S202, when the browser tests the error report, acquiring error report information and analyzing error report reasons.
In the step, error prompt information in the error information is obtained, and if the error prompt information comprises: and the fixed information is used for prompting that the browser driving version is not matched with the browser version, and determining that the error reporting reason is that the browser driving version is not matched.
And S203, matching the browser version tested at present with the browser driving version automatically to obtain the matched browser driving version.
In the step, a drive update address of the browser is obtained from a preset configuration file, different drive version information of the browser is obtained from a page corresponding to the drive update address, similarity matching is carried out on each drive version number and the browser version number, a drive version number with the highest similarity with the browser version number is used as a target version number, a link page corresponding to the target version number is accessed, and drive file names corresponding to different system information contained in the link page are obtained, so that the drive file names corresponding to the system information of the running environment tested by the current browser in screening are used as the finally matched browser drive version.
S204, downloading the matched driving file, updating the driving file, and restarting the browser test after updating the driving file.
In the step, after downloading the driving file, acquiring a file storage directory of an original driving file of the browser, acquiring and deleting the original driving file of the browser in the file storage directory, copying the downloaded driving file to the file storage directory, and updating the driving file; and restarting the browser test after updating the driving file.
According to the browser testing method, the browser version and the browser driving version can be automatically matched and updated, so that the browser testing can be performed on different versions of browsers, even if the browser testing frame reports errors due to mismatching of the browser driving version, the browser driving version with the highest error reporting reason and the highest matching degree of the browser can be automatically analyzed, the browser version and the driving version can be automatically downloaded and updated to be driven, the matching of the browser version and the driving version is realized, the stable operation of the browser testing can be ensured, the stability of the browser frame is greatly improved, the testing efficiency is greatly improved, and according to the browser testing method, the automatic testing of the application programs operated on the browsers can be performed on the browsers of different versions, and the compatibility of the application programs operated on the browsers to the browsers of different versions can be guaranteed.
As shown in fig. 3, the browser testing method includes the following steps.
S301, constructing a test task through a continuous integration tool.
In this step, a test task may be created, for example, by a Jenkins automated deployment tool, in which the browser type, browser version, and parameters whether to trigger an update are configured; after the test task is created, the configured browser type, browser version and parameters of whether to trigger updating can be transmitted to a terminal device or a server for executing the test method of the browser.
S302, receiving a test command generated by the continuous integration tool.
In this step, a data interface may be constructed, through which a test command of Jenkins is received, and configuration parameters of a test task to which the test command (instruction) is directed are obtained, specifically, parameters of a browser type parameter, a browser version parameter, and version update switch information (for indicating whether to trigger update) of the test task corresponding to the command are obtained.
S303, analyzing the test command and starting the browser test.
In this step, a browser test operation corresponding to the browser version information is automatically executed by the browser test framework, and a browser test is performed by the test operation.
S304, judging whether the browser testing process reports errors or not; if the test procedure fails, step S305 is executed, otherwise step S310 is executed.
S305, judging whether the error reporting cause is caused by the version, if so, executing the step S306, otherwise, executing the step S310.
In this step, error reporting information is obtained, and if the error reporting information includes: and the fixed information is used for prompting that the browser driving version is not matched with the browser version, and determining that the error reporting reason is the mismatching of the browser driving version, namely that the error reporting reason is the version reason.
S306, judging whether to update the browser driver, if yes, executing step S307, otherwise, executing step S310.
In the step, if the received version update switch information is used for indicating that the update of the browser driver version is allowed to be triggered, the browser driver is judged to be updated; if the version update switch information is used for indicating that the update of the browser driver version is not allowed to be triggered, the browser driver is judged not to be updated.
S307, the current browser version is acquired, and the configuration file is read to acquire corresponding information.
In this step, the current browser version may be derived from the received browser version parameters; browser version information can also be searched in the error reporting information through a regular expression.
In this step, the terminal device or the server executing the browser testing method may store the configuration file, where a drive update address of the browser is recorded, and obtain different drive version information of the browser in a page corresponding to the drive update address.
Illustratively, the closest version may be matched and screened out by a packaged version screening method. If the browser type received through the data interface with Jenkins is google browser, the address of updating the google browser driver in the configuration file is found, all version information of the google browser driver can be obtained through the address, the version information of the google browser driver is processed into an information list, each version and the current browser version are traversed to carry out text similarity matching, and the version with the highest matching degree is selected to be the required driving version.
Further, the driving version suitable for the system can be screened out by a packaged method for automatically acquiring the current automatic testing environment. The method is concretely realized as follows: after the browser driving version with the highest matching degree is obtained, each browser driving version further comprises browser driving versions (win 32, linux64, mac64 and the like) based on different systems. For example, the system information of the current server may be acquired through a method (sys.platform) of a computer programming language (Python) and then the corresponding drive file address may be acquired through the system information.
Fig. 4 illustrates a corresponding drive file address schematic diagram of different system information corresponding to a browser drive version of an exemplary embodiment of the present disclosure. In fig. 4, when the version number of the browser driver version is "105.0.5195.52", the access page corresponding to the version number is shown as follows: different system information corresponding to the browser driving version and driving file names corresponding to each system information, for example, the system information is Linux64, and the corresponding driving file name is chromadriver_linux64. Zip; the system information is mac64, and the corresponding drive file name is chromadriver_mac64. Zip, or the like.
In this embodiment, the browser driver update address domain name, the matched driver version information, and the driver file name to which the system information transition port should be applied are combined to obtain the driver download address.
S308, executing an update flow.
In the step, the file of the address is downloaded through a public method, wherein the public method is to realize the code needed by the download when the drive download address is called and the download of the drive file is executed; after downloading the compressed file of the driving file, decompressing the compressed file of the driving file to obtain a decompressed file of the driving file, and replacing the original browser driving file with a new decompressed driving file.
S309, re-executing the browser test after the update of the drive file is completed.
S310, after the browser test is completed, ending the browser test flow.
According to the browser testing method, the abnormality that the browser is not matched with the browser driving version in the browser testing process can be captured, the current browser version is obtained, the driving file is downloaded and decompressed and updated after the driving version is matched according to the configuration file, dependence of manually updating the browser driving is greatly reduced, the stability of the browser frame is improved, and therefore testing efficiency is greatly improved.
It will be appreciated that the above-mentioned method embodiments of the present disclosure may be combined with each other to form a combined embodiment without departing from the principle logic, and are limited to the description of the present disclosure. It will be appreciated by those skilled in the art that in the above-described methods of the embodiments, the particular order of execution of the steps should be determined by their function and possible inherent logic.
In addition, the disclosure further provides a browser testing device, an electronic device, and a computer readable storage medium, where the foregoing may be used to implement any one of the browser testing methods provided in the disclosure, and corresponding technical schemes and descriptions and corresponding descriptions referring to method parts are not repeated.
Fig. 5 is a block diagram of a browser testing apparatus according to an embodiment of the present disclosure. Referring to fig. 5, an embodiment of the present disclosure provides a browser testing apparatus 500, which may include the following modules.
The parsing module 510 is configured to parse a failure reporting cause of the failure reporting information in response to the failure reporting information tested by the browser;
the obtaining module 520 is configured to obtain version information of the currently tested browser when the error reason is not matched with the browser driving version;
the matching module 530 is configured to obtain a driving update address of the browser from a preset configuration file, obtain different driving version information of the browser in a page corresponding to the driving update address, and match driving version information with highest matching degree with version information of the browser from the obtained driving version information;
the generating module 540 is configured to combine the drive update address of the browser with a drive file name corresponding to the drive version information with the highest matching degree, so as to obtain a download address of the corresponding drive file;
And the updating module 550 is configured to download the driving file from the driving download address, update the driving file for the browser using the downloaded driving file, and re-execute the browser test after the updating of the driving file is completed.
In some embodiments, the browser testing apparatus further comprises: the command acquisition module is used for acquiring a test command generated by the continuous integration tool before responding to the error reporting information tested by the browser and analyzing the error reporting reason of the error reporting information; the test command is used for automatically starting a test task through the browser test framework, the test task is a task which is built by a continuous integration tool in advance according to configuration parameters, and the configuration parameters comprise: browser version information and version update switch information, the version update switch information being used to indicate whether to allow triggering of update of browser-driven version; the command analysis module is used for analyzing the test command to obtain browser version information and version update switch information; and the testing module is used for automatically executing the testing operation of the browser corresponding to the browser version information through the browser testing framework and carrying out browser testing through the testing operation.
In some embodiments, the parsing module 510 is specifically configured to, when used to parse the error reporting cause of the error reporting information: obtaining error prompt information in the error prompt information, and if the error prompt information comprises: and the fixed information is used for prompting that the browser driving version is not matched with the browser version, and determining that the error reporting reason is that the browser driving version is not matched.
In some embodiments, the obtaining module 520, when used to obtain version information of the currently tested browser, is specifically configured to: analyzing the test command to obtain browser version information and version update switch information; under the condition that version updating switch information is in an on state, determining a driving version of the browser to be updated; the browser version information obtained through analysis is used as the version information of the currently tested browser; or searching browser version information in the error reporting information according to a preset regular expression, wherein the regular expression is used for indicating the display rule of the version information of the browser in the error reporting information; and taking the searched browser version information meeting the display rule as the version information of the currently tested browser.
In some embodiments, the version information of the browser includes a browser type and a browser version number; the matching module 530 is specifically configured to: obtaining a mirror image address of a driving file corresponding to the browser type from a preset configuration file; accessing the mirror image address, and taking the page content corresponding to the obtained mirror image address as first page content; acquiring at least one piece of drive version information corresponding to the browser type contained in the first page content; the driving version information comprises a driving version number; and performing similarity matching on each drive version number and the browser version number, and taking the drive version information of the drive version number with the highest similarity with the browser version number as the drive version information with the highest matching degree.
In some embodiments, the drive version information further comprises: address links corresponding to each drive version number; the matching module 530 is specifically configured to: when the driving version information of the version number with the highest matching degree is used as the driving version information with the highest matching degree, the method is specifically used for: accessing an address link corresponding to a driving version number with highest similarity to the browser version number, and taking page content corresponding to the obtained address link as second page content; at least one piece of drive downloading information contained in the second page content is acquired, and each piece of drive downloading information comprises the following components: system information and drive file names; and taking the system information of the running environment tested by the browser as target system information, and acquiring a drive file name corresponding to the target system information from at least one drive download information as drive version information with highest matching degree.
In some embodiments, the generating module 540 is specifically configured to combine the drive update address of the browser, the drive version number with the highest similarity to the browser version number, and the drive file name corresponding to the target system information into a download address as the drive download address.
According to the browser testing device, the error reasons can be automatically resolved in response to the error reporting information in the browser testing process, when the error reporting reasons are mismatching of browser driving versions, different driving version information of the browser is obtained from the page corresponding to the driving update address recorded in the preset configuration file, the driving version information with the highest matching degree with the version information of the currently tested browser in the matching is obtained, downloading and updating of the browser driving are carried out according to the driving version information with the highest matching degree, and the browser testing is automatically re-executed after updating is completed. According to the browser testing device, automatic matching updating of browser versions and browser driving versions can be achieved, so that browser testing can be performed on different versions of browsers, even if the browser testing frames report errors due to mismatching of the browser driving versions, the browser driving versions with highest error reporting reasons and matching degrees of the automatic matching and the browser can be automatically downloaded and updated in a driving mode, matching of the browser versions and the driving versions is achieved, automatic testing of the browsers can be guaranteed to be stably operated, stability of the browser testing frames is greatly improved, testing efficiency is greatly improved, and according to the browser testing method, automatic testing of application programs operated on the browsers can be conducted on the browsers of different versions in the browser testing process, and compatibility of the application programs operated on the browsers to the browsers of different versions is guaranteed.
It should be clear that the invention is not limited to the specific arrangements and processes described in the foregoing embodiments and shown in the drawings. For convenience and brevity of description, detailed descriptions of known methods are omitted herein, and specific working processes of the systems, modules and units described above may refer to corresponding processes in the foregoing method embodiments, which are not repeated herein.
Fig. 6 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Referring to fig. 6, an embodiment of the present disclosure provides an electronic device including: at least one processor 601; at least one memory 602, and one or more I/O interfaces 603, connected between the processor 601 and the memory 602; the memory 602 stores one or more computer programs executable by the at least one processor 601, and the one or more computer programs are executed by the at least one processor 601 to enable the at least one processor 601 to perform the browser testing method described above.
The disclosed embodiments also provide a computer readable storage medium having a computer program stored thereon, wherein the computer program when executed by a processor/processing core implements the browser test method described above. The computer readable storage medium may be a volatile or nonvolatile computer readable storage medium.
Embodiments of the present disclosure also provide a computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when executed in a processor of an electronic device, performs the above-described browser test method.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between the functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer-readable storage media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable program instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, random Access Memory (RAM), read Only Memory (ROM), erasable Programmable Read Only Memory (EPROM), static Random Access Memory (SRAM), flash memory or other memory technology, portable compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical disc storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and may include any information delivery media.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for performing the operations of the present disclosure can be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present disclosure are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information of computer readable program instructions, which can execute the computer readable program instructions.
The computer program product described herein may be embodied in hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium, and in another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts 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 disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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.
Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted in a generic and descriptive sense only and not for purpose of limitation. In some instances, it will be apparent to one skilled in the art that features, characteristics, and/or elements described in connection with a particular embodiment may be used alone or in combination with other embodiments unless explicitly stated otherwise. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the disclosure as set forth in the appended claims.

Claims (10)

1. A browser testing method, comprising:
responding to error reporting information tested by a browser, and analyzing error reporting reasons of the error reporting information;
acquiring version information of a currently tested browser under the condition that the error reporting reason is analyzed to be that the browser driving version is not matched;
acquiring a drive update address of the browser from a preset configuration file, acquiring different drive version information of the browser from a page corresponding to the drive update address, and matching the drive version information with the highest matching degree with the version information of the browser from the acquired drive version information;
Combining the drive update address of the browser with the drive file name corresponding to the drive version information with the highest matching degree to obtain a download address of the corresponding drive file;
and downloading the drive file from the drive downloading address, updating the drive file for the browser by using the downloaded drive file, and re-executing the browser test after the update of the drive file is completed.
2. The method of claim 1, wherein prior to parsing the error cause of the error message in response to the browser test, the method further comprises:
acquiring a test command generated by a continuous integration tool; the test command is used for starting a test task through a browser test framework, the test task is constructed by the continuous integration tool in advance according to configuration parameters, and the configuration parameters comprise: browser version information and version update switch information, the version update switch information being used to indicate whether to allow triggering of update of browser-driven version;
analyzing the test command to obtain the browser version information and the version update switch information;
And executing the browser testing operation corresponding to the browser version information through the browser testing frame, and executing the browser testing through the testing operation.
3. The method according to claim 2, wherein said parsing the error cause of the error message comprises:
obtaining error prompt information in the error prompt information, if the error prompt information comprises: and the fixed information is used for prompting that the browser driving version is not matched with the browser version, and determining that the error reporting reason is that the browser driving version is not matched.
4. The method according to claim 2, wherein the obtaining version information of the currently tested browser includes:
analyzing the test command to obtain the browser version information and the version update switch information;
under the condition that the version updating switch information is in an on state, determining that a driving version of the browser needs to be updated;
the browser version information obtained through analysis is used as the version information of the currently tested browser; or alternatively, the process may be performed,
searching browser version information in the error reporting information according to a preset regular expression, wherein the regular expression is used for indicating a display rule of the version information of the browser in the error reporting information; and taking the searched browser version information conforming to the display rule as the version information of the currently tested browser.
5. The method of claim 1, wherein the version information of the browser includes a browser type and a browser version number; the method for obtaining the drive update address of the browser from the preset configuration file, obtaining different drive version information of the browser from a page corresponding to the drive update address, and matching the drive version information with the highest matching degree with the version information of the browser from the obtained drive version information comprises the following steps:
obtaining a mirror image address of a driving file corresponding to the browser type from the preset configuration file;
accessing the mirror image address, and taking the obtained page content corresponding to the mirror image address as first page content;
acquiring at least one piece of drive version information corresponding to the browser type contained in the first page content; wherein the drive version information includes a drive version number;
and performing similarity matching on each drive version number and the browser version number, and taking the drive version information of the drive version number with the highest similarity with the browser version number as the drive version information with the highest matching degree.
6. The method of claim 5, wherein the driving version information further comprises: address links corresponding to each drive version number; the step of using the driving version information of the driving version number with the highest similarity with the browser version number as the driving version information with the highest matching degree comprises the following steps:
accessing an address link corresponding to a driving version number with highest similarity to the browser version number, and taking the obtained page content corresponding to the address link as second page content;
obtaining at least one piece of drive downloading information contained in the second page content, wherein each piece of drive downloading information comprises the following components: system information and drive file names;
and taking the system information of the running environment tested by the browser as target system information, and acquiring a drive file name corresponding to the target system information from the at least one drive downloading information as drive version information with highest matching degree.
7. The method of claim 6, wherein the combining the drive update address of the browser and the drive file name corresponding to the drive version information with the highest matching degree to obtain the download address of the corresponding drive file includes:
And combining the drive update address of the browser, the drive version number with the highest similarity with the browser version number and the drive file name corresponding to the target system information into a download address serving as a drive download address.
8. A test device, comprising:
the analysis module is used for responding to the error reporting information tested by the browser and analyzing the error reporting reason of the error reporting information;
the acquisition module is used for acquiring version information of the currently tested browser under the condition that the error reporting reason is analyzed to be unmatched with the browser driving version;
the matching module is used for acquiring a drive update address of the browser from a preset configuration file, acquiring different drive version information of the browser from a page corresponding to the drive update address, and matching the drive version information with the highest matching degree with the version information of the browser from the acquired drive version information;
the generation module is used for combining the drive update address of the browser and the drive file name corresponding to the drive version information with the highest matching degree to obtain a download address of the corresponding drive file;
And the updating module is used for downloading the driving file from the driving download address, updating the driving file for the browser by using the downloaded driving file, and re-executing the browser test after the updating of the driving file is completed.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores one or more computer programs executable by the at least one processor to enable the at least one processor to perform the test method of any one of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the test method according to any of claims 1-7.
CN202211694209.3A 2022-12-28 2022-12-28 Browser testing method, browser testing device, electronic equipment and computer readable storage medium Pending CN116149998A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211694209.3A CN116149998A (en) 2022-12-28 2022-12-28 Browser testing method, browser testing device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211694209.3A CN116149998A (en) 2022-12-28 2022-12-28 Browser testing method, browser testing device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116149998A true CN116149998A (en) 2023-05-23

Family

ID=86357505

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211694209.3A Pending CN116149998A (en) 2022-12-28 2022-12-28 Browser testing method, browser testing device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116149998A (en)

Similar Documents

Publication Publication Date Title
US10901876B2 (en) Providing cognitive intelligence across continuous delivery pipeline data
US20200257504A1 (en) Library Upgrade Method, Apparatus, and System
US9286191B2 (en) Logging code generation and distribution
US20200285567A1 (en) Employing code overlays to facilitate software development
US11157390B2 (en) Automatic software defect repair
CN105468529A (en) Accurate traversal method and apparatus for UI controls of android application
CN112527382B (en) Method for deploying pipeline engine system, and method and device for continuous integration
CN113014445B (en) Operation and maintenance method, device and platform for server and electronic equipment
CN115454869A (en) Interface automation test method, device, equipment and storage medium
CN104503772A (en) Operating system installation and test environment establishment method and device based on virtual machine
US10310961B1 (en) Cognitive dynamic script language builder
US11249880B1 (en) Debugging and simulating application runtime execution
CN116069341A (en) Automatic deployment method, equipment and storage medium for application program
CN115658496A (en) Extensible Web automatic test method, system, equipment and storage medium
CN112988578A (en) Automatic testing method and device
US9852048B2 (en) Simulating process variable changes during process runtime
CN116149998A (en) Browser testing method, browser testing device, electronic equipment and computer readable storage medium
CN111488275B (en) UI (user interface) automatic testing method and device, storage medium and electronic equipment
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
CN114546850A (en) Automatic testing method, system and device for embedded point and storage medium
CN114153462A (en) Client source code processing method and device, storage medium and electronic equipment
CN112631931A (en) Version testing method and device, storage medium and electronic equipment
Normann Test Case Selection Based on Code Changes
US11288041B1 (en) Efficient defect location in new code versions
CN117493159A (en) Application testing method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination