CN116431467A - Page test method, device, equipment and medium - Google Patents

Page test method, device, equipment and medium Download PDF

Info

Publication number
CN116431467A
CN116431467A CN202310073176.9A CN202310073176A CN116431467A CN 116431467 A CN116431467 A CN 116431467A CN 202310073176 A CN202310073176 A CN 202310073176A CN 116431467 A CN116431467 A CN 116431467A
Authority
CN
China
Prior art keywords
page
test
target
determining
identifier
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
CN202310073176.9A
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.)
Dashangsuo Feitai Testing Technology Co ltd
Original Assignee
Dashangsuo Feitai Testing 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 Dashangsuo Feitai Testing Technology Co ltd filed Critical Dashangsuo Feitai Testing Technology Co ltd
Priority to CN202310073176.9A priority Critical patent/CN116431467A/en
Publication of CN116431467A publication Critical patent/CN116431467A/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/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3692Test management for test results analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a page testing method, device, equipment and medium, which are used for helping users without code technology foundation complete testing. In the embodiment of the application, by receiving the page identifier of the reference page input by the user, determining the reference page corresponding to the page identifier in a pre-stored page object library, acquiring the test element contained in the test page and the standard element contained in the reference page, judging whether the element attributes of the test element and the standard element are matched one by one, and if not, determining that the test of the test page fails. The user only needs to input the page identification of the reference page, and the test can be completed without code technology foundation.

Description

