CN113868125A - Component testing method and device, computer equipment and storage medium - Google Patents

Component testing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113868125A
CN113868125A CN202111092245.8A CN202111092245A CN113868125A CN 113868125 A CN113868125 A CN 113868125A CN 202111092245 A CN202111092245 A CN 202111092245A CN 113868125 A CN113868125 A CN 113868125A
Authority
CN
China
Prior art keywords
page
tested
selection
component
result
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
CN202111092245.8A
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.)
CMB Yunchuang Information Technology Co Ltd
Original Assignee
CMB Yunchuang Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CMB Yunchuang Information Technology Co Ltd filed Critical CMB Yunchuang Information Technology Co Ltd
Priority to CN202111092245.8A priority Critical patent/CN113868125A/en
Publication of CN113868125A publication Critical patent/CN113868125A/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

Abstract

The application relates to a component testing method, a component testing device, computer equipment and a storage medium. The method comprises the following steps: receiving a test trigger instruction, and responding to the test trigger instruction to obtain a page to be tested; element positioning processing is carried out on the page to be tested, and a selection component in the page to be tested is determined; and acquiring a real-time selection result in a selection menu of the selection component, and determining a test result of the page to be tested according to the real-time result. When the testing method is used for testing the webpage, the code writing behavior of research personnel is not limited, and the selected components in any format can be tested. Therefore, the testing efficiency of the selected component can be improved, and the probability of test error reporting is reduced.

Description

