WO2022134582A1 - 浏览器页面测试方法、装置、计算机设备及存储介质 - Google Patents

浏览器页面测试方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2022134582A1
WO2022134582A1 PCT/CN2021/109447 CN2021109447W WO2022134582A1 WO 2022134582 A1 WO2022134582 A1 WO 2022134582A1 CN 2021109447 W CN2021109447 W CN 2021109447W WO 2022134582 A1 WO2022134582 A1 WO 2022134582A1
Authority
WO
WIPO (PCT)
Prior art keywords
input box
browser
box
browser page
filling data
Prior art date
Application number
PCT/CN2021/109447
Other languages
English (en)
French (fr)
Inventor
刘芳
Original Assignee
深圳壹账通智能科技有限公司
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 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2022134582A1 publication Critical patent/WO2022134582A1/zh

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/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45529Embedded in an application, e.g. JavaScript in a Web browser

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to a browser page testing method, device, computer equipment and storage medium.
  • the test of the text box generally includes the content test and length test of the input content, that is, input text content in different formats according to the application scenario of the text box to check whether the content format restriction of the front end is correct, or according to the length of the text box, the input is greater than Qualified text to check that the frontend's bounds are correct.
  • the testers need to manually input different text content and/or text lengths according to the page prompts. If the browser page includes a large number of text boxes, it is necessary to manually test each text box. It takes a long time, the labor cost is large, and the test efficiency is low.
  • the present application provides a browser page method, device, computer equipment and storage medium to solve the problem of low test efficiency caused by manual testing of the input box of the browser page in the prior art.
  • a browser page testing method comprising:
  • a message sending event is added in a browser extension program, and a listening event is added in the native program of the browser page, and the browser extension program is a pre-written browser for automated testing of the browser page extension;
  • the input box filling data is sent to the browser page through the message sending event, so that the browser page obtains the input box filling data through the listening event and obtains a test result.
  • a browser page testing device comprising:
  • the determination module is used to determine the browser page that needs to be tested for the input box
  • the adding module is used to add a message sending event in a browser extension program, and add a monitoring event in the native program of the browser page, the browser extension program is a pre-written program for performing the operation on the browser page.
  • Browser extension for automated testing;
  • a generation module is used to obtain the operation instruction of the user to the browser extension program, and generates input box filling data according to the operation instruction;
  • a sending module configured to send the input box filling data to the browser page through the message sending event, so that the browser page obtains the input box filling data through the listening event and obtains a test result.
  • a computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, the processor implementing the above-mentioned browser page test when executing the computer-readable instructions steps of the method.
  • a computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, implements the steps of the above browser page testing method.
  • the communication between the browser extension program and the browser page is realized through message sending events and monitoring events.
  • the preset extension program automatically generates input box filling data according to user operation instructions
  • the generated input box can be filled directly.
  • the data is sent to the browser page, so that the browser page can automatically fill the input box filling data into the input box of the browser page, which can automatically and quickly complete the input box test of the browser page, saving manual input of different filling data. time and improve the test efficiency.
  • FIG. 1 is a schematic diagram of an application environment of a browser page testing method in an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a browser page testing method in an embodiment of the present application
  • Fig. 3 is a schematic flow chart of an implementation of step S30 in Fig. 2;
  • Fig. 4 is a schematic flow chart of an implementation of step S34 in Fig. 3;
  • Fig. 5 is a schematic flow chart of an implementation of step S343 in Fig. 4;
  • FIG. 6 is another schematic flowchart of a browser page testing method in an embodiment of the present application.
  • Fig. 7 is a schematic flow chart of a realization of step S20 in Fig. 2;
  • Fig. 8 is another implementation flow schematic diagram of step S20 in Fig. 2;
  • FIG. 9 is a schematic structural diagram of a browser page testing device in an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a computer device in an embodiment of the present application.
  • the browser page testing method provided by the embodiment of the present application can be applied in the application environment shown in FIG. 1 , in which the terminal device communicates with the server through the network.
  • the terminal device determines the browser page that needs to be tested for the input box according to the operation of the tester (user), then adds the message sending event in the browser extension program, and adds the monitoring event in the native program of the browser page, the browser extension program It is a pre-written browser extension program for automated testing of browser pages, obtains the user's operation instructions for the browser extension program through the terminal device, and generates input box filling data according to the operation instructions, and sends the input box through message sending events.
  • the filling data is sent to the browser page, so that the browser page can obtain the input box filling data and obtain the test result by listening to the event, which can automatically and quickly complete the input box test of the browser page, saving the time of manually inputting different filling data , improve the test efficiency.
  • the browser extension program each browser page, message sending events and monitoring events and other related data are stored in the database of the server.
  • the browser extension program needs to be pre-installed. After determining the browser pages that require input box testing, obtain relevant data for browser page testing.
  • the database in this embodiment is stored in the blockchain network, and is used to store the data used and generated in the implementation of the browser page testing method, such as browser extensions, various browser pages, message sending events and monitoring events, etc. data.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer. Deploying the database on the blockchain can improve the security of data storage.
  • the terminal device can be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices.
  • the server can be implemented as an independent server or a server cluster composed of multiple servers.
  • a browser page testing method is provided, and the method is applied to the terminal device in FIG. 1 as an example for description, including the following steps:
  • test tool Before testing, it is necessary to determine the browser page that needs to be tested for the input box, so that the test tool can be used to test the input box on the browser page to be tested subsequently.
  • a message sending event is added to the browser extension program, and a listening event is added to the native program of the browser page.
  • the browser extension program is a pre-written browser extension program used for automated testing of the browser page.
  • the test tool provided in this embodiment is a browser extension program
  • the browser extension program is a browser extension program that is pre-written for automatic testing of browser pages.
  • the browser extension program is The program is installed in the terminal device.
  • you need to test the input box of the browser page you need to install the browser extension in advance.
  • S30 Acquire the user's operation instruction on the browser extension program, and generate input box filling data according to the operation instruction.
  • the browser extension program when the user clicks the entry of the browser extension program to enter the entry page of the browser extension program, the user can click the options or buttons set on the entry page according to the requirements, and the browser extension program obtains the corresponding operation according to the user's click operation instruction, if the user clicks the auto-fill button set on the entry page, the browser extension program obtains the filling data generation instruction according to the user's click operation on the auto-fill button. At this time, the browser extension program generates the instruction according to the filling data. Automatically generate input box fill data.
  • S40 Send the input box filling data to the browser page through the message sending event, so that the browser page obtains the input box filling data and obtains the test result by listening to the event.
  • the browser extension program After the browser extension program generates an instruction according to the filling data and automatically generates the input box filling data, the browser extension program will determine whether to receive the user's filling instruction.
  • the data and filling instructions are sent to the browser page, and the native program of the browser page obtains the input box filling data and filling instructions by listening to events, and then fills the input box filling data to the corresponding input box according to the filling instructions to obtain the filling of the input box.
  • the test result is obtained.
  • the input box filling data can be automatically generated through the browser extension program.
  • the native program of the browser page automatically obtains the input box filling data through the communication channel to realize the data filling. The tester does not need to manually test the input box and realizes the browser page test. artificial intelligence, thereby improving the test efficiency.
  • a message sending event is added to the browser extension program, and a monitoring event is added to the native program of the browser page, and the browser extension program is a pre-written application.
  • the browser extension program that automates the testing of the browser page, obtain the user's operation instruction on the browser extension program, and generate the input box filling data according to the operation instruction, and send the input box filling data to the browser page through the message sending event, In order to enable the browser page to obtain the input box filling data and obtain the test result by listening to the event; realize the communication between the browser extension program and the browser page through the message sending event and the listening event, and the preset extension program is automatically generated according to the user's operation instructions.
  • the generated input box filling data can be directly sent to the browser page, so that the browser page can automatically fill the input box filling data into the input box of the browser page, which can automatically and quickly complete the browsing process.
  • the input box test of the browser page saves the time of manually inputting different filling data and improves the test efficiency.
  • step S30 the input box filling data is generated according to the operation instruction, which specifically includes the following steps:
  • the user's operation instruction for the browser extension program After obtaining the user's operation instruction for the browser extension program, determine whether the user's operation instruction for the browser extension program includes a filling data generation instruction, so as to determine whether to perform input box filling data generation according to the determined situation, so as to avoid data waste caused by user misoperation .
  • the operation instruction includes the filling data generation instruction
  • the specific case of the input box control array generates different fill data.
  • S33 Poll each input box of the input box control array to determine the type of the input box, and the types of the input box include a text box, a check box, a radio button and a drop-down box.
  • the corresponding input box filling data is generated according to the type of the input box, and the input box filling data corresponding to the text box, check box, radio box, and drop-down box can be generated.
  • the document.getElementsByTagName(input) method of the HTML DOM Document object can be used to obtain all the input box (input) control arrays on the browser page, and then poll the control array in the control array. For each input box, the type of the input box is determined according to the type attribute of the input box.
  • the filling data of the text box is generated; if the type of the input box is a check box ( checkbox) or radio, it will be automatically checked according to the options provided by the input box and the page logic, and the automatically checked options will be used as filling data; if the type of the input box is a drop-down box, it can be checked according to the options of the drop-down box. An option value is automatically selected as the fill data for the drop-down box.
  • obtaining all the input box control arrays on the browser page through the document.getElementsByTagName(input) method of the HTML DOM Document object is only an exemplary illustration. In other embodiments, the browser can also be obtained in other ways. The input box control array of the page will not be repeated here.
  • the input box control array of the browser page is obtained, and each input box in the input box control array is polled to determine Types of input boxes.
  • the types of input boxes include text boxes, check boxes, radio boxes and drop-down boxes.
  • the corresponding input box filling data is generated according to the type of input box, and the method of generating input box filling data according to operation instructions is refined.
  • the specific steps are to generate filling data that meets the requirements of different types of input boxes according to the type of the input box, and then adjust the value of the filling content according to the needs of the test. In the case of test failure caused by the change of the input box of the browser page, the test can be performed even when the input box is added or deleted on the browser page, which meets the needs of different test scenarios.
  • step S34 the corresponding input box filling data is generated according to the type of the input box, which specifically includes the following steps:
  • S341 Determine whether the type of the input box is a text box.
  • the type of the input box After the type of the input box is determined, it is determined whether the type of the input box is a text box, so as to perform different operations according to the determination result.
  • S342 If the type of the input box is a text box, determine the generation method of filling data of the input box according to the settings of the text box.
  • the generation method of the input box filling data is determined according to the settings of the text box, so as to generate the input box filling data according to the generation method.
  • the generation method of the input box filling data can include Chinese, English, Cantonese, numbers, punctuation marks, special symbols, spaces, etc.
  • the filling data limit of the text box can be set according to past experience, that is, the limit of the text box is limited.
  • the filling data is one or more of Chinese, English, numbers, punctuation marks, special symbols, and spaces; when the type of the input box is a text box, the generation method of the text box is determined by reading the attribute information of the text box.
  • S343 Generate input box filling data according to the generation method of the input box filling data, where the input box filling data includes one or more of Chinese, English, numbers, punctuation marks, special symbols, and spaces.
  • the input box filling data After determining the generation method of the input box filling data according to the settings of the text box, generate the input box filling data according to the generation method of the input box filling data, wherein the input box filling data includes Chinese, English, numbers, punctuation marks, special symbols, spaces one or more of.
  • the input box filling data is generated in Chinese
  • the corresponding number of Chinese characters are randomly selected from the Chinese character strings preset by the browser extension to form the input box filling data.
  • the input box Fill data contains only Chinese.
  • the step of generating the corresponding input box filling data according to the type of the input box is refined, and when the type of the input box is a text box, the generation scene of the input box filling data is provided.
  • the method setting generates filling data of different contents, which can meet all the needs of the text box test, and the automatic test effect is better.
  • a configuration page may also be implemented in the browser extension program, and the configuration page is set with a method for generating content by the text box (including Chinese, English, Cantonese, numbers, punctuation, special symbols, spaces, etc.), After each generation method, the default character content is displayed, and each generation method has a check option, that is, one or more generation methods can be selected. Selecting a generation method will generate a separate character content according to the generation method.
  • a method for generating content by the text box including Chinese, English, Cantonese, numbers, punctuation, special symbols, spaces, etc.
  • the filling data of the text box for example, if Chinese is selected, the corresponding number of Chinese are randomly selected from the preset Chinese strings (the text may be repeated), then the generated filling content is all Chinese; for example, to generate special symbols, directly Get all the preset special symbols (%, ⁇ , #, @...&, *, (), ", '', ⁇ >, etc.) as the filling data of the text box; if multiple generation methods are selected, then According to the character content combined by multiple generation methods, as the filling data of the text box, for example, if English and special characters are selected, the filling content includes English and special characters; it can also be generated according to the checked spaces and other generation methods. Contains the filling content of the first and last spaces. In addition, the character content corresponding to each generation method can be modified according to the test needs. For example, the test only needs to test ⁇ >, and the content of special characters can be modified on the configuration page to ⁇ >.
  • the input box After determining whether the type of the input box is a text box, if the type of the input box is not a text box, the input box is ignored to determine whether the type of the next input box is a text box.
  • the method of generating the filling data of the input box is determined according to the setting of the text box, and the input box is generated according to the method of generating the filling data of the input box.
  • Box filling data the input box filling data includes one or more of Chinese, English, numbers, punctuation, special symbols, spaces, and the steps to generate the corresponding input box filling data according to the type of the input box are refined.
  • Testers Different generation methods can be configured according to the actual needs of the test to generate text box filling data that meets different scenarios, making the test more flexible.
  • the input box filling data is generated according to the generation method of the input box filling data, which specifically includes the following steps:
  • S3431 Determine whether the operation instruction includes a padding length instruction.
  • the operation instruction on the browser extension program After the user's operation instruction on the browser extension program includes the padding length instruction, if the operation instruction includes the padding length instruction, it is determined whether the padding content of the text box has a maximum length limit, so as to generate a text box with a preset length according to the maximum length limit padding data.
  • the generation method that generates the input box filling data according to the generation method set in the text box is generated.
  • the text box has a length limit, so as to generate input box filling data of different lengths.
  • the maximum length of the filling content is determined as a length reference value of the filling data of the input box.
  • S3434 Generate input box padding data of a preset length according to the generation method of the input box padding data, where the preset length is greater than the maximum length.
  • input box padding data of a preset length is generated according to the generation method of the input box padding data, wherein the preset length is greater than the maximum length.
  • the input box fill data is generated, first determine whether the text box has a maximum length (maxlength) attribute, if there is a maxlength attribute, get the value of maxlength, which is the maximum length of the text box filled content, and then Set the content length according to the value of maxlength + n, where n is greater than or equal to 1; if there is no maxlength attribute, the preset length can be set by the user, that is, the input box is filled with data according to the length filled in by the user.
  • maxlength maximum length
  • the filling content of the input box After determining whether the filling content of the input box has the maximum length limit, if the filling content of the text box does not have the maximum length limit, it means that the input box does not limit the length of the filling data of the input box, then according to the method of generating the filling data of the input box Generate input box padding data of random length.
  • the operation instruction includes a padding length command
  • the operation command includes a padding length command
  • the input box filling data of preset length is generated according to the generation method of the input box filling data. The preset length is greater than the maximum length. If the filling content of the text box does not have a maximum length limit, the input box filling data is generated according to the generation method. Generate input box padding data of random length, refine the steps of generating input box padding data according to the generation method of input box padding data, increase the length limit of input box padding data, and provide a basis for subsequent length verification of text boxes .
  • step S40 that is, after the input box filling data is sent to the browser page through a message sending event, the method further includes the following steps:
  • the input box of the browser page After sending the input box filling data to the browser page through the message sending event, if the input box of the browser page is a text box, after receiving the input box filling data sent by the browser extension through the message sending event, fill the input box with The data is filled into the text box of the browser page, and after filling, the filled content of the text box is obtained for subsequent text box length verification.
  • S52 Determine whether the length of the filling data of the input box is greater than the maximum length limited by the text box.
  • the length of the padding data and the length of the padding content in the input box needs to be determined to determine whether the length limit of the text box is normal.
  • the test result is that the length verification of the text box fails.
  • a length verification error prompt is sent to the user to prompt the user to check; if the length of the filled data in the input box is greater than the maximum length of the text box, and The length of the filling content is not greater than the maximum length limited by the text box, which means that when filling the input box with the filling data to the text box, the text box has automatically truncated the input box filling data to meet the length limit requirements.
  • the test result is the text box length calibration. If the verification is passed, a prompt of the length verification passing is sent to the user.
  • the type of the input box is text
  • the maxlength property of the input box is 100
  • the generation method of the input box is Chinese
  • 101 Chinese characters can be generated as input box filling data
  • the user clicks the start filling button on the entry page of the browser extension the 101 Chinese characters are sent to the browser page, so that the native program of the browser page fills the 101 Chinese characters into the corresponding text box, after the filling is completed, obtain the filling content of the text box, and determine whether the value of the filling content is 100. If the value is 100, add an OK icon; if the value is 101, add a needcheck icon, Then proceed to the test of the next input box. If the text box in the browser page has multiple need check marks, it means that there is a problem with the browser settings. You can click the save button to save the test progress, and then further check the front-end for the length of the text box to determine whether there is a problem.
  • the length of the padding data in the input box After determining whether the length of the padding data in the input box is greater than the maximum length limited by the text box, if the length of the padding data in the input box is not greater than the maximum length defined by the text box, it means that the length of the padding data in the input box at this time does not satisfy the length check. It is required to obtain new input box filling data, fill the text box, and perform the above-mentioned text box length verification process.
  • the filling data of the text box is obtained.
  • content determine whether the length of the filled content is greater than the maximum length limited by the text box, if the length of the filled content is greater than the maximum length limited by the text box, and the length of the filled data in the input box is greater than the maximum length limited by the text box, send a length correction to the user.
  • the text box length verification is added. After the input box fill data is sent to the browser page through the message sending event, the detailed steps of the text box length verification are clarified, and the tester can judge according to the length verification error prompt. Whether further verification is required to save the filling time and verification time of manually limiting the text content to be filled one by one according to the length of the text box.
  • step S20 a message sending event is added in the browser extension program, and a monitoring event is added in the native program of the browser page, which specifically includes the following steps:
  • the Content.js file is a pre-written configuration file for establishing a channel with the browser page's native program. Add the message sending event chrome.tabs.sendMessage() to the js script corresponding to the entry page of the browser extension, then obtain the Content.js file, and add chrome.runtime.onMessage.addListener() to the Content.js file,
  • the implementation method is chrome.tabs.executeScript( ⁇ file:"content .js" ⁇ )
  • the message sending event sends the filling instruction and the input box fills the data
  • the content.js in the browser page will listen to the sending of the filling instruction and input Fill the box with data, and then fill the input box with the corresponding input box according to the filling instruction.
  • the message sending event is added to the js script of the browser extension program
  • the listening event is added to the Content.js file
  • the Content.js file is embedded in the native program js script file, which refines the specific process of adding message sending events in browser extensions and adding monitoring events to the native program of the browser page, which is the communication between the browser extension program and the native program of the browser page. Build provides the foundation.
  • step S23 that is, before the Content.js file is embedded in the js script file of the native program, the method further includes the following steps:
  • S02 Determine whether the URL address of the browser page is a preset address.
  • the content.js file Before embedding the Content.js file into the js script file of the native program, it is necessary to obtain the URL address of the browser page to determine whether the URL address of the browser page is the default address. If the URL address of the browser page is not the default address, Indicates that the current browser page is not the page that needs to be tested. At this time, it is not necessary to embed the Content.js file into the js script file of the native program; if the URL address of the browser page is the default address, it indicates that the current browser page needs to be tested.
  • the content.js file can be embedded in the js script file of the native program to avoid misoperation of the browser extension program when the user does not need to test, resulting in error data filling.
  • the URL address of the browser page is obtained, and then it is determined whether the URL address of the browser page is a preset address, if the URL address of the browser page is If the default address is set, the Content.js file will be embedded in the js script file of the native program. If the URL address of the browser page is not the default address, the Content.js file will not be embedded in the js script file of the native program.
  • the extension program In order not to affect other pages, the extension program also restricts the content.js script to be embedded in the current page only if it is the agreed url address, otherwise it will not be embedded, so even if the user triggers the filling operation, it will not be filled. will lead to misoperation.
  • a browser page testing device is provided, and the browser page testing device corresponds to the browser page testing method in the above-mentioned embodiment one-to-one.
  • the browser page testing apparatus includes a determining module 901 , an adding module 902 , a generating module 903 and a sending module 904 .
  • the detailed description of each functional module is as follows:
  • a determination module 901 configured to determine a browser page that needs to be tested for an input box
  • the adding module 902 is configured to add a message sending event in a browser extension program, and add a monitoring event in the native program of the browser page, the browser extension program is a pre-written program for sending messages to the browser page Browser extensions for automated testing;
  • a generating module 903 configured to obtain the user's operation instruction on the browser extension program, and generate input box filling data according to the operation instruction;
  • a sending module 904 configured to send the input box filling data to the browser page through the message sending event, so that the browser page obtains the input box filling data through the listening event and obtains a test result .
  • the generating module 903 is specifically used for:
  • the type of the input box includes a text box, a check box, a radio button and a drop-down box;
  • the corresponding input box filling data is generated according to the type of the input box.
  • the generating module 903 is specifically also used for:
  • the input box filling data is generated according to the generation method of the input box filling data, and the input box filling data includes one or more of Chinese, English, numbers, punctuation marks, special symbols, and spaces.
  • the generating module 903 is specifically also used for:
  • the operation instruction includes the padding length command, determining whether the padding content of the text box has a maximum length limit
  • the input box padding data of a preset length is generated according to the generation method of the input box padding data, and the preset length is greater than the maximum length.
  • the sending module 904 is further configured to:
  • the input box of the browser page is a text box
  • after filling the input box filling data into the text box obtain the filling content of the text box
  • a length verification error prompt is sent to the user.
  • adding module 902 is specifically used for:
  • the Content.js file is embedded in the js script file of the native program.
  • the adding module 902 is specifically also used for:
  • the Content.js file is embedded in the js script file of the native program.
  • Each module in the above browser page testing device may be implemented in whole or in part by software, hardware and combinations thereof.
  • the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • a computer device is provided, and the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 10 .
  • the computer equipment includes a processor, memory, a network interface, a display screen, and an input device connected by a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the non-volatile storage medium stores an operating system and computer-readable instructions.
  • the internal memory provides an environment for the execution of the operating system and computer-readable instructions in the non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external server over a network connection.
  • the computer-readable instructions when executed by a processor, implement a browser page testing method.
  • a computer device comprising a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor, and the processor implements the following steps when executing the computer-readable instructions:
  • a message sending event is added in a browser extension program, and a listening event is added in the native program of the browser page, and the browser extension program is a pre-written browser for automated testing of the browser page extension;
  • the input box filling data is sent to the browser page through the message sending event, so that the browser page obtains the input box filling data through the listening event and obtains a test result.
  • a computer-readable storage medium on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
  • a message sending event is added in a browser extension program, and a listening event is added in the native program of the browser page, and the browser extension program is a pre-written browser for automated testing of the browser page extension;
  • the input box filling data is sent to the browser page through the message sending event, so that the browser page obtains the input box filling data through the listening event and obtains a test result.
  • Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种浏览器页面测试方法、装置、计算机设备及存储介质,其中,方法部分包括:确定需要进行输入框测试的浏览器页面(S10);在浏览器扩展程序中添加消息发送事件,并在浏览器页面的原生程序中添加监听事件(S20);获取用户对浏览器扩展程序的操作指令,并根据操作指令生成输入框填充数据(S30);通过消息发送事件将输入框填充数据发送至浏览器页面,以使浏览器页面通过监听事件获取输入框填充数据并获得测试结果(S40)。该方法自动生成输入框填充数据,并将输入框填充数据自动填充至浏览器页面的输入框,能自动、快速地完成对浏览器页面的输入框测试,节省了人工输入不同填充数据的时间,提高了测试效率。

Description

浏览器页面测试方法、装置、计算机设备及存储介质
本申请要求于2020年12月21日提交中国专利局、申请号为202011519483.8,发明名称“浏览器页面测试方法、装置、设备及介质”的中国发明专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种浏览器页面测试方法、装置、计算机设备及存储介质。
背景技术
随着网络技术的迅速发展,尤其是浏览器及其应用程序的普及,各类基于浏览器的应用程序以方便、快速、易操作等特点不断成为软件开发的重点。由于浏览器应用与用户直接相关,又通常需要承受长时间的大量操作,因此浏览器项目的功能和性能都必须经过可靠的验证。由此,通过对浏览器页面进行测试,及时地发现应用错误并及时加以修正,以保证应用的质量。
技术问题
发明人发现,在对浏览器页面进行测试的过程中,常常需要对浏览器页面中的输入框进行测试,现有的输入框测试一般为人工测试。例如,文本框的测试一般包括输入内容的内容测试和长度测试,即根据文本框的应用场景输入不同格式的文本内容,以检查前端的内容格式限制是否正确,或者根据文本框的长度限定输入大于限定的文本来检查前端的限制是否正确。而上述两种类型的测试,都需要由测试人员根据页面提示手动输入不同的文本内容和/或文本长度,若浏览器页面中包括大量的文本框,对每个文本框都进行人工手动测试耗时较久,人工成本较大,测试效率低。
技术解决方案
本申请提供一种浏览器页面方法、装置、计算机设备及存储介质,以解决现有技术中,对浏览器页面的输入框进行人工测试导致测试效率低的问题。
一种浏览器页面测试方法,包括:
确定需要进行输入框测试的浏览器页面;
在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,所述浏览器扩展程序为预先编写的用于对所述浏览器页面进行自动化测试的浏览器扩展程序;
获取用户对所述浏览器扩展程序的操作指令,并根据所述操作指令生成输入框填充数据;
通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面,以使所述浏览器页面通过所述监听事件获取所述输入框填充数据并获得测试结果。
一种浏览器页面测试装置,包括:
确定模块,用于确定需要进行输入框测试的浏览器页面;
添加模块,用于在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,所述浏览器扩展程序为预先编写的用于对所述浏览器页面进行自动化测试的浏览器扩展程序;
生成模块,用于获取用户对所述浏览器扩展程序的操作指令,并根据所述操作指令生 成输入框填充数据;
发送模块,用于通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面,以使所述浏览器页面通过所述监听事件获取所述输入框填充数据并获得测试结果。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述浏览器页面测试方法的步骤。
一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述浏览器页面测试方法的步骤。
有益效果
本申请中,通过消息发送事件和监听事件实现浏览器扩展程序与浏览器页面之间的通信,在预设扩展程序根据用户操作指令自动生成输入框填充数据之后,可直接将生成的输入框填充数据发送至浏览器页面,即可使浏览器页面将输入框填充数据自动填充至浏览器页面的输入框,能够自动、快速地完成对浏览器页面的输入框测试,节省了人工输入不同填充数据的时间,提高了测试效率。
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例中浏览器页面测试方法的一应用环境示意图;
图2是本申请一实施例中浏览器页面测试方法的一流程示意图;
图3是图2中步骤S30的一实现流程示意图;
图4是图3中步骤S34的一实现流程示意图;
图5是图4中步骤S343的一实现流程示意图;
图6是本申请一实施例中浏览器页面测试方法的另一流程示意图;
图7是图2中步骤S20的一实现流程示意图;
图8是图2中步骤S20的另一实现流程示意图;
图9是本申请一实施例中浏览器页面测试装置的一结构示意图;
图10是本申请一实施例中计算机设备的一结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请实施例提供的浏览器页面测试方法,可应用在如图1所示的应用环境中,其中,终端设备通过网络与服务器进行通信。终端设备根据测试人员(用户)的操作确定需要进行输入框测试的浏览器页面,然后在浏览器扩展程序中添加消息发送事件,并在浏览器页面的原生程序中添加监听事件,浏览器扩展程序为预先编写的用于对浏览器页面进行自动化测试的浏览器扩展程序,获取用户通过终端设备对浏览器扩展程序的操作指令,并根据操作指令生成输入框填充数据,通过消息发送事件将输入框填充数据发送至浏览器页面, 以使浏览器页面通过监听事件获取输入框填充数据并获得测试结果,能够自动、快速地完成对浏览器页面的输入框测试,节省了人工输入不同填充数据的时间,提高了测试效率。
其中,浏览器扩展程序、各浏览器页面、消息发送事件和监听事件等相关数据存储在服务器的数据库中,在需要对浏览器页面进行输入框测试时,需要预先安装好浏览器扩展程序,在确定需要进行输入框测试的浏览器页面之后,获取相关数据以进行浏览器页面测试。
本实施例中的数据库存储于区块链网络中,用于存储实现浏览器页面测试方法中用到、生成的数据,如浏览器扩展程序、各浏览器页面、消息发送事件和监听事件等相关数据。本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。将数据库部署于区块链可提高数据存储的安全性。
其中,终端设备可以但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在一实施例中,如图2所示,提供一种浏览器页面测试方法,以该方法应用在图1中的终端设备为例进行说明,包括如下步骤:
S10:确定需要进行输入框测试的浏览器页面。
在进行测试之前,需要确定需要进行输入框测试的浏览器页面,以便后续采用测试工具对需要测试的浏览器页面上的输入框测试进行测试。
S20:在浏览器扩展程序中添加消息发送事件,并在浏览器页面的原生程序中添加监听事件,浏览器扩展程序为预先编写的用于对浏览器页面进行自动化测试的浏览器扩展程序。
本实施例提供的测试工具为一种浏览器扩展程序,浏览器扩展程序为预先编写的用于对浏览器页面进行自动化测试的浏览器扩展程序,在编写浏览器扩展程序之后,将浏览器扩展程序安装在终端设备中。在需要对浏览器页面进行输入框测试时,需要预先安装好浏览器扩展程序,在确定需要进行输入框测试的浏览器页面之后,在当前浏览器页面的浏览器栏或鼠标右键都可以看到浏览器扩展程序入口,以便使用浏览器扩展程序进行浏览器页面测试。
在确定需要进行输入框测试的浏览器页面之后,在浏览器扩展程序中添加消息发送事件,并在浏览器页面的原生程序中添加监听事件,以在浏览器页面的原生程序与浏览器扩展程序之间建立通信通道。
S30:获取用户对浏览器扩展程序的操作指令,并根据操作指令生成输入框填充数据。
在浏览器扩展程序中添加消息发送事件,并在浏览器页面的原生程序中添加监听事件之后,获取用户对浏览器扩展程序的操作指令,以便浏览器扩展程序根据用户的操作指令生成输入框填充数据。
例如,在用户点击浏览器扩展程序的入口进入浏览器扩展程序的入口页面时,用户可以根据需求在入口页面上设置的选项或按钮进行点击,浏览器扩展程序根据用户的点击操作获得对应的操作指令,若用户点击的是设置在入口页面上的自动填充按钮,则浏览器扩展程序根据用户对自动填充按钮的点击操作,获得填充数据生成指令,此时,浏览器扩展程序根据填充数据生成指令自动生成输入框填充数据。
S40:通过消息发送事件将输入框填充数据发送至浏览器页面,以使浏览器页面通过监听事件获取输入框填充数据并获得测试结果。
在浏览器扩展程序根据填充数据生成指令,自动生成输入框填充数据之后,浏览器扩 展程序会确定是否接收到用户的填充指令,若接收到用户的填充指令,则通过消息发送事件将输入框填充数据和填充指令发送至浏览器页面,浏览器页面的原生程序通过监听事件获取输入框填充数据和填充指令之后,根据填充指令将输入框填充数据填充至对应的输入框上,获得输入框的填充结果,即获得测试结果。通过浏览器扩展程序即可实现输入框填充数据自动生成,浏览器页面的原生程序通过通信通道自动获取输入框填充数据以实现数据填充,无需测试人员进行输入框手动测试,实现了浏览器页面测试的人工智能化,进而提高了测试效率。
本实施例中,通过确定需要进行输入框测试的浏览器页面,在浏览器扩展程序中添加消息发送事件,并在浏览器页面的原生程序中添加监听事件,浏览器扩展程序为预先编写的用于对浏览器页面进行自动化测试的浏览器扩展程序,获取用户对浏览器扩展程序的操作指令,并根据操作指令生成输入框填充数据,通过消息发送事件将输入框填充数据发送至浏览器页面,以使浏览器页面通过监听事件获取输入框填充数据并获得测试结果;通过消息发送事件和监听事件实现浏览器扩展程序与浏览器页面之间的通信,在预设扩展程序根据用户操作指令自动生成输入框填充数据之后,可直接将生成的输入框填充数据发送至浏览器页面,即可使浏览器页面将输入框填充数据自动填充至浏览器页面的输入框,能够自动、快速地完成对浏览器页面的输入框测试,节省了人工输入不同填充数据的时间,提高了测试效率。
在一实施例中,如图3所示,步骤S30中,即根据操作指令生成输入框填充数据,具体包括如下步骤:
S31:确定操作指令是否包括填充数据生成指令。
在获取用户对浏览器扩展程序的操作指令后,确定用户对浏览器扩展程序的操作指令是否包含填充数据生成指令,以根据确定情况判断是否进行输入框填充数据生成,避免用户误操作导致数据浪费。
S32:若操作指令包括填充数据生成指令,则获取浏览器页面的输入框控件数组。
在确定操作指令是否包含填充数据生成指令之后,若确定操作指令包括填充数据生成指令,表示此时需要对浏览器页面的输入框进行测试,则需要获取浏览器页面的输入框控件数组,以根据输入框控件数组的具体情况生成不同的填充数据。
S33:轮询输入框控件数组的每一输入框,以确定输入框的类型,输入框的类型包括文本框、复选框、单选框和下拉框。
在获取浏览器页面的输入框控件数组之后,轮询输入框控件数组中每一输入框的属性,以确定每一输入框的类型,其中,输入框的类型包括文本框、复选框、单选框和下拉框。
S34:根据输入框的类型的生成对应的输入框填充数据。
在确定每一输入框的类型之后,根据输入框的类型的生成对应的输入框填充数据,即可生成文本框、复选框、单选框、下拉框对应的输入框填充数据。
例如,在确定操作指令包括填充数据生成指令之后,可通过HTML DOM Document对象的document.getElementsByTagName(input)方法,获取浏览器页面上所有的输入框(input)控件数组,然后轮询控件数组中的每个输入框,根据输入框的类型(type)属性判断输入框的类型,若输入框的类型为文本框(text),则生成文本框的填充数据;若输入框的类型为复选框(checkbox)或者单选框(radio),则根据输入框提供的选项和页面逻辑进行自动勾选,将自动勾选的选项作为填充数据;若输入框的类型为下拉框,可以根据下拉框的选项自动选择一个选项值,作为下拉框的填充数据。
本实施例中,通过HTML DOM Document对象的document.getElementsByTagName(input)方法,获取浏览器页面上所有的输入框控件数组仅为示例性说明,在其他实施例中,还可以通过其他方式获取浏览器页面的输入框控件数组,在此不再赘述。
本实施例中,通过确定操作指令是否包括填充数据生成指令,若操作指令包括填充数 据生成指令,则获取浏览器页面的输入框控件数组,轮询输入框控件数组的每一输入框,以确定输入框的类型,输入框的类型包括文本框、复选框、单选框和下拉框,根据输入框的类型的生成对应的输入框填充数据,细化了根据操作指令生成输入框填充数据的具体步骤,根据输入框的类型生成符合不同类型输入框要求的填充数据,即可根据测试的需要调整填充内容的值,同时对浏览器页面上的所有输入框进行测试,减少了因传统测试方法中因浏览器页面输入框变化导致的测试失败的情况,即便在浏览器页面进行输入框添加或者删除的情况下也可以进行测试,满足了不同测试场景的需求。
在一实施例中,如图4所示,步骤S34中,即根据输入框的类型的生成对应的输入框填充数据,具体包括如下步骤:
S341:确定输入框的类型是否为文本框。
在确定输入框的类型之后,确定输入框的类型是否为文本框,以根据确定结果执行不同的操作。
S342:若输入框的类型为文本框,则根据文本框的设置确定输入框填充数据的生成方式。
在确定输入框的类型是否为文本框之后,若输入框的类型为文本框,则根据文本框的设置确定输入框填充数据的生成方式,以根据生成方式生成输入框填充数据。
例如,输入框填充数据的生成方式可以包括中文、英文、粤语、数字、标点符号、特殊符号、空格等,在生成文本框时可根据以往经验设置文本框的填充数据限制,即限制文本框的填充数据为中文、英文、数字、标点符号、特殊符号、空格中的一个或者多个;当输入框的类型为文本框时,通过读取文本框的属性信息确定文本框的生成方式。
S343:根据输入框填充数据的生成方式生成输入框填充数据,输入框填充数据包括中文、英文、数字、标点符号、特殊符号、空格中的一个或多个。
在根据文本框的设置确定输入框填充数据的生成方式之后,根据输入框填充数据的生成方式生成输入框填充数据,其中,输入框填充数据包括中文、英文、数字、标点符号、特殊符号、空格中的一个或多个。
例如,若输入框填充数据的生成方式为中文,则在浏览器扩展程序预置好的中文字符串中随机抽取对应数量的中文(文字可能重复),组成输入框填充数据,此时的输入框填充数据仅包含中文。
本实施中,细化了根据输入框的类型的生成对应的输入框填充数据的步骤,提供了当输入框的类型为文本框时,输入框填充数据的生成场景,根据不同的文本框的生成方式设置生成不同内容的填充数据,能满足文本框测试的所有内容需要,自动化测试效果更佳。
在其他实施例中,还可以在浏览器扩展程序中实现一个配置页面,配置页面上设置有文本框生成内容的方式(包括中文、英文、粤语、数字、标点符号、特殊符号、空格等),每种生成方式的后面有显示默认的字符内容,每个生成方式均设有勾选选项,即可以选择一个或多个生成方式,选择一个生成方式则根据生成该生成方式的单独的字符内容,作为文本框的填充数据,比如选择了中文,则在预置好的中文字符串中随机抽取对应数量的中文(文字可能重复),那么生成的填充内容全部是中文;比如要生成特殊符号,直接获取预置的所有特殊符号(%、¥、#、@……&、*、()、“、‘’、<>等),作为文本框的填充数据;若选择了多个生成方式,则根据生成多个生成方式组合的字符内容,作为文本框的填充数据,比如选择了英文和特殊字符,那么填充内容就包含了英文和特殊字符;还可以根据勾选的空格和其他生成方式,生成包含首尾空格的填充内容。此外,还可根据测试需要修改每个生成方式对应的字符内容,如测试只需要测试<>,可以在配置页面修改特殊字符的内容为<>。
S434:若输入框的类型不为文本框,则忽略输入框。
在确定输入框的类型是否为文本框之后,若输入框的类型不为文本框,则忽略该输入 框,以确定下一输入框的类型是否为文本框。
本实施例中,通过确定输入框的类型是否为文本框,若输入框的类型为文本框,则根据文本框的设置确定输入框填充数据的生成方式,根据输入框填充数据的生成方式生成输入框填充数据,输入框填充数据包括中文、英文、数字、标点符号、特殊符号、空格中的一个或多个,细化了根据输入框的类型的生成对应的输入框填充数据的步骤,测试人员可根据测试的实际需要配置不同的生成方式,以生成符合不同场景的文本框填充数据,使得测试更加灵活。
在一实施例中,如图5所示,步骤S343中,即根据输入框填充数据的生成方式生成输入框填充数据,具体包括如下步骤:
S3431:确定操作指令是否包括填充长度指令。
在确定输入框填充数据的生成方式之后,还需要确定用户对浏览器扩展程序的操作指令是否包括填充长度指令,以变后续确定是否需要限制输入框填充数据的长度
S3432:若操作指令包括填充长度指令,则确定文本框的填充内容是否具有最大长度限制。
在用户对浏览器扩展程序的操作指令是否包括填充长度指令之后,若操作指令包括填充长度指令,则确定文本框的填充内容是否具有最大长度限制,以根据最大长度限制生成预设长度的文本框的填充数据。
例如,若用户在浏览器扩展程序的入口页面点击了填写长度按钮,则确定用户对浏览器扩展程序的操作指令包括填充长度指令,则在生成根据文本框设置的生成方式生成输入框填充数据的过程中,需要确定文本框是否具有长度限制,以生成不同长度的输入框填充数据。
S3433:若文本框的填充内容具有最大长度限制,则确定填充内容的最大长度。
在确定输入框的填充内容是否具有最大长度限制之后,若文本框的填充内容具有最大长度限制,则确定填充内容的最大长度,以作为输入框填充数据的长度参照值。
S3434:根据输入框填充数据的生成方式生成预设长度的输入框填充数据,预设长度大于最大长度。
在确定填充内容的最大长度之后,根据输入框填充数据的生成方式生成预设长度的输入框填充数据,其中,预设长度大于最大长度。
即在输入框填充数据的生成方式之后,先判断该文本框是否有最大长度(maxlength)属性,如果有maxlength属性,则获取maxlength的值,该值即为该文本框填充内容的最大长度,然后按照maxlength的值+n的规则设置内容长度,其中,n大于或者等于1;如果没有maxlength属性,预设长度可以由用户设置,即则以按照用户填写的长度生成输入框填充数据。
S3435:若文本框的填充内容不具有最大长度限制,根据输入框填充数据的生成方式生成随机长度的输入框填充数据。
在确定输入框的填充内容是否具有最大长度限制之后,若文本框的填充内容不具有最大长度限制,表示该输入框未对输入框填充数据的长度进行限制,则根据输入框填充数据的生成方式生成随机长度的输入框填充数据。
本实施例中,通过确定操作指令是否包括填充长度指令,若操作指令包括填充长度指令,则确定文本框的填充内容是否具有最大长度限制,若文本框的填充内容具有最大长度限制,则确定填充内容的最大长度,根据输入框填充数据的生成方式生成预设长度的输入框填充数据,预设长度大于最大长度,若文本框的填充内容不具有最大长度限制,根据输入框填充数据的生成方式生成随机长度的输入框填充数据,细化了根据输入框填充数据的生成方式生成输入框填充数据的步骤,增加了输入框填充数据的长度限制,为后续进行文本框的长度校验提供了基础。
在一实施例中,如图6所示,步骤S40之后,即通过消息发送事件将输入框填充数据发送至浏览器页面之后,所述方法具体还包括如下步骤:
S51:若浏览器页面的输入框为文本框,则将输入框填充数据填充至文本框后,获取文本框的填充内容。
通过消息发送事件将输入框填充数据发送至浏览器页面之后,若浏览器页面的输入框为文本框,则在通过消息发送事件接收浏览器扩展程序发送的输入框填充数据后,将输入框填充数据填充至浏览器页面的文本框,并在填充后,获取文本框的填充内容,以便后续进行文本框长度校验。
S52:确定输入框填充数据的长度是否大于文本框限定的最大长度。
在获取文本框的填充内容之后需要对输入框填充数据的长度和填充内容的长度,以确定文本框的长度限制是否正常。
S53:若输入框填充数据的长度大于文本框限定的最大长度,则确定填充内容的长度是否大于文本框限定的最大长度。
在确定输入框填充数据的长度大于文本框限定的最大长度之后,确定文本框填充内容的长度是否大于文本框限定的最大长度。
S54:若填充内容的长度大于文本框限定的最大长度,则向用户发送长度校验错误提示。
S55:若填充内容的长度大于文本框限定的最大长度,则向用户发送长度校验通过提示。
在确定文本框填充内容的长度是否大于文本框限定的最大长度之后,若填充内容的长度大于文本框限定的最大长度,且输入框填充数据的长度大于文本框限定的最大长度,表示文本框的长度限制出现问题,测试结果为文本框长度校验未通过,此时则向用户发送长度校验错误提示,以提示用户进行检查;若输入框填充数据的长度大于文本框限定的最大长度,而填充内容的长度不大于文本框限定的最大长度,表示在填充输入框填充数据至文本框时,文本框已自动将输入框填充数据截断以符合长度限制要求,此时测试结果为文本框长度校验通过,向用户发送长度校验通过的提示。
例如,在轮询input控件数组的每一输入框控件之后,发现输入框的type为text,输入框的maxlength属性为100,输入框的生成方式为中文,则可生成101个中文字符,作为输入框填充数据,在用户点击浏览器扩展程序入口页面上的开始填充按钮后,将该101个中文字符发送至浏览器页面,以使浏览器页面的原生程序将101个中文字符填充至对应的文本框中,在填充完成后,获取该文本框的填充内容,判断填充内容的value值是否为100,若value值为100,则增加一个OK icon;若value值为101,则增加一个needcheck icon,然后再进行下一个输入框的测试。若浏览器页面中的文本框有多个need check标识,则说明浏览器设置存在问题,可以点击保存按钮保存测试进度,然后进一步查看前端关于文本框的长度判断提示是否存在问题。
S56:若输入框填充数据的长度不大于文本框限定的最大长度,则获取新的输入框填充数据,以进行文本框长度校验。
在确定输入框填充数据的长度是否大于文本框限定的最大长度之后,若输入框填充数据的长度不大于文本框限定的最大长度,表示此时的输入框填充数据的长度不满足长度校验的要求,需要获取新的输入框填充数据,并进行文本框填充,并进行上述的文本框长度校验过程。
本实施例中,在通过消息发送事件将输入框填充数据发送至浏览器页面之后,若浏览器页面的输入框为文本框,则将输入框填充数据填充至文本框后,获取文本框的填充内容,确定填充内容的长度是否大于文本框限定的最大长度,若填充内容的长度大于文本框限定的最大长度,且输入框填充数据的长度大于文本框限定的最大长度,则向用户发送长度校 验错误提示,增加了文本框长度校验,在通过消息发送事件将输入框填充数据发送至浏览器页面之后,明确了文本框长度校验的详细步骤,测试人员可以根据长度校验错误提示判断是否需要进一步验证,节省人工按照文本框长度限制一个个填充文本内容的填充时间和验证时间。
在一实施例中,如图7所示,步骤S20中,即在浏览器扩展程序中添加消息发送事件,并在浏览器页面的原生程序中添加监听事件,具体包括如下步骤:
S21:在浏览器扩展程序的js脚本中添加消息发送事件。
S22:获取Content.js文件,并在Content.js文件中添加监听事件。
S23:在用户点击浏览器扩展程序的入口时,将Content.js文件嵌入原生程序的js脚本文件。
例如,Content.js文件为预先编写好的用于与浏览器页面的原生程序建立通道的配置文件。在浏览器扩展程序入口页面对应的js脚本中添加了消息发送事件chrome.tabs.sendMessage(),然后获取Content.js文件,并在Content.js文件中添加chrome.runtime.onMessage.addListener(),以添加监听事件,当用户点击浏览器扩展程序的入口时,Content.js文件将会自动嵌入到当前浏览器页面的原生程序js脚本中,实现方式为chrome.tabs.executeScript({file:"content.js"}),当用户触发浏览器扩展程序上的开始填充按钮后,消息发送事件发送填充指令和输入框填充数据,那么浏览器页面中的content.js就会监听到发送填充指令和输入框填充数据,然后根据填充指令将输入框填充数据填充至对应的输入框。
本实施例中,通过在浏览器扩展程序的js脚本中添加消息发送事件,在Content.js文件中添加监听事件,最后在用户点击浏览器扩展程序的入口时,将Content.js文件嵌入原生程序的js脚本文件,细化了在浏览器扩展程序中添加消息发送事件,并在浏览器页面的原生程序中添加监听事件的具体过程,为浏览器扩展程序与浏览器页面原生程序之间的通信建立提供了基础。
在一实施例中,如图8所示,步骤S23之前,即将Content.js文件嵌入原生程序的js脚本文件之前,所述方法具体还包括如下步骤:
S01:获取浏览器页面的URL地址。
S02:确定浏览器页面的URL地址是否为预设地址。
S03:若浏览器页面的URL地址为预设地址,则将Content.js文件嵌入原生程序的js脚本文件。
S03:若浏览器页面的URL地址不为预设地址,则不将Content.js文件嵌入原生程序的js脚本文件。
在将Content.js文件嵌入原生程序的js脚本文件之前,需要获取浏览器页面的URL地址,确定浏览器页面的URL地址是否为预设地址,若浏览器页面的URL地址不为预设地址,表示当前浏览器页面不是需要进行测试的页面,此时不需要将Content.js文件嵌入原生程序的js脚本文件;若浏览器页面的URL地址为预设地址,表示当前浏览器页面是需要进行测试的页面,才能将Content.js文件嵌入原生程序的js脚本文件,以避免用户在不需要测试时对浏览器扩展程序进行误操作,所导致的误差数据填充。
本实施例中,在将Content.js文件嵌入原生程序的js脚本文件之前,获取浏览器页面的URL地址,然后确定浏览器页面的URL地址是否为预设地址,若浏览器页面的URL地址为预设地址,则将Content.js文件嵌入原生程序的js脚本文件,若浏览器页面的URL地址不为预设地址,则不将Content.js文件嵌入原生程序的js脚本文件,增加了嵌入前的判断操作,为了不影响其他页面,在扩展程序里也限定了当前页面只有是约定的url地址才会嵌入content.js脚本,否则不嵌入,这样就算用户触发填充操作也不会进行填充,不会导致误操作。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
在一实施例中,提供一种浏览器页面测试装置,浏览器页面测试装置与上述实施例中浏览器页面测试方法一一对应。如图9所示,该浏览器页面测试装置包括确定模块901、添加模块902、生成模块903和发送模块904。各功能模块详细说明如下:
确定模块901,用于确定需要进行输入框测试的浏览器页面;
添加模块902,用于在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,所述浏览器扩展程序为预先编写的用于对所述浏览器页面进行自动化测试的浏览器扩展程序;
生成模块903,用于获取用户对所述浏览器扩展程序的操作指令,并根据所述操作指令生成输入框填充数据;
发送模块904,用于通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面,以使所述浏览器页面通过所述监听事件获取所述输入框填充数据并获得测试结果。
进一步地,所述生成模块903具体用于:
确定所述操作指令是否包括填充数据生成指令;
若所述操作指令包括所述填充数据生成指令,则获取所述浏览器页面的输入框控件数组;
轮询所述输入框控件数组的每一所述输入框,以确定所述输入框的类型,所述输入框的类型包括文本框、复选框、单选框和下拉框;
根据所述输入框的类型的生成对应的输入框填充数据。
进一步地,所述生成模块903具体还用于:
确定所述输入框的类型是否为所述文本框;
若所述输入框的类型为所述文本框,则根据所述文本框的设置确定所述输入框填充数据的生成方式;
根据所述输入框填充数据的生成方式生成所述输入框填充数据,所述输入框填充数据包括中文、英文、数字、标点符号、特殊符号、空格中的一个或多个。
进一步地,所述生成模块903具体还用于:
确定所述操作指令是否包括填充长度指令;
若所述操作指令包括所述填充长度指令,则确定所述文本框的填充内容是否具有最大长度限制;
若所述文本框的填充内容具有所述最大长度限制,则确定所述填充内容的最大长度;
根据所述输入框填充数据的生成方式生成预设长度的所述输入框填充数据,所述预设长度大于所述最大长度。
进一步地,所述通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面之后,所述发送模块904具体还用于:
若所述浏览器页面的输入框为文本框,则将所述输入框填充数据填充至所述文本框后,获取所述文本框的填充内容;
确定所述填充内容的长度是否大于所述文本框限定的最大长度;
若所述填充内容的长度大于所述文本框限定的最大长度,且所述输入框填充数据的长度大于所述文本框限定的最大长度,则向所述用户发送长度校验错误提示。
进一步地,所述添加模块902具体用于:
在所述浏览器扩展程序的js脚本中添加所述消息发送事件;
获取Content.js文件,并在所述Content.js文件中添加所述监听事件;
在所述用户点击所述浏览器扩展程序的入口时,将所述Content.js文件嵌入所述原生程序的js脚本文件。
进一步地,所述将所述Content.js文件嵌入所述原生程序的js脚本文件之前,所述添加模块902具体还用于:
获取所述浏览器页面的URL地址;
确定所述浏览器页面的URL地址是否为预设地址;
若所述浏览器页面的URL地址为所述预设地址,则将所述Content.js文件嵌入所述原生程序的js脚本文件。
关于浏览器页面测试装置的具体限定可以参见上文中对于浏览器页面测试方法的限定,在此不再赘述。上述浏览器页面测试装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图10所示。该计算机设备包括通过***总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作***和计算机可读指令。该内存储器为非易失性存储介质中的操作***和计算机可读指令的运行提供环境。该计算机设备的网络接口用于与外部服务器通过网络连接通信。该计算机可读指令被处理器执行时以实现一种浏览器页面测试方法。
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现以下步骤:
确定需要进行输入框测试的浏览器页面;
在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,所述浏览器扩展程序为预先编写的用于对所述浏览器页面进行自动化测试的浏览器扩展程序;
获取用户对所述浏览器扩展程序的操作指令,并根据所述操作指令生成输入框填充数据;
通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面,以使所述浏览器页面通过所述监听事件获取所述输入框填充数据并获得测试结果。
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机可读指令,计算机可读指令被处理器执行时实现以下步骤:
确定需要进行输入框测试的浏览器页面;
在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,所述浏览器扩展程序为预先编写的用于对所述浏览器页面进行自动化测试的浏览器扩展程序;
获取用户对所述浏览器扩展程序的操作指令,并根据所述操作指令生成输入框填充数据;
通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面,以使所述浏览器页面通过所述监听事件获取所述输入框填充数据并获得测试结果。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局 限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种浏览器页面测试方法,其中,包括:
    确定需要进行输入框测试的浏览器页面;
    在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,所述浏览器扩展程序为预先编写的用于对所述浏览器页面进行自动化测试的浏览器扩展程序;
    获取用户对所述浏览器扩展程序的操作指令,并根据所述操作指令生成输入框填充数据;
    通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面,以使所述浏览器页面通过所述监听事件获取所述输入框填充数据并获得测试结果。
  2. 如权利要求1所述的浏览器页面测试方法,其中,所述根据所述操作指令生成输入框填充数据,包括:
    确定所述操作指令是否包括填充数据生成指令;
    若所述操作指令包括所述填充数据生成指令,则获取所述浏览器页面的输入框控件数组;
    轮询所述输入框控件数组的每一所述输入框,以确定所述输入框的类型,所述输入框的类型包括文本框、复选框、单选框和下拉框;
    根据所述输入框的类型的生成对应的输入框填充数据。
  3. 如权利要求2所述的浏览器页面测试方法,其中,所述根据所述输入框的类型的生成对应的输入框填充数据,包括:
    确定所述输入框的类型是否为所述文本框;
    若所述输入框的类型为所述文本框,则根据所述文本框的设置确定所述输入框填充数据的生成方式;
    根据所述输入框填充数据的生成方式生成所述输入框填充数据,所述输入框填充数据包括中文、英文、数字、标点符号、特殊符号、空格中的一个或多个。
  4. 如权利要求3所述的浏览器页面测试方法,其中,所述根据所述输入框填充数据的生成方式生成所述输入框填充数据,包括:
    确定所述操作指令是否包括填充长度指令;
    若所述操作指令包括所述填充长度指令,则确定所述文本框的填充内容是否具有最大长度限制;
    若所述文本框的填充内容具有所述最大长度限制,则确定所述填充内容的最大长度;
    根据所述输入框填充数据的生成方式生成预设长度的所述输入框填充数据,所述预设长度大于所述最大长度。
  5. 如权利要求1所述的浏览器页面测试方法,其中,所述通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面之后,所述方法还包括:
    若所述浏览器页面的输入框为文本框,则将所述输入框填充数据填充至所述文本框后,获取所述文本框的填充内容;
    确定所述填充内容的长度是否大于所述文本框限定的最大长度;
    若所述填充内容的长度大于所述文本框限定的最大长度,且所述输入框填充数据的长度大于所述文本框限定的最大长度,则向所述用户发送长度校验错误提示。
  6. 如权利要求1-5任一项所述的浏览器页面测试方法,其中,所述在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,包括:
    在所述浏览器扩展程序的js脚本中添加所述消息发送事件;
    获取Content.js文件,并在所述Content.js文件中添加所述监听事件;
    在所述用户点击所述浏览器扩展程序的入口时,将所述Content.js文件嵌入所述原生程序的js脚本文件。
  7. 如权利要求6所述的浏览器页面测试方法,其中,所述将所述Content.js文件嵌入所述原生程序的js脚本文件之前,所述方法还包括:
    获取所述浏览器页面的URL地址;
    确定所述浏览器页面的URL地址是否为预设地址;
    若所述浏览器页面的URL地址为所述预设地址,则将所述Content.js文件嵌入所述原生程序的js脚本文件。
  8. 一种浏览器页面测试装置,其中,包括:
    确定模块,用于确定需要进行输入框测试的浏览器页面;
    添加模块,用于在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,所述浏览器扩展程序为预先编写的用于对所述浏览器页面进行自动化测试的浏览器扩展程序;
    生成模块,用于获取用户对所述浏览器扩展程序的操作指令,并根据所述操作指令生成输入框填充数据;
    发送模块,用于通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面,以使所述浏览器页面通过所述监听事件获取所述输入框填充数据并获得测试结果。
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述计算机可读指令时实现如下步骤:
    确定需要进行输入框测试的浏览器页面;
    在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,所述浏览器扩展程序为预先编写的用于对所述浏览器页面进行自动化测试的浏览器扩展程序;
    获取用户对所述浏览器扩展程序的操作指令,并根据所述操作指令生成输入框填充数据;
    通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面,以使所述浏览器页面通过所述监听事件获取所述输入框填充数据并获得测试结果。
  10. 如权利要求9所述的计算机设备,其中,所述根据所述操作指令生成输入框填充数据,包括:
    确定所述操作指令是否包括填充数据生成指令;
    若所述操作指令包括所述填充数据生成指令,则获取所述浏览器页面的输入框控件数组;
    轮询所述输入框控件数组的每一所述输入框,以确定所述输入框的类型,所述输入框的类型包括文本框、复选框、单选框和下拉框;
    根据所述输入框的类型的生成对应的输入框填充数据。
  11. 如权利要求10所述的计算机设备,其中,所述根据所述输入框的类型的生成对应的输入框填充数据,包括:
    确定所述输入框的类型是否为所述文本框;
    若所述输入框的类型为所述文本框,则根据所述文本框的设置确定所述输入框填充数据的生成方式;
    根据所述输入框填充数据的生成方式生成所述输入框填充数据,所述输入框填充数据包括中文、英文、数字、标点符号、特殊符号、空格中的一个或多个。
  12. 如权利要求11所述的计算机设备,其中,所述根据所述输入框填充数据的生成方式生成所述输入框填充数据,包括:
    确定所述操作指令是否包括填充长度指令;
    若所述操作指令包括所述填充长度指令,则确定所述文本框的填充内容是否具有最大长度限制;
    若所述文本框的填充内容具有所述最大长度限制,则确定所述填充内容的最大长度;
    根据所述输入框填充数据的生成方式生成预设长度的所述输入框填充数据,所述预设长度大于所述最大长度。
  13. 如权利要求9所述的计算机设备,其中,所述通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面之后,所述处理器执行所述计算机可读指令时还实现如下步骤:
    若所述浏览器页面的输入框为文本框,则将所述输入框填充数据填充至所述文本框后,获取所述文本框的填充内容;
    确定所述填充内容的长度是否大于所述文本框限定的最大长度;
    若所述填充内容的长度大于所述文本框限定的最大长度,且所述输入框填充数据的长度大于所述文本框限定的最大长度,则向所述用户发送长度校验错误提示。
  14. 如权利要求9-13任一项所述的计算机设备,其中,所述在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,包括:
    在所述浏览器扩展程序的js脚本中添加所述消息发送事件;
    获取Content.js文件,并在所述Content.js文件中添加所述监听事件;
    在所述用户点击所述浏览器扩展程序的入口时,将所述Content.js文件嵌入所述原生程序的js脚本文件。
  15. 一个或多个存储有计算机可读指令的可读存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
    确定需要进行输入框测试的浏览器页面;
    在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,所述浏览器扩展程序为预先编写的用于对所述浏览器页面进行自动化测试的浏览器扩展程序;
    获取用户对所述浏览器扩展程序的操作指令,并根据所述操作指令生成输入框填充数据;
    通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面,以使所述浏览器页面通过所述监听事件获取所述输入框填充数据并获得测试结果。
  16. 如权利要求15所述的可读存储介质,其中,所述根据所述操作指令生成输入框填充数据,包括:
    确定所述操作指令是否包括填充数据生成指令;
    若所述操作指令包括所述填充数据生成指令,则获取所述浏览器页面的输入框控件数组;
    轮询所述输入框控件数组的每一所述输入框,以确定所述输入框的类型,所述输入框的类型包括文本框、复选框、单选框和下拉框;
    根据所述输入框的类型的生成对应的输入框填充数据。
  17. 如权利要求16所述的可读存储介质,其中,所述根据所述输入框的类型的生成对应的输入框填充数据,包括:
    确定所述输入框的类型是否为所述文本框;
    若所述输入框的类型为所述文本框,则根据所述文本框的设置确定所述输入框填充数据的生成方式;
    根据所述输入框填充数据的生成方式生成所述输入框填充数据,所述输入框填充数据包括中文、英文、数字、标点符号、特殊符号、空格中的一个或多个。
  18. 如权利要求17所述的可读存储介质,其中,所述根据所述输入框填充数据的生 成方式生成所述输入框填充数据,包括:
    确定所述操作指令是否包括填充长度指令;
    若所述操作指令包括所述填充长度指令,则确定所述文本框的填充内容是否具有最大长度限制;
    若所述文本框的填充内容具有所述最大长度限制,则确定所述填充内容的最大长度;
    根据所述输入框填充数据的生成方式生成预设长度的所述输入框填充数据,所述预设长度大于所述最大长度。
  19. 如权利要求15所述的可读存储介质,其中,所述通过所述消息发送事件将所述输入框填充数据发送至所述浏览器页面之后,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:
    若所述浏览器页面的输入框为文本框,则将所述输入框填充数据填充至所述文本框后,获取所述文本框的填充内容;
    确定所述填充内容的长度是否大于所述文本框限定的最大长度;
    若所述填充内容的长度大于所述文本框限定的最大长度,且所述输入框填充数据的长度大于所述文本框限定的最大长度,则向所述用户发送长度校验错误提示。
  20. 如权利要求15-19任一项所述的可读存储介质,其中,所述在浏览器扩展程序中添加消息发送事件,并在所述浏览器页面的原生程序中添加监听事件,包括:
    在所述浏览器扩展程序的js脚本中添加所述消息发送事件;
    获取Content.js文件,并在所述Content.js文件中添加所述监听事件;
    在所述用户点击所述浏览器扩展程序的入口时,将所述Content.js文件嵌入所述原生程序的js脚本文件。
PCT/CN2021/109447 2020-12-21 2021-07-30 浏览器页面测试方法、装置、计算机设备及存储介质 WO2022134582A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011519483.8 2020-12-21
CN202011519483.8A CN112631908A (zh) 2020-12-21 2020-12-21 浏览器页面测试方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022134582A1 true WO2022134582A1 (zh) 2022-06-30

Family

ID=75320466

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/109447 WO2022134582A1 (zh) 2020-12-21 2021-07-30 浏览器页面测试方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN112631908A (zh)
WO (1) WO2022134582A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112631908A (zh) * 2020-12-21 2021-04-09 深圳壹账通智能科技有限公司 浏览器页面测试方法、装置、计算机设备及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102004695A (zh) * 2010-12-08 2011-04-06 深圳市茁壮网络股份有限公司 浏览器测试方法及***
US20150378876A1 (en) * 2014-06-25 2015-12-31 Vmware, Inc. Visual graphical user interface verification
CN107590068A (zh) * 2017-08-04 2018-01-16 东软集团股份有限公司 浏览器页面测试方法、装置及计算机设备
CN108536594A (zh) * 2018-04-02 2018-09-14 腾讯科技(武汉)有限公司 页面测试方法、装置及存储设备
US10417306B1 (en) * 2013-01-03 2019-09-17 Amazon Technologies, Inc. Determining load completion of dynamically updated content
CN111641588A (zh) * 2020-04-28 2020-09-08 深圳壹账通智能科技有限公司 网页模拟输入检测方法、装置、计算机设备及存储介质
CN112631908A (zh) * 2020-12-21 2021-04-09 深圳壹账通智能科技有限公司 浏览器页面测试方法、装置、计算机设备及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102004695A (zh) * 2010-12-08 2011-04-06 深圳市茁壮网络股份有限公司 浏览器测试方法及***
US10417306B1 (en) * 2013-01-03 2019-09-17 Amazon Technologies, Inc. Determining load completion of dynamically updated content
US20150378876A1 (en) * 2014-06-25 2015-12-31 Vmware, Inc. Visual graphical user interface verification
CN107590068A (zh) * 2017-08-04 2018-01-16 东软集团股份有限公司 浏览器页面测试方法、装置及计算机设备
CN108536594A (zh) * 2018-04-02 2018-09-14 腾讯科技(武汉)有限公司 页面测试方法、装置及存储设备
CN111641588A (zh) * 2020-04-28 2020-09-08 深圳壹账通智能科技有限公司 网页模拟输入检测方法、装置、计算机设备及存储介质
CN112631908A (zh) * 2020-12-21 2021-04-09 深圳壹账通智能科技有限公司 浏览器页面测试方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN112631908A (zh) 2021-04-09

Similar Documents

Publication Publication Date Title
CN111061526B (zh) 自动化测试方法、装置、计算机设备及存储介质
CN111782330B (zh) 一种基于Web应用的页面数据获取方法、装置及设备
CN110647471B (zh) 接口测试用例生成方法、电子装置及存储介质
CN111222070B (zh) 数据处理方法、装置、设备及存储介质
CN110321283B (zh) 接口测试用例生成方法、装置、计算机装置及存储介质
CN110597714B (zh) kafka消息的测试方法、装置、计算机设备及存储介质
CN108923997B (zh) 一种基于python的云服务节点自动测试方法及装置
CN111694749A (zh) 接口自动测试方法、装置、计算机设备及可读存储介质
CN105786695A (zh) 数据测试方法及***
CN111858376A (zh) 请求报文生成方法和接口测试方法
WO2022134582A1 (zh) 浏览器页面测试方法、装置、计算机设备及存储介质
CN110750443A (zh) 网页测试的方法、装置、计算机设备及存储介质
CN111414303B (zh) 一种用于脚本性能测试的辅助***及方法
CN116303034A (zh) 一种片上网络的自动测试***、方法、设备及介质
CN111506501A (zh) 一种测试指令集的生成方法、装置及电子设备
CN112433929A (zh) 网页调试方法、装置、计算机设备和存储介质
CN113282476B (zh) 接口性能测试方法、装置和电子设备
CN111083007B (zh) 测试方法、装置、计算机设备和存储介质
CN115168230A (zh) 一种执行测试用例的方法、装置及介质
CN113722229A (zh) 软件测试方法、装置、电子设备和存储介质
CN108170557B (zh) 用于输出信息的方法和装置
CN113885841A (zh) 脚本生成的方法、装置、电子设备和可读介质
CN113656301A (zh) 一种接口测试方法、装置、设备及存储介质
CN113626392A (zh) 文档数据更新的方法和装置、电子设备和存储介质
CN112182552A (zh) 一种实名认证方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17/10/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21908587

Country of ref document: EP

Kind code of ref document: A1