Page test method, device, equipment and medium
Technical Field
The present disclosure relates to the field of test automation technologies, and in particular, to a method, an apparatus, a device, and a medium for testing a page.
Background
With the development of internet technology, updating iterations of an Application (APP) end, a computer (PC) end and a Web (Web) end for various internet products are more and more frequent. The workload of testing the page elements before and after version update is also increasing. The existing automatic test frames have various types, but have code requirements on testers, the testers can write codes to complete the test, and in the execution process, many running errors exist, frequent debugging is needed, and the testers without code technology foundation cannot complete the test.
Therefore, there is a need for a simple page test method to help users without code technology base complete the test.
Disclosure of Invention
The application provides a page testing method, a page testing device, electronic equipment and a storage medium, which are used for solving the problem that a tester without a code technology foundation cannot complete testing.
In a first aspect, the present application provides a page testing method, including:
receiving an input page identifier of a reference page, and determining a reference page corresponding to the page identifier in a pre-stored page object library;
acquiring test elements contained in a test page and standard elements contained in the reference page;
judging whether the element attributes of the test element and the standard element are matched one by one, if not, determining that the test page test fails.
In one possible implementation, the element attributes include: at least one of an element identification, an element path language XPath value, an element icon, and an element description;
if the element attribute includes: the judging whether the element attributes of the test element and the standard element are matched one by one comprises the following steps:
and judging whether the test element is matched with the element identification, the element XPath value, the element icon and the element description of the standard element in a one-to-one correspondence manner.
In one possible implementation manner, the method for generating the test page includes:
receiving an input page identifier of a new page; if the fact that the page with the page identifier does not exist in the page object library is determined, generating the page with the page identifier and storing the page to the page object library;
responding to an element adding operation aiming at the page of the page identifier, and acquiring an element icon and an element XPath value of an element to be added; and adding the element icon to the corresponding position of the page identifier according to the position information in the element XPath value and storing the element icon.
In one possible implementation manner, the obtaining, in response to the operation of adding the element to the page identified by the page, the element icon and the element XPath value of the element to be added includes:
receiving an input element icon and an element XPath value of an element to be added; or (b)
Receiving input information of a target grabbing page, and determining the target grabbing page; and determining the element attribute of the target element in the target crawling page in response to the crawling operation for the target element in the target crawling page, and extracting the element icon and the element XPath value in the element attribute.
In one possible implementation manner, the receiving the input information of the target grabbing page, and determining the target grabbing page includes:
receiving an input page identification of a target grabbing page, and determining a target grabbing page corresponding to the page identification in a pre-stored page object library; or (b)
And receiving the input website of the target grabbing page, and determining the target grabbing page according to the website.
In one possible implementation manner, the acquiring the test element included in the test page and the standard element included in the reference page includes:
extracting all test elements contained in the test page and all standard elements contained in the reference page; or (b)
Extracting and displaying test element attributes of all test elements contained in the test page, and determining the test elements in response to a test element selection operation aiming at the target test element attributes; and displaying the reference page, and determining standard elements in response to a selection operation for the standard elements contained in the reference page.
In a second aspect, the present application provides a page testing apparatus, the apparatus comprising:
the determining module is used for receiving the page identification of the input reference page and determining the reference page corresponding to the page identification in a pre-stored page object library;
the acquisition module is used for acquiring test elements contained in the test page and standard elements contained in the reference page;
and the judging module is used for judging whether the element attributes of the test element and the standard element are matched one by one, and if not, determining that the test page test fails.
In one possible embodiment, the apparatus further comprises:
the generation module is used for receiving the input page identification of the new page; if the fact that the page with the page identifier does not exist in the page object library is determined, generating the page with the page identifier and storing the page to the page object library;
the adding module is used for responding to the operation of adding the elements to the page identified by the page and obtaining element icons and element XPath values of the elements to be added; and adding the element icon to the corresponding position of the page identifier according to the position information in the element XPath value and storing the element icon.
In a third aspect, the present application provides an electronic device comprising at least a processor and a memory, the processor being configured to implement the steps of any of the page testing methods described above when executing a computer program stored in the memory.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program which when executed by a processor performs the steps of a page testing method as described in any one of the above.
In the embodiment of the application, by receiving the page identifier of the reference page input by the user, determining the reference page corresponding to the page identifier in a pre-stored page object library, acquiring the test element contained in the test page and the standard element contained in the reference page, judging whether the element attributes of the test element and the standard element are matched one by one, and if not, determining that the test of the test page fails. The user only needs to input the page identification of the reference page, and the test can be completed without code technology foundation.
Drawings
In order to more clearly illustrate the embodiments of the present application or the implementation in the related art, a brief description will be given below of the drawings required for the embodiments or the related art descriptions, and it is apparent that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings for those of ordinary skill in the art.
Fig. 1 is a schematic diagram of a page testing process according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a page list interface according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a page testing apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail below with reference to the accompanying drawings, wherein it is apparent that the embodiments described in the present application are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
It should be noted that the brief description of the terms in the present application is only for convenience in understanding the embodiments described below, and is not intended to limit the embodiments of the present application. Unless otherwise indicated, these terms should be construed in their ordinary and customary meaning.
The terms "first," second, "" third and the like in the description and in the claims and in the above-described figures are used for distinguishing between similar or similar objects or entities and not necessarily for limiting a particular order or sequence, unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances.
The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to all elements explicitly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware or/and software code that is capable of performing the function associated with that element.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
In order to improve the test simplicity and help users without code technology foundation to complete the test, the application provides a page test method, a page test device, electronic equipment and a storage medium. The method comprises the following steps: receiving an input page identifier of a reference page, and determining a reference page corresponding to the page identifier in a pre-stored page object library; acquiring test elements contained in a test page and standard elements contained in the reference page; judging whether the element attributes of the test element and the standard element are matched one by one, if not, determining that the test page test fails.
Example 1:
fig. 1 is a schematic diagram of a page testing process provided in an embodiment of the present application, as shown in fig. 1, where the process includes:
s101: and receiving the page identification of the input reference page, and determining the reference page corresponding to the page identification in a pre-stored page object library.
The page testing method provided by the embodiment of the application is applied to electronic equipment, and the electronic equipment can be a PC, a mobile phone, a tablet personal computer, a server and the like.
In order to update versions of internet products, a page object library of the internet products of each version is pre-stored. Each page in the page object library corresponds to a page identifier, and the page identifier may be an identifier uniquely identifying the page, such as a page name or a page number. The user can select any one of the pages as a reference page according to the requirement, and input the page identification of the reference page. The reference page can be a page of the last version of the internet product corresponding to the test page, or a pre-stored page which passes the page test.
After receiving the input page identifier of the reference page, the electronic device may determine, in a pre-stored page object library, the reference page corresponding to the page identifier.
S102: and acquiring test elements contained in the test page and standard elements contained in the reference page.
And acquiring an element to be tested, namely a test element, contained in the test page and an element serving as a reference, namely a standard element, contained in the reference page. The test elements can be all elements contained in the test page, or can be part of elements contained in the test page appointed according to the requirement; the standard elements may be all elements contained in the reference page, or may be part of the elements in the reference page specified according to the need.
S103: judging whether the element attributes of the test element and the standard element are matched one by one, if not, determining that the test page test fails.
Judging whether the element attributes of the test element and the standard element are matched one by one, namely judging whether a standard element consistent with the element attribute of the test element exists for any test element, and judging whether a test element consistent with the element attribute of the standard element exists for any standard element. If the judging results are yes, the element attributes of the test elements and the standard elements are matched one by one, the test page is determined to pass the test, and first prompt information of the test page passing the test can be displayed. If any judging result is negative, the element attributes of the test element and the standard element are not matched one by one, the test page is determined to fail to pass, and second prompt information of the test page failing to pass the test can be displayed. The second prompt information may further include specific information of test elements or standard elements with unmatched element attributes.
In the embodiment of the application, by receiving the page identifier of the reference page input by the user, determining the reference page corresponding to the page identifier in a pre-stored page object library, acquiring the test element contained in the test page and the standard element contained in the reference page, judging whether the element attributes of the test element and the standard element are matched one by one, and if not, determining that the test of the test page fails. The user only needs to input the page identification of the reference page, and the test can be completed without code technology foundation.
Example 2:
in order to improve the accuracy of the page test, on the basis of the above embodiment, in the embodiment of the present application, the element attribute includes: at least one of an element identification, an element path language XPath value, an element icon, and an element description;
if the element attribute includes: the judging whether the element attributes of the test element and the standard element are matched one by one comprises the following steps:
and judging whether the test element is matched with the element identification, the element XPath value, the element icon and the element description of the standard element in a one-to-one correspondence manner.
Each element has its own element attributes including, but not limited to, element identification, element XPath values, element icons, and element descriptions. The element identifier may be an identifier of the element, such as a name or a number of the element, the XPath is located in a locating manner aiming at the element, the XPath value of the element contains position information of the element, the element icon is a picture content of the element, and the element is described as a content customized by a user according to needs, such as a text content contained in the element. Since Android (Android) platforms also support Android path language (Android findby) positioning, mobile operating system (iOS) platforms developed by apple corporation also support apple path language (iOS endby) positioning, and the element XPath value in the element attribute may also be the element Android findby value or the element iOS endby value.
If the element attributes include: judging whether the test element is matched with the element identifier, the element XPath value, the element icon and the element description of the standard element in a one-to-one correspondence manner, namely judging whether a standard element consistent with the element identifier, the element XPath value, the element icon and the element description of the test element exists for any test element, and judging whether a test element consistent with the element identifier, the element XPath value, the element icon and the element description of the standard element exists for any standard element. If the judging results are all yes, the element attributes of the test element and the standard element are matched one by one; if any judging result is negative, the element attributes of the test element and the standard element are not matched one by one.
In the embodiment of the application, the accuracy of page testing is further improved by judging whether each element attribute of the test element and the standard element is matched one by one, namely whether the element identifier, the element XPath value, the element icon and the element description are matched one by one.
Example 3:
in order to facilitate the generation of the test page, on the basis of the above embodiments, in the embodiments of the present application, the method for generating the test page includes:
receiving an input page identifier of a new page; if the fact that the page with the page identifier does not exist in the page object library is determined, generating the page with the page identifier and storing the page to the page object library; responding to an element adding operation aiming at the page of the page identifier, and acquiring an element icon and an element XPath value of an element to be added; and adding the element icon to the corresponding position of the page according to the position information in the element XPath value and storing the element icon.
To facilitate the generation of a test page, the page identification of the incoming new page may be received. The page type of the newly built page comprises a PC type corresponding to a computer end, a Web type corresponding to a webpage end and an APP type corresponding to a mobile terminal. In order to avoid repeated confusion of pages, after receiving the page identification of the newly built page, judging whether the page with the page identification exists in a pre-stored page object library. If the page identification exists, the page of the page identification does not need to be generated again, and the prompt information of the existing page of the page identification can be displayed; if not, the page which can generate the page identification is indicated, and a blank page of the page identification is generated and stored in a page object library. In order to add an element in a blank page of the page identifier, a user may perform an element adding operation for the page of the page identifier. And the electronic equipment responds to the operation of adding the elements to the page identified by the page, and acquires the element icon and the element XPath value of the element to be added.
The following description will be given by way of a specific example. Fig. 2 is a schematic diagram of a page list interface according to an embodiment of the present application. As shown in fig. 2, page information such as page identification, description, number of elements, page type, and the like of the pages, and an edit button for each page may be contained in the page list interface. The operation of adding elements by the user for the page identified by the page may be selecting the page identified by the page in the page list and clicking a preset editing button, clicking a preset adding element button in a popped page editing interface, and inputting an element icon and an element XPath value of an element to be added in a popped input box. The electronic equipment receives the input element icon and the element XPath value of the element to be added. Or the user can click a preset element selecting and adding button in the popped page editing interface, select an element to be added in the popped pre-stored element object list, click a preset determining button, and the electronic equipment extracts the pre-stored element icon and the element XPath value of the element to be added. And adding the element icon to the corresponding position of the page identified by the page according to the position information in the element XPath value and storing the element icon.
In the embodiment of the application, if the fact that the page of the input page identification does not exist in the page object library is determined, generating the page of the page identification and storing the page to the page object library; responding to an element adding operation aiming at the page identified by the page, and acquiring an element icon and an element XPath value of an element to be added; and adding the element icon to the corresponding position of the page identified by the page according to the position information in the element XPath value and storing the element icon, so that the test page can be conveniently and rapidly generated.
Example 4:
in order to facilitate generating a test page, based on the above embodiments, in this embodiment of the present application, the obtaining, in response to an element adding operation for a page identified by the page, an element icon and an element XPath value of an element to be added includes:
receiving an input element icon and an element XPath value of an element to be added; or (b)
Receiving input information of a target grabbing page, and determining the target grabbing page; responding to a grabbing operation for a target element in the target grabbing page; and determining the element attribute of the target element in the target grabbing page, and extracting an element icon and an element XPath value in the element attribute.
In order to facilitate the generation of the test page, in the step of creating the added element of the page, the user may directly input the element icon and the element XPath value of the element to be added.
In the step of adding elements of the new page, the user can also grab the target elements in the designated page, namely the target grabbing page, to be used as the elements to be added of the new page, and extract the element icons and the element XPath values of the target elements. Specifically, the user may first input information such as a page identifier or a web address of the target crawling page. And performing grabbing operation according to the popped target grabbing page or an element list of elements contained in the target grabbing page, for example, selecting target elements in the target grabbing page by using a preset selection frame. The electronic equipment determines a target grabbing page according to the received page information, then determines the target element as an element to be added in response to clicking operation of a selection frame of the target element in the selected target grabbing page, acquires the element attribute of the target element, and extracts an element icon and an element XPath value in the element attribute.
In the application embodiment, an element icon and an element XPath value of an input element to be added are received; or receiving input information of a target grabbing page, determining the target grabbing page, and responding to grabbing operation for target elements in the target grabbing page, and extracting element icons and element XPath values in element attributes of the target elements; the convenience of generating the test page is further improved.
In one possible implementation, elements contained in other pages that are pre-saved may also be moved to the new page. For example, a mobile element button is preset in an element management interface of a page in a pre-stored page object library, and a user can select one or more elements in the element management interface of any page in the page object library, click the mobile element button, and input a page identifier of a target mobile page, namely a new page. The electronic equipment determines a target mobile element according to the selection operation for the target mobile element and the clicking operation of a mobile element button; receiving an input page identifier and determining a target mobile page; and changing the parent node of the page to which the target element belongs into the parent node corresponding to the target mobile page, and displaying the prompt information of successful movement of the target mobile element.
Example 5:
in order to determine the target grabbing page, on the basis of the above embodiments, in this embodiment of the present application, the receiving information of the input target grabbing page, determining the target grabbing page includes:
receiving an input page identification of a target grabbing page, and determining a target grabbing page corresponding to the page identification in a pre-stored page object library; or (b)
And receiving the input website of the target grabbing page, and determining the target grabbing page according to the website.
The target grabbing page can be a page in a pre-stored page object library or other acquirable pages. Therefore, in the step of determining the target grabbing page, the page identifier of the input target grabbing page can be received, and the target grabbing page corresponding to the input page identifier is determined in the pre-stored page object library. Or receiving the input website of the target grabbing page, and determining the target grabbing page according to the website.
In the embodiment of the application, the target grabbing page corresponding to the page identifier can be determined in a pre-stored page object library by receiving the input page identifier, or the target grabbing page can be determined according to the website by receiving the input website.
In a possible implementation manner, a current display page of other electronic devices such as a mobile phone or a tablet computer can be obtained through hardware connection or software screen projection, and the current display page is determined to be a target grabbing page.
Example 6:
in order to further improve accuracy of page testing, in the embodiments of the present application, the obtaining test elements included in the test page and standard elements included in the reference page includes:
extracting all test elements contained in the test page and all standard elements contained in the reference page; or (b)
Extracting and displaying test element attributes of all test elements contained in the test page, and determining the test elements in response to a test element selection operation aiming at the target test element attributes; and displaying the reference page, and determining standard elements in response to a selection operation for the standard elements contained in the reference page.
In order to further improve the accuracy of the page test, in the embodiment of the present application, when the test elements included in the test page and the standard elements included in the reference page are obtained, the user may directly extract all the test elements included in the test page and all the standard elements included in the reference page as required, so as to ensure the integrity of the page test.
When the test elements contained in the test page and the standard elements contained in the reference page are acquired, the designated test elements and standard elements can be acquired as required. The electronic equipment extracts and displays the test element attributes of all the test elements contained in the test page, and a user can select the test elements with the target test element attributes according to the requirements. The electronic device determines the test element in response to a selection operation of the test element for the target test element attribute. The electronic device can also display a reference page, and a user can select standard elements contained in the reference page according to the needs. The electronic device determines standard elements in response to a selection operation for the standard elements contained in the reference page.
In the embodiment of the present application, when the test elements included in the test page and the standard elements included in the reference page are acquired, all the test elements included in the test page and all the standard elements included in the reference page may be directly extracted, or the specified test elements and standard elements may be acquired as required.
Example 7:
based on the same technical conception, the embodiment of the application provides a page testing device. Fig. 3 is a schematic structural diagram of a page testing apparatus according to an embodiment of the present application. As shown in fig. 3, the apparatus includes:
the determining module 301 is configured to receive a page identifier of an input reference page, and determine a reference page corresponding to the page identifier in a pre-stored page object library;
an obtaining module 302, configured to obtain a test element included in a test page and a standard element included in the reference page;
and the judging module 303 is configured to judge whether the element attributes of the test element and the standard element are matched one by one, and if not, determine that the test page test fails.
In a possible implementation manner, the determining module 303 is specifically configured to determine whether the test element matches with the element identifier, the element XPath value, the element icon, and the element description of the standard element in a one-to-one correspondence manner.
In one possible embodiment, the apparatus further comprises:
the generation module is used for receiving the input page identification of the new page; if the fact that the page with the page identifier does not exist in the page object library is determined, generating the page with the page identifier and storing the page to the page object library;
the adding module is used for responding to the operation of adding the elements to the page identified by the page and obtaining element icons and element XPath values of the elements to be added; and adding the element icon to the corresponding position of the page identifier according to the position information in the element XPath value and storing the element icon.
In a possible implementation manner, the adding module is specifically configured to receive an input element icon and an element XPath value of an element to be added; or receiving input information of a target grabbing page, and determining the target grabbing page; and determining the element attribute of the target element in the target crawling page in response to the crawling operation for the target element in the target crawling page, and extracting the element icon and the element XPath value in the element attribute.
In a possible implementation manner, the adding module is specifically configured to receive a page identifier of an input target crawling page, and determine, in a pre-stored page object library, a target crawling page corresponding to the page identifier; or (b)
And receiving the input website of the target grabbing page, and determining the target grabbing page according to the website.
In a possible implementation manner, the obtaining module 302 is specifically configured to extract all test elements included in the test page and all standard elements included in the reference page; or extracting and displaying the test element attributes of all the test elements contained in the test page, and determining the test elements in response to the selection operation of the test elements aiming at the target test element attributes; and displaying the reference page, and determining standard elements in response to a selection operation for the standard elements contained in the reference page.
Example 8:
based on the same technical concept, the embodiment of the present application provides an electronic device, and fig. 4 is a schematic structural diagram of the electronic device provided in the embodiment of the present application, as shown in fig. 4, where the electronic device includes: the processor 401, the communication interface 402, the memory 403 and the communication bus 404, wherein the processor 401, the communication interface 402 and the memory 403 complete communication with each other through the communication bus 404;
the memory 403 has stored therein a computer program which, when executed by the processor 401, causes the processor 401 to perform the steps of:
receiving an input page identifier of a reference page, and determining a reference page corresponding to the page identifier in a pre-stored page object library;
acquiring test elements contained in a test page and standard elements contained in the reference page;
judging whether the element attributes of the test element and the standard element are matched one by one, if not, determining that the test page test fails.
In a possible implementation, the processor 401 is further configured to:
and judging whether the test element is matched with the element identification, the element XPath value, the element icon and the element description of the standard element in a one-to-one correspondence manner.
In a possible implementation, the processor 401 is further configured to:
receiving an input page identifier of the newly built page; if the fact that the page with the page identifier does not exist in the page object library is determined, generating the page with the page identifier and storing the page to the page object library;
responding to an element adding operation aiming at the page of the page identifier, and acquiring an element icon and an element XPath value of an element to be added; and adding the element icon to the corresponding position of the page identifier according to the position information in the element XPath value and storing the element icon.
In a possible implementation, the processor 401 is further configured to:
receiving an input element icon and an element XPath value of an element to be added; or (b)
Receiving input information of a target grabbing page, and determining the target grabbing page; and determining the element attribute of the target element in the target crawling page in response to the crawling operation for the target element in the target crawling page, and extracting the element icon and the element XPath value in the element attribute.
In a possible implementation, the processor 401 is further configured to:
receiving an input page identification of a target grabbing page, and determining a target grabbing page corresponding to the page identification in a pre-stored page object library; or (b)
And receiving the input website of the target grabbing page, and determining the target grabbing page according to the website.
In a possible implementation, the processor 401 is further configured to:
extracting all test elements contained in the test page and all standard elements contained in the reference page; or (b)
Extracting and displaying test element attributes of all test elements contained in the test page, and determining the test elements in response to a test element selection operation aiming at the target test element attributes; and displaying the reference page, and determining standard elements in response to a selection operation for the standard elements contained in the reference page.
Because the principle of the electronic device for solving the problem is similar to that of the page test method, the implementation of the electronic device can be referred to the implementation of the method, and the repetition is omitted.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 402 is used for communication between the electronic device and other devices described above.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; but also digital instruction processors (Digital Signal Processing, DSP), application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
Example 9:
based on the same technical idea, the embodiments of the present application provide a computer readable storage medium, in which a computer program executable by an electronic device is stored, which when executed on the electronic device, causes the electronic device to perform the following steps:
receiving an input page identifier of a reference page, and determining a reference page corresponding to the page identifier in a pre-stored page object library;
acquiring test elements contained in a test page and standard elements contained in the reference page;
judging whether the element attributes of the test element and the standard element are matched one by one, if not, determining that the test page test fails.
In one possible implementation, the element attributes include: at least one of an element identification, an element path language XPath value, an element icon, and an element description;
if the element attribute includes: the judging whether the element attributes of the test element and the standard element are matched one by one comprises the following steps:
and judging whether the test element is matched with the element identification, the element XPath value, the element icon and the element description of the standard element in a one-to-one correspondence manner.
In one possible implementation manner, the method for generating the test page includes:
receiving an input page identifier of a new page; if the fact that the page with the page identifier does not exist in the page object library is determined, generating the page with the page identifier and storing the page to the page object library;
responding to an element adding operation aiming at the page of the page identifier, and acquiring an element icon and an element XPath value of an element to be added; and adding the element icon to the corresponding position of the page identifier according to the position information in the element XPath value and storing the element icon.
In one possible implementation manner, the obtaining, in response to the operation of adding the element to the page identified by the page, the element icon and the element XPath value of the element to be added includes:
receiving an input element icon and an element XPath value of an element to be added; or (b)
Receiving input information of a target grabbing page, and determining the target grabbing page; and determining the element attribute of the target element in the target crawling page in response to the crawling operation for the target element in the target crawling page, and extracting the element icon and the element XPath value in the element attribute.
In one possible implementation manner, the receiving the input information of the target grabbing page, and determining the target grabbing page includes:
receiving an input page identification of a target grabbing page, and determining a target grabbing page corresponding to the page identification in a pre-stored page object library; or (b)
And receiving the input website of the target grabbing page, and determining the target grabbing page according to the website.
In one possible implementation manner, the acquiring the test element included in the test page and the standard element included in the reference page includes:
extracting all test elements contained in the test page and all standard elements contained in the reference page; or (b)
Extracting and displaying test element attributes of all test elements contained in the test page, and determining the test elements in response to a test element selection operation aiming at the target test element attributes; and displaying the reference page, and determining standard elements in response to a selection operation for the standard elements contained in the reference page.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memories such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical memories such as CD, DVD, BD, HVD, etc., and semiconductor memories such as ROM, EPROM, EEPROM, nonvolatile memories (NAND FLASH), solid State Disks (SSD), etc.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (10)