Component testing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for testing a component, a computer device, and a storage medium.
Background
With the development of computer technology, websites appear in people's life and offices. The website is a communication tool, people can publish the consultation which the people want to disclose through the website, and related network services can be provided through the website. The basic constituent element of the website is a web page, and before the web page is put into use, the relevant functions of the web page need to be tested.
The test tool sampled in the traditional technology can test a standard selection (Select) drop-down frame component in a webpage, but webpage codes written by front-end developers often comprise implementation codes of the standard Select drop-down frame component and implementation codes of a non-standard Select drop-down frame component, so that when the current test method is used for testing the webpage, test reports often occur, the webpage test is interrupted, and the webpage test cannot be continued.
Disclosure of Invention
In view of the above, it is necessary to provide a component testing method, apparatus, computer device and storage medium for solving the above technical problems.
In a first aspect, a method for testing a component is provided, the method comprising:
receiving a test trigger instruction, and responding to the test trigger instruction to obtain a page to be tested;
element positioning processing is carried out on the page to be tested, and a selection component in the page to be tested is determined;
and acquiring a real-time selection result in a selection menu of the selection component, and determining a test result of the page to be tested according to the real-time result.
In one embodiment, the method further comprises the following steps: responding to a test trigger instruction, and accessing a target server according to the resource address of the page to be tested;
and receiving page information sent by the target server, wherein the page information is used for presenting a page to be tested.
In one embodiment, the method further comprises the following steps: and loading a browser, and displaying the page to be tested through the browser based on the browser addressing resource address.
In one embodiment, the method further comprises the following steps: identifying the type of the implementation code of the page to be tested, and determining the code of each component in the page to be tested;
and identifying web page elements of the codes of the components, and if the codes of the components contain the web page elements, determining the components as selected components in the page to be tested.
In one embodiment, the method further comprises the following steps: triggering a selection instruction of a selection menu in response to the operation of determining a selection component in the page to be tested;
and determining a real-time selection result according to the selection instruction.
In one embodiment, the method further comprises the following steps: the selection instruction is used for selecting the page content matched with the circulation sequence, and the circulation sequence is used for traversing all the page contents in the selection menu.
In one embodiment, the method further comprises the following steps: if the real-time selection result is matched with the preset page content of the selection component, the test result is passed;
and if the real-time selection result is not matched with the preset page content of the selection component, the test result is failed.
In a second aspect, there is provided a computer device comprising:
the acquisition module is used for receiving a test trigger instruction and responding to the test trigger instruction to acquire a page to be tested;
the processing module is used for carrying out element positioning processing on the page to be tested and determining a selection component in the page to be tested;
and the determining module is used for acquiring a real-time selection result in the selection menu of the selection component and determining a test result of the page to be tested according to the real-time result.
In a third aspect, a computer device is provided, which includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the steps of the method according to the first aspect and any one of the possible implementation manners of the first aspect.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when being processed by a processor, carries out the steps of the method according to the first aspect as well as any one of the possible implementations of the first aspect.
The component testing method, the component testing device, the computer equipment and the storage medium receive the testing trigger instruction and respond to the testing trigger instruction to obtain the page to be tested; element positioning processing is carried out on the page to be tested, and a selection component in the page to be tested is determined; and acquiring a real-time selection result in a selection menu of the selection component, and determining a test result of the page to be tested according to the real-time result. Therefore, when the testing method is used for testing the webpage, the code writing behavior of research personnel is not limited, and the testing method can be used for testing the selected components in any format. Therefore, the testing efficiency of the selected component can be improved, and the probability of test error reporting is reduced.
Drawings
FIG. 1 is a block diagram of a computer device according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a component testing method according to an embodiment of the present application 1;
fig. 3 is a schematic flowchart of a component testing method according to an embodiment of the present application 2;
fig. 4 is a schematic flowchart of a component testing method according to an embodiment of the present application 3;
fig. 5 is a schematic flowchart of a component testing method according to an embodiment of the present application 4;
fig. 6 is a schematic flowchart of a component testing method according to an embodiment of the present application 5;
fig. 7 is a schematic structural diagram of an apparatus for testing a device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The component testing method provided by the application can be applied to computer equipment shown in FIG. 1. The internal structure of the computer device may be as shown in fig. 1. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a component testing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
In the embodiment of the application, the computer equipment can display pages such as a webpage and a login interface and can also test the pages. The testing of the page includes: link testing, form testing, and component testing, among others. It should be noted that, in the component testing method provided in the embodiment of the present application, the execution subject may be the computer device shown in fig. 1. In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments.
FIG. 2 is a flowchart illustrating a method for testing components in one embodiment, which is suitable for use in the computer apparatus shown in FIG. 1. As shown in fig. 2, the method comprises the steps of:
step 201, receiving a test trigger instruction, and responding to the test trigger instruction to obtain a page to be tested.
The embodiment of the application provides an automatic page testing scheme, in the scheme, a user initiates a testing triggering instruction, and then computer equipment can perform automatic testing. After the user initiates the trigger test instruction, the computer device may receive the test trigger instruction. And the page to be tested can be obtained in response to the test triggering instruction so as to automatically test the page to be tested.
In order to determine the test result of the page to be tested, the page to be tested is obtained on the computer device, and the corresponding test result is determined based on the page to be tested. Therefore, in step 201, the computer device may receive a test trigger instruction to trigger the test to start, and then the computer device obtains the page to be tested in response to the test trigger instruction, so that the page to be tested matches the test result.
Specifically, the test trigger instruction is used for starting a test, and the computer device receives and responds to the test starting instruction to enable the page to be tested to start an automatic test. The page to be tested is used for obtaining test content. For example, the page to be tested may be a web page or a login interface, and the embodiment of the present application is not limited herein.
In a possible implementation manner, when a "run" control of a test interface is triggered, a computer device receives a test starting request, and responds to the test request, so that a test is started, thereby further acquiring a webpage to be tested, and for a type of the webpage to be tested, embodiments of the present application are not limited herein.
Step 202, element positioning processing is carried out on the page to be tested, and a selection component in the page to be tested is determined.
Specifically, the element locating process is used to locate an element in the page to be tested, where the element may be the content of the page to be tested. The selection component is used to characterize selectable content within the page. Illustratively, the selection component may be, but is not limited to, a Select drop-down box component.
In one possible implementation, the computer device may locate the content of the page to be tested by an element location method. For example, the content of the page to be tested may be an input component, a click component, and a selection component, and the embodiment of the present application is not limited herein. When the different types of components are located, the different types of components can be element located to determine the selected component. For example, the element positioning method may be an id positioning method, an xpath positioning method, or a name positioning method, and the embodiment of the present application is not limited herein.
And 203, acquiring a real-time selection result in the selection menu of the selection component, and determining a test result of the page to be tested according to the real-time result.
Specifically, the selection component includes a selection menu, the selection menu may include a plurality of items of content, and each item of content in the plurality of items of content may be selected content. During the testing process, each item of content is selected, which can be called real-time selected content. According to the content selected in real time, the test result of the page to be tested can be determined, and the test result is used for representing the excellent degree of the whole test.
In one possible implementation, the real-time selection result is used to represent a content in the selection menu. For example, the content may be 1, 2, or 3, or the number of content display pieces in the web page may be used. For example, 10 strips may be displayed per page, 20 strips may be displayed per page, and 30 strips may be displayed per page, and the embodiment of the present application is not limited herein. And determining a test result of the page to be tested according to the real-time selection result, wherein the test result is used for representing the excellent degree of the test. Illustratively, the real-time selected results in the test process all run normally, and the test results are good.
In the component testing method, the computer equipment receives a testing trigger instruction and responds to the testing trigger instruction to obtain a page to be tested; element positioning processing is carried out on the page to be tested, and a selection component in the page to be tested is determined; and acquiring a real-time selection result in a selection menu of the selection component, and determining a test result of the page to be tested according to the real-time result. Therefore, when the testing method is used for testing the webpage, the code writing behavior of research personnel is not limited, and the testing method can be used for testing the selected components in any format. Therefore, the testing efficiency of the selected component can be improved, and the probability of test error reporting is reduced.
In the foregoing embodiments, a technical scheme for determining a test result of a page to be tested by computer equipment according to the page to be tested, a selection component in the page to be tested, and a real-time selection result in the selection component is introduced. In another embodiment of the present application, the computer device may present the page to be tested according to the test trigger instruction. For example, the specific implementation of "receiving a test trigger instruction and acquiring a page to be tested in response to the test trigger instruction" referred to in the foregoing step 201 includes the steps of fig. 3:
step 301, responding to the test trigger instruction, and accessing the target server according to the resource address of the page to be tested.
Specifically, the resource address of the page to be tested is used for characterizing the specific position of the page to be tested in the network, and the specific position is the unique address of the page to be tested in the network. Illustratively, the location may be a network address, for example, an IP (Internet Protocol) address. And accessing the target server through the network address, and firstly searching a target service IP address corresponding to the IP address of the page to be tested. And then establishing connection between the page to be tested and the target server.
In one possible implementation, the computer device causes the test to begin in response to triggering a test instruction. And searching a target server IP address corresponding to the page to be tested through the IP address of the page to be tested. Illustratively, the lookup manner may be a DNS (Domain Name System) lookup. The target server establishes a connection with the network address through the IP address. For example, the connection mode may be a TCP (Transmission Control Protocol) connection.
Step 302, receiving page information sent by a target server, wherein the page information is used for presenting a page to be tested.
Specifically, the page information may be a response made by the page reception target server to be tested. For example, the response may be, but is not limited to, Text in the form of HTML (Hyper Text Markup Language).
After the connection between the IP address of the page to be tested and the target server corresponding to the IP address is established, the server can respond to the request of the page to be tested and return the response. The page to be tested receives the text in the HTML form sent by the server and uses the finite automaton to understand the text in the HTML form.
In the foregoing embodiments, a technical solution is introduced in which when a computer device receives page information sent by a server, a target server sends the page information to the computer device by accessing the target server. In another embodiment of the present application, page information of a target server may be accessed and received through a browser. For example, the specific implementation of "receiving page information sent by a target server, the page information being used for presenting a page to be tested" referred to in the foregoing step 302 includes the following steps:
and loading a browser, and displaying the page to be tested through the browser based on the browser addressing resource address.
Specifically, a browser is an application program used to retrieve and display Web information resources. The Resource address may be a network address, and the network address may be a URL (Uniform Resource Locator) address. Illustratively, it may be the network address http:// www.google.cn of the Google search engine. The page to be tested may be a web page. For example, it may be a web page of a google search engine.
In one possible implementation, a computer device may automatically load a google browser, requesting to establish a connection between a network address of a google search engine and a google server at a google browser user interface. And the Google server makes a response, renders the response to a screen of the computer equipment, and displays the response on the screen by a webpage of a Google search engine.
In the foregoing embodiments, a technical solution for displaying a page to be tested by loading a browser and inputting a network address is introduced. In another embodiment of the present application, the code for each component and the selected component may be determined by the implementation code of the page to be tested. For example, the specific implementation of step 202 "perform element locating process on the page to be tested, and determine the selected component in the page to be tested" includes the steps of fig. 4:
step 401, identifying the type of the implementation code of the page to be tested, and determining the code of each component in the page to be tested.
Specifically, the implementation code in the page to be tested is used to identify the page element category. For example, the element category may be an input component, a click component, or a selection component, and the embodiments of the present application are not limited herein. The different element categories are all contained in the implementation code of the page to be tested.
In one possible implementation manner, the implementation code of the page to be tested includes the tag code of each component. For example, the code of the component may be input, the code of the component may be clicked, and the code of the component may be selected, which is not limited herein.
Step 402, identifying web page elements of the component codes, and if the web page elements are contained in the component codes, determining the components as selected components in the page to be tested.
Specifically, the component implementation code of the page to be tested contains web page elements, and the web page elements can be positioned by an element positioning method. Illustratively, the selection component may be determined by id location and xpath location. For example, the selection component may be a Select drop-down box component, or may be other forms of drop-down box components, and the embodiments of the present application are not limited herein.
According to a possible implementation mode, the implementation code of the page to be tested comprises a code of a selection component, and the selection component can be identified by using an element positioning method so as to determine a Select drop-down box component.
In the foregoing embodiments, a technical solution for determining a selection component in a page to be tested according to an element positioning method is introduced. In another embodiment of the present application, the real-time selection result may be determined from the selection instruction in the selection component. For example, the specific implementation described above in relation to step 203 "obtaining real-time selection results in a selection menu for selecting a component" includes the steps of FIG. 5:
step 501, responding to the operation of determining the selection component in the page to be tested, and triggering a selection instruction of the selection menu.
Specifically, the selection component includes a selection menu. Illustratively, the selection component may be a Select drop-down box component. Selecting a menu means that after selecting a Select drop-down box component, the option will extend down a menu with other options. The selection instruction of the selection menu refers to selecting a corresponding option in the drop-down box.
According to a possible implementation mode, the computer equipment is positioned to the position corresponding to the drop-down box according to an element positioning method, a 'click' control corresponding to the drop-down box is triggered, the drop-down box automatically pops up a selection menu, a 'selection' control is automatically triggered, and one item in the selection menu is selected.
And 502, determining a real-time selection result according to the selection instruction.
Specifically, the real-time selection result is that after the selection instruction is responded, the operation result displays the corresponding selected option.
In a possible implementation manner, under the condition that the computer equipment triggers a selection instruction, one item in the selection menu is automatically selected, and the operation result displays the corresponding selected item.
In the foregoing embodiments, a technical solution for determining a real-time selection result according to a selection instruction is introduced. In another embodiment of the present application, all page contents in the selection menu may be traversed according to a circular order. For example, the specific implementation of the aforementioned "obtaining a real-time selected result in a selection menu of a selection component" in step 203 includes the following steps:
the selection instruction is used for selecting the page content matched with the circulation sequence, and the circulation sequence is used for traversing all the page contents in the selection menu.
Specifically, the loop sequence refers to the sequence in which the selection instruction selects each item of the contents of the selection menu. For example, the loop sequence may be from top to bottom in the selection menu, or from bottom to top in the selection menu. The embodiments of the present application are not limited herein with respect to the order of the cycles. .
In one possible implementation, the selection instruction may traverse each item of content in the selection menu in a top-to-bottom loop order.
In the foregoing embodiments, a technical solution is described in which the selection instruction traverses each item of content in the selection menu according to a loop sequence. In another embodiment of the present application, the test results may be determined based on the real-time selected results. For example, the specific implementation of "determining the test result of the page to be tested according to the real-time result" referred to in the foregoing step 203 includes the steps of fig. 6:
step 601, if the real-time selected result is matched with the preset page content of the selection component, the test result is passed.
Specifically, the preset page content of the selection component is used for verifying whether the real-time selection result is one item of content in the selection menu. For example, the test content may be a test execution time, a test execution duration, and a test script name, and the embodiment of the present application is not limited herein for the test content. And the test result is used for displaying the test content.
And a possible implementation mode is that the traversed real-time selection result is matched and verified with the preset page content of the selection component, and if the real-time selection result is one item in the selection menu, the test is considered to be passed. Illustratively, if the preset page content is 10 pieces per page, 20 pieces per page or 30 pieces per page. And if the real-time selection result is any one of the three items, verifying that the real-time selection result is matched with the preset page content of the selection component, and displaying the test result to be passed.
Step 602, if the real-time selected result is not matched with the preset page content of the selection component, the test result is failed.
Specifically, the fact that the real-time selection result is not matched with the preset page content means that the real-time selection result is not included in the preset page content.
And a possible implementation mode is that the traversed real-time selection result is matched and verified with the preset page content of the selection component, and if the real-time selection result is not one item in the selection menu, the test is not considered to pass. Illustratively, if the preset page content is 10 pieces per page, 20 pieces per page or 30 pieces per page. And if the real-time selection result is not any one of the three items, verifying that the real-time selection result is not matched with the preset page content of the selection component, and displaying the test result to be passed.
In the foregoing embodiment, the computer device determines the test result of the page to be tested according to the real-time selection result, which can improve the test efficiency of the Select drop-down frame component and reduce the probability of test error.
In one embodiment, as shown in fig. 7, there is provided a component testing apparatus including: an obtaining module 701, a processing module 702, and a determining module 703. Wherein:
the obtaining module 701 is configured to receive a test trigger instruction, and obtain a page to be tested in response to the test trigger instruction.
The processing module 702 is configured to perform element positioning processing on the page to be tested, and determine a selection component in the page to be tested.
The determining module 703 is configured to obtain a real-time selection result in the selection menu of the selection component, and determine a test result of the page to be tested according to the real-time result.
In an embodiment, the obtaining module 701 is configured to receive a test trigger instruction, and obtain a page to be tested in response to the test trigger instruction.
In one embodiment, the processing module 702 is configured to perform element positioning processing on a page to be tested, and determine a selection component in the page to be tested.
In an embodiment, the determining module 703 is configured to obtain a real-time selection result in a selection menu of the selection component, and determine a test result of the page to be tested according to the real-time result.
In an embodiment, the obtaining module 701 is specifically configured to respond to a test trigger instruction, and access the target server according to a resource address of the page to be tested; and receiving page information sent by the target server, wherein the page information is used for presenting a page to be tested.
In one embodiment, a browser is loaded, and a resource address is addressed based on the browser to display a page to be tested through the browser.
In an embodiment, the processing module 702 is specifically configured to perform type identification on the implementation code of the page to be tested, and determine the code of each component in the page to be tested; and identifying web page elements of the codes of the components, and if the codes of the components contain the web page elements, determining the components as selected components in the page to be tested.
In one embodiment, the determining module 703 is specifically configured to trigger a selection instruction of the selection menu in response to determining an operation of a selection component in the page to be tested; and determining a real-time selection result according to the selection instruction.
In one embodiment, the selection instruction is for selecting page content that matches a circular order for traversing all page content in the selection menu.
In one embodiment, the determining module 703 is specifically configured to, if the real-time selection result matches with the preset page content of the selection component, determine that the test result is a pass; and if the real-time selection result is not matched with the preset page content of the selection component, the test result is failed.
For the specific definition of the device for testing components, reference may be made to the above definition of the method for testing components, which is not described herein again. The respective modules of the above-described component test apparatus may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory of the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
receiving a test trigger instruction, and responding to the test trigger instruction to obtain a page to be tested;
element positioning processing is carried out on the page to be tested, and a selection component in the page to be tested is determined;
and acquiring a real-time selection result in a selection menu of the selection component, and determining a test result of the page to be tested according to the real-time result.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
responding to a test trigger instruction, and accessing a target server according to the resource address of the page to be tested;
and receiving page information sent by the target server, wherein the page information is used for presenting a page to be tested.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and loading a browser, and displaying the page to be tested through the browser based on the browser addressing resource address.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
identifying the type of the implementation code of the page to be tested, and determining the code of each component in the page to be tested;
and identifying web page elements of the codes of the components, and if the codes of the components contain the web page elements, determining the components as selected components in the page to be tested.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
triggering a selection instruction of a selection menu in response to the operation of determining a selection component in the page to be tested;
and determining a real-time selection result according to the selection instruction.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
the selection instruction is used for selecting the page content matched with the circulation sequence, and the circulation sequence is used for traversing all the page contents in the selection menu. In one embodiment, the processor, when executing the computer program, further performs the steps of:
if the real-time selection result is matched with the preset page content of the selection component, the test result is passed;
and if the real-time selection result is not matched with the preset page content of the selection component, the test result is failed.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of testing a component, comprising:
receiving a test trigger instruction, and responding to the test trigger instruction to acquire a page to be tested;
carrying out element positioning processing on the page to be tested, and determining a selection component in the page to be tested;
and acquiring a real-time selection result in a selection menu of the selection component, and determining a test result of the page to be tested according to the real-time result.
2. The method of claim 1, wherein the retrieving a page to be tested in response to the test trigger instruction comprises:
responding to the test trigger instruction, and accessing a target server according to the resource address of the page to be tested;
and receiving page information sent by the target server, wherein the page information is used for presenting the page to be tested.
3. The method of claim 2, wherein accessing a target server according to the resource address of the page to be tested comprises:
and loading a browser, and addressing the resource address based on the browser so as to display the page to be tested through the browser.
4. The method of claim 1, wherein the performing element locating processing on the page to be tested to determine a selected component in the page to be tested comprises:
identifying the type of the implementation code of the page to be tested, and determining the code of each component in the page to be tested;
and identifying web page elements of the codes of the components, and if the codes of the components contain the web page elements, determining the components to be selected components in the page to be tested.
5. The method of claim 1, wherein obtaining real-time selection results in a selection menu of the selection component comprises:
triggering a selected instruction of the selection menu in response to determining the operation of a selection component in the page to be tested;
and determining the real-time selection result according to the selection instruction.
6. The method of claim 5, wherein the selection instruction is configured to select page content that matches a circular order, the circular order configured to traverse all page content in the selection menu.
7. The method of claim 1, wherein determining the test result of the page to be tested according to the real-time result comprises:
if the real-time selection result is matched with the preset page content of the selection component, the test result is passed;
and if the real-time selection result is not matched with the preset page content of the selection component, the test result is failed.
8. A component testing apparatus, the apparatus comprising:
the acquisition module is used for receiving a test trigger instruction and responding to the test trigger instruction to acquire a page to be tested;
the processing module is used for carrying out element positioning processing on the page to be tested and determining a selection component in the page to be tested;
and the determining module is used for acquiring a real-time selection result in the selection menu of the selection component and determining a test result of the page to be tested according to the real-time result.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202111092245.8A 2021-09-17 2021-09-17 Component testing method and device, computer equipment and storage medium Pending CN113868125A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111092245.8A CN113868125A (en) 2021-09-17 2021-09-17 Component testing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111092245.8A CN113868125A (en) 2021-09-17 2021-09-17 Component testing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113868125A true CN113868125A (en) 2021-12-31