1. A method of testing a page, the method comprising:
receiving an input page identifier of a reference page, and determining a reference page corresponding to the page identifier in a pre-stored page object library;
acquiring test elements contained in a test page and standard elements contained in the reference page;
judging whether the element attributes of the test element and the standard element are matched one by one, if not, determining that the test page test fails.
2. The method of claim 1, wherein the element attributes comprise: at least one of an element identification, an element path language XPath value, an element icon, and an element description;
if the element attribute includes: the judging whether the element attributes of the test element and the standard element are matched one by one comprises the following steps:
and judging whether the test element is matched with the element identification, the element XPath value, the element icon and the element description of the standard element in a one-to-one correspondence manner.
3. The method according to claim 1, wherein the method for generating the test page comprises:
receiving an input page identifier of a new page; if the fact that the page with the page identifier does not exist in the page object library is determined, generating the page with the page identifier and storing the page to the page object library;
responding to an element adding operation aiming at the page of the page identifier, and acquiring an element icon and an element XPath value of an element to be added; and adding the element icon to the corresponding position of the page identifier according to the position information in the element XPath value and storing the element icon.
4. The method of claim 3, wherein the obtaining the element icon and the element XPath value of the element to be added in response to the add element operation for the page identified by the page comprises:
receiving an input element icon and an element XPath value of an element to be added; or (b)
Receiving input information of a target grabbing page, and determining the target grabbing page; and determining the element attribute of the target element in the target crawling page in response to the crawling operation for the target element in the target crawling page, and extracting the element icon and the element XPath value in the element attribute.
5. The method of claim 4, wherein receiving information of the input target crawling page, determining the target crawling page comprises:
receiving an input page identification of a target grabbing page, and determining a target grabbing page corresponding to the page identification in a pre-stored page object library; or (b)
And receiving the input website of the target grabbing page, and determining the target grabbing page according to the website.
6. The method of claim 1, wherein the obtaining test elements contained in the test page and standard elements contained in the reference page comprises:
extracting all test elements contained in the test page and all standard elements contained in the reference page; or (b)
Extracting and displaying test element attributes of all test elements contained in the test page, and determining the test elements in response to a test element selection operation aiming at the target test element attributes; and displaying the reference page, and determining standard elements in response to a selection operation for the standard elements contained in the reference page.
7. A page testing apparatus, the apparatus comprising:
the determining module is used for receiving the page identification of the input reference page and determining the reference page corresponding to the page identification in a pre-stored page object library;
the acquisition module is used for acquiring test elements contained in the test page and standard elements contained in the reference page;
and the judging module is used for judging whether the element attributes of the test element and the standard element are matched one by one, and if not, determining that the test page test fails.
8. The apparatus of claim 7, wherein the apparatus further comprises:
the generation module is used for receiving the input page identification of the new page; if the fact that the page with the page identifier does not exist in the page object library is determined, generating the page with the page identifier and storing the page to the page object library;
the adding module is used for responding to the operation of adding the elements to the page identified by the page and obtaining element icons and element XPath values of the elements to be added; and adding the element icon to the corresponding position of the page identifier according to the position information in the element XPath value and storing the element icon.
9. An electronic device comprising at least a processor and a memory, the processor being adapted to implement the steps of the page testing method according to any of claims 1-6 when executing a computer program stored in the memory.
10. A computer readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the steps of the page testing method according to any of claims 1-6.
CN202310073176.9A 2023-02-03 2023-02-03 Page test method, device, equipment and medium Pending CN116431467A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310073176.9A CN116431467A (en) 2023-02-03 2023-02-03 Page test method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310073176.9A CN116431467A (en) 2023-02-03 2023-02-03 Page test method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN116431467A true CN116431467A (en) 2023-07-14