Family

ID=78996466

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111092245.8A Pending CN113868125A (en) 2021-09-17 2021-09-17 Component testing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113868125A (en)

Similar Documents

Publication Publication Date Title
US9203720B2 (en) Monitoring the health of web page analytics code
CN108595329B (en) Application testing method and device and computer storage medium
US9483572B2 (en) Interactivity analyses of web resources based on reload events
US9584504B2 (en) Auto login method and device
WO2018223717A1 (en) Webpage front-end testing method, device, system, apparatus and readable storage medium
JP6688389B2 (en) Information leakage inspection method, device, server, and computer-readable storage medium
CN107918575B (en) Page state monitoring method and device
US10491629B2 (en) Detecting sensitive data sent from client device to third-party
CN112199300A (en) Interface testing method and device, electronic equipment and storage medium
CN113760763A (en) Software testing method, device, server and system
CN111258904A (en) Webpage element testing method and related device
CN111694550A (en) Page display control method, device and system
CN111431767A (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
US11403209B2 (en) Rendering GUI test object of application under test to reflect test information
CN107483294B (en) Method and device for monitoring network request
CN110708270B (en) Abnormal link detection method and device
CN110737861A (en) webpage data processing method, device, equipment and storage medium
CN113868125A (en) Component testing method and device, computer equipment and storage medium
CN111737629B (en) Data detection method and device
CN114465926A (en) Recursive server monitoring method, device, equipment and storage medium
CN104679786B (en) Form processing method and device
US20150154182A1 (en) Data localization service made available by a web browser
KR100446209B1 (en) System for collecting information based on internet
CN111241370B (en) Method, device and storage medium for crawling content in distributed manner
CN113986603B (en) Method and device for determining page loading abnormity reason and 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