Family

ID=87080348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310073176.9A Pending CN116431467A (en) 2023-02-03 2023-02-03 Page test method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN116431467A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407888A (en) * 2023-12-14 2024-01-16 远江盛邦(北京)网络安全科技股份有限公司 Single-page application program page fuzzy test method and device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117407888A (en) * 2023-12-14 2024-01-16 远江盛邦(北京)网络安全科技股份有限公司 Single-page application program page fuzzy test method and device and electronic equipment
CN117407888B (en) * 2023-12-14 2024-03-15 远江盛邦(北京)网络安全科技股份有限公司 Single-page application program page fuzzy test method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN109871326B (en) Script recording method and device
CN111881019B (en) User interface testing method and device
CN112270149B (en) Verification platform automatic integration method and system, electronic equipment and storage medium
CN108319460B (en) Method and device for generating application program installation package, electronic equipment and storage medium
CN110955428A (en) Page display method and device, electronic equipment and medium
CN109669873B (en) User interface automatic test method and device, electronic equipment and storage medium
WO2013122876A1 (en) Code coverage rate determination method and system
CN109241026B (en) Data management method, device and system
CN109614325B (en) Method and device for determining control attribute, electronic equipment and storage medium
CN110990274A (en) Data processing method, device and system for generating test case
CN110879781A (en) Program debugging method and device, electronic equipment and computer readable storage medium
CN116431467A (en) Page test method, device, equipment and medium
CN111563032A (en) APP debugging method and device, computer equipment and storage medium
CN112486828A (en) Test case generation method and device, computer equipment and storage medium
US20140082582A1 (en) Resource Tracker
EP2951680B1 (en) Acquiring identification of an application lifecycle management entity associated with similar code
CN107038117B (en) Web automatic testing method based on definition-reference between event processing functions
CN110688173B (en) Positioning method and device of components in cross-platform interface framework and electronic equipment
CN117215558A (en) Visual software development method, device, equipment and medium for android
CN109474822B (en) Android television multi-language automatic testing method and device
CN108037914B (en) Method and device for developing android native system by combining js
CN109815127A (en) Automatized script conversion method, device, computer equipment and storage medium
CN113360366A (en) Web page testing method, testing device, electronic equipment and storage medium
CN110704742B (en) Feature extraction method and device
CN112559346A (en) Service testing method and device

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