CN117493207A - Page processing method, device, electronic equipment and storage medium - Google Patents
Page processing method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117493207A CN117493207A CN202311566837.8A CN202311566837A CN117493207A CN 117493207 A CN117493207 A CN 117493207A CN 202311566837 A CN202311566837 A CN 202311566837A CN 117493207 A CN117493207 A CN 117493207A
- Authority
- CN
- China
- Prior art keywords
- control
- detection result
- abnormal
- detection
- prompt information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title abstract description 23
- 238000001514 detection method Methods 0.000 claims abstract description 271
- 230000002159 abnormal effect Effects 0.000 claims abstract description 109
- 230000005856 abnormality Effects 0.000 claims abstract description 32
- 238000012545 processing Methods 0.000 claims abstract description 18
- 230000004044 response Effects 0.000 claims abstract description 13
- 238000000034 method Methods 0.000 claims description 32
- 238000004590 computer program Methods 0.000 claims description 19
- 238000012512 characterization method Methods 0.000 abstract description 13
- 238000005516 engineering process Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 10
- 230000015654 memory Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 6
- BUGBHKTXTAQXES-UHFFFAOYSA-N Selenium Chemical compound [Se] BUGBHKTXTAQXES-UHFFFAOYSA-N 0.000 description 5
- 229910052711 selenium Inorganic materials 0.000 description 5
- 239000011669 selenium Substances 0.000 description 5
- 238000012360 testing method Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 3
- 230000014509 gene expression Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 235000014510 cooky Nutrition 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The disclosure provides a page processing method, which can be applied to the technical fields of computers and financial science and technology. The page processing method comprises the following steps: detecting a control in a page according to a first detection instruction to obtain a first detection result; generating abnormal prompt information under the condition that the first detection result characterization control is determined to be abnormal; generating a second detection instruction in response to receiving a first input by a user according to the abnormality prompt information; and detecting the control in the page according to the second detection instruction to obtain a second detection result, wherein the second detection result characterizes the control as normal. The disclosure also provides a page processing apparatus, an electronic device, a storage medium, and a program product.
Description
Technical Field
The present disclosure relates to the technical field of computers and financial science and technology, and in particular, to a page processing method, apparatus, electronic device, storage medium, and program product.
Background
The page is typically subjected to various tests before it is put into use. Selenium is a tool for Web application testing. The test of Selenium runs directly in the browser as if the real user were operating. The main functions of Selenium include: the compatibility between the page and the browser is tested, i.e. whether the page can work well on different browsers and operating systems.
In the process of implementing the disclosed concept, the inventor finds that at least the following problems exist in the related art: the detection method for the page in the related art has low efficiency.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a page processing method, apparatus, electronic device, storage medium, and program product.
In a first aspect of the present disclosure, there is provided a page processing method, including:
detecting a control in a page according to a first detection instruction to obtain a first detection result;
generating abnormal prompt information under the condition that the first detection result is determined to represent that the control is abnormal;
generating a second detection instruction in response to receiving a first input by a user according to the abnormality prompt information;
and detecting the control in the page according to the second detection instruction to obtain a second detection result, wherein the second detection result represents that the control is normal.
According to an embodiment of the present disclosure, detecting the control in the page according to the second detection instruction to obtain a second detection result includes:
detecting the control in the page according to the second detection instruction to obtain an ith intermediate detection result, wherein i is an integer greater than 0;
Generating an ith intermediate abnormality prompt message under the condition that the ith intermediate detection result is determined to represent that the control is abnormal;
generating an ith intermediate detection instruction in response to receiving an ith intermediate input by a user according to the ith intermediate abnormality prompt information;
detecting the control in the page according to the ith intermediate detection instruction to obtain an ith+1 intermediate detection result, wherein i=i+1;
and under the condition that the ith intermediate detection result is determined to represent that the control is normal, obtaining the second detection result.
According to an embodiment of the present disclosure, when it is determined that the first detection result indicates that the control is abnormal, generating abnormality prompting information includes:
and under the condition that the first detection result is determined to represent that the control is abnormal, generating abnormal prompt information according to the control attribute related to the control.
According to an embodiment of the disclosure, the abnormal prompt information includes control attribute prompt information related to the control attribute;
wherein the generating a second detection instruction in response to receiving a first input by a user according to the abnormality prompt information includes:
Displaying the control attribute prompt information in a display interface;
receiving the first input related to the control attribute prompt information, which is performed by a user on the display interface;
determining a control attribute value related to the control attribute according to the first input;
and generating the second detection instruction according to the control attribute value.
According to an embodiment of the present disclosure, the first detection result includes a query detection result and a click detection result;
the detecting the control in the page according to the first detection instruction to obtain a first detection result includes:
inquiring and detecting the control in the page according to the first detection instruction to obtain an inquiring and detecting result;
under the condition that the query detection result is determined to indicate that the control is not queried, determining that the first detection result indicates that the control is abnormal;
under the condition that the query detection result is determined to represent that the control is queried, clicking detection is carried out on the control to obtain a clicking detection result;
under the condition that the click detection result is determined to represent that the control is normal in clicking, the first detection result is determined to represent that the control is normal;
And under the condition that the click detection result is determined to represent that the control is abnormal in clicking, determining that the first detection result represents that the control is abnormal.
According to the embodiment of the disclosure, under the condition that the query detection result is determined to indicate that the control is not queried, determining that the abnormal type of the control is a query abnormal type;
wherein, when determining that the first detection result characterizes the control as abnormal, generating abnormal prompt information, and further comprising:
determining the abnormal type of the control under the condition that the first detection result is determined to represent that the control is abnormal;
and generating the abnormality prompt information under the condition that the abnormality type of the control is determined to be the query abnormality type.
According to an embodiment of the present disclosure, the control attributes include at least one of a control identifier, a control location, a control cascading style sheet, and a control name.
A second aspect of the present disclosure provides a page processing apparatus, including:
the first obtaining module is used for detecting the control in the page according to the first detection instruction to obtain a first detection result;
the first generation module is used for generating abnormal prompt information under the condition that the first detection result is determined to represent that the control is abnormal;
The second generation module is used for responding to the received first input of the user according to the abnormal prompt information and generating a second detection instruction;
the second obtaining module is configured to detect the control in the page according to the second detection instruction to obtain a second detection result, where the second detection result characterizes that the control is normal.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a storage device for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the page processing method.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described page processing method.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above page processing method.
According to the page processing method, the page processing device, the electronic equipment, the storage medium and the program product, the control in the page is detected according to the first detection instruction, and a first detection result is obtained; generating abnormal prompt information under the condition that the first detection result characterization control is determined to be abnormal; generating a second detection instruction in response to receiving a first input by a user according to the abnormality prompt information; and detecting the control in the page according to the second detection instruction to obtain a second detection result. The user can carry out first input according to the abnormal prompt information to generate a second detection instruction, the control is detected according to the second detection instruction, the second detection instruction with the normal control is obtained, the user does not need to find out a problem to exit when detecting the control, the first input can be directly carried out according to the abnormal prompt information to generate the second detection instruction, the increase of detection time caused by repeated detection is avoided, and the page detection is promoted.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario diagram of a page processing method, apparatus, electronic device, storage medium, and program product according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a page processing method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a flow chart of yet another page processing method in accordance with an embodiment of the present disclosure;
FIG. 4 schematically shows a block diagram of a page processing apparatus according to an embodiment of the present disclosure; and
fig. 5 schematically illustrates a block diagram of an electronic device adapted to implement a page detection method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the invention, the related user information (including but not limited to user personal information, user image information, user equipment information, such as position information and the like) and data (including but not limited to data for analysis, stored data, displayed data and the like) are information and data authorized by a user or fully authorized by all parties, and the processing of the related data such as collection, storage, use, processing, transmission, provision, disclosure, application and the like are all conducted according to the related laws and regulations and standards of related countries and regions, necessary security measures are adopted, no prejudice to the public welfare is provided, and corresponding operation inlets are provided for the user to select authorization or rejection.
In the related art, webdriver is an automatic test tool for Web applications. WebDriver provides a number of functions and settings for interacting with a browser, through which interaction with browser windows, warnings, frames, popup windows, etc. can be accomplished. Meanwhile, the WebDriver also provides the characteristics of convenient testing such as automatically operating a browser navigation bar, setting cookies, capturing a screen and the like. Thus, the Selenium can drive the browser through WebDriver.
WebDriver commonly used functions and methods may include finding a single element (find_elements), finding multiple elements (find_elements), browser back, browser forward, browser close, and so on. While UI automation mostly operates WebElement, interaction with web page elements, including text boxes, text fields, buttons, radio boxes, multiple boxes, tables, rows, columns, divs, etc., can be achieved through WebElement operations. Methods and functions commonly used by WebElement may include: button click operations, button submissions, text box inputs, obtaining text, checking whether an element is available, and so forth.
The debug script of Selenium writes the controls and operation types in code or configuration files. After the script is started, the browser can be driven to execute according to the script, if the error is reported when the element positioning is not completed, the program can be exited, the user needs to adjust the positioning element and the operation type, and the script is executed again to verify the correctness of the program. If the positioning mode and the value are correct, the script can be smoothly performed. However, the element positioning and driving operation is a relatively complex work, the positioning of some elements needs to be debugged many times, and the automation script needs to be executed for a long time, so that if the element positioning is not achieved every time or the operation method does not need to be re-executed when the program is required to be exited, the time is very long.
In view of this, an embodiment of the present disclosure provides a method for processing a page, including detecting a control in the page according to a first detection instruction to obtain a first detection result; generating abnormal prompt information under the condition that the first detection result characterization control is determined to be abnormal; generating a second detection instruction in response to receiving a first input by a user according to the abnormality prompt information; and detecting the control in the page according to the second detection instruction to obtain a second detection result, wherein the second detection result characterizes the control as normal.
Fig. 1 schematically illustrates an application scenario diagram of a page processing method, an apparatus, an electronic device, a storage medium and a program product according to an embodiment of the present disclosure.
As shown in fig. 1, an application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium used to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the first terminal device 101, the second terminal device 102, the third terminal device 103, to receive or send messages etc. Various communication client applications, such as a shopping class application, a web browser application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only) may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102, the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the page processing method provided in the embodiments of the present disclosure may be generally performed by the server 105. Accordingly, the page processing apparatus provided in the embodiments of the present disclosure may be generally disposed in the server 105. The page processing method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105. Accordingly, the page processing apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The page processing method of the disclosed embodiment will be described in detail below with reference to fig. 2 to 5 based on the scenario described in fig. 1.
Fig. 2 schematically shows a flow chart of a page processing method according to an embodiment of the present disclosure.
As shown in fig. 2, the page processing method of this embodiment includes operations S210 to S240.
In operation S210, the control in the page is detected according to the first detection instruction, so as to obtain a first detection result.
According to an embodiment of the present disclosure, the first detection instruction may be an instruction for detecting a control in a page. The first detection instruction can detect whether a control exists in the page or not, and can also detect whether the control can be controlled or not.
According to embodiments of the present disclosure, the page may be a page of a browser, and the controls in the page may be text boxes, text fields, buttons, radio boxes, multiple boxes, tables, rows, columns, and the like in the page.
According to an embodiment of the disclosure, the plurality of controls may be included, and the first detection result may be obtained when detection of all of the plurality of controls is completed, or may be obtained when detection of a part of the plurality of controls is completed. The control may be an element (i.e., webElement).
In operation S220, in the case where it is determined that the first detection result characterizes the control as abnormal, abnormal prompt information is generated.
According to the embodiment of the disclosure, when the first detection result characterizes that the control is abnormal, that is, detection of the control is problematic, abnormal prompt information can be generated. The first detection result characterizes the abnormal condition of the control, which may be caused by the problem in the first detection instruction.
According to an embodiment of the present disclosure, the abnormality prompt information may be information for prompting the user that the control is abnormal.
In operation S230, a second detection instruction is generated in response to receiving a first input by the user according to the abnormality notification.
According to the embodiment of the disclosure, the abnormal prompt information may include information for modifying a first detection instruction detected by the control, the user may perform a first input for modifying the first detection instruction according to the abnormal prompt information, and the terminal device or the server generates a second detection instruction according to the first input when receiving the first input.
In operation S240, the control in the page is detected according to the second detection instruction, so as to obtain a second detection result, where the second detection result characterizes that the control is normal.
According to an embodiment of the disclosure, the second detection instruction may be an instruction to detect a control in the page. The second detection instruction can detect whether a control exists in the page or not, and can also detect whether the control can be controlled or not.
According to embodiments of the present disclosure, the second detection instruction may be a correct instruction, or may be an instruction that detects more items than the first detection instruction.
According to the embodiment of the disclosure, since the abnormal prompt information is generated under the condition that the first detection result characterizes the control as abnormal, the user can perform first input according to the abnormal prompt information to generate the second detection instruction, the control is detected according to the second detection instruction to obtain the second detection instruction with the normal control, the user does not need to find out a problem during detection of the control, the first input can be directly performed according to the abnormal prompt information to generate the second detection instruction, the increase of detection time caused by repeated detection is avoided, and the efficiency of detecting the page is improved.
According to an embodiment of the present disclosure, generating an anomaly prompt message in a case where it is determined that the first detection result characterizes the control as being anomaly, includes:
and under the condition that the first detection result characterizes the control as abnormal, generating abnormal prompt information according to the control attribute related to the control.
According to embodiments of the present disclosure, a control attribute may be a property of a control. For example, the size, shape, position, etc.
According to embodiments of the present disclosure, the control attributes may include at least one of a control identification, a control location, a control cascading style sheet (Cascading Style Sheets, CSS), and a control name.
According to embodiments of the present disclosure, the control identification may be an identification for uniquely identifying the control; the control position can be an xpath document query language and can be used for identifying the position of the control in the page; the control cascading style sheet may be a style of a control; the control name may be the name of the control.
According to the embodiment of the disclosure, when the first detection result characterization control is determined to be abnormal, abnormal prompt information can be generated, so that a user modifies the first detection instruction according to the abnormal prompt information.
According to an embodiment of the disclosure, the anomaly prompt may be a control attribute associated with the control, and the first input by the user may be an attribute value of the control.
According to the embodiment of the disclosure, the abnormal prompt information is generated according to the control attribute, so that the user can be provided with a plurality of control attributes for the first detection instruction, and the control can be found more accurately.
According to an embodiment of the present disclosure, the anomaly prompt includes control attribute prompt information related to a control attribute.
Wherein, responding to the first input of the user according to the abnormal prompt information, generating a second detection instruction comprises the following steps:
Displaying control attribute prompt information in a display interface;
receiving a first input related to control attribute prompt information, which is performed by a user on a display interface;
determining a control attribute value related to the control attribute according to the first input;
and generating a second detection instruction according to the control attribute value.
According to the embodiment of the disclosure, control attribute prompt information can be displayed in a display interface. For example, "please input the control position of the control" is displayed in the display interface.
According to the embodiment of the disclosure, a user can perform first input according to control attribute prompt information on a display interface. For example, the first input may be "control position is upper left".
According to embodiments of the present disclosure, the first input information may be parsed to determine control attribute values associated with the control attributes. For example, a control attribute value for which the control attribute is "control position" may be determined to be "upper left".
According to the embodiment of the present disclosure, for example, the control flag of the control is "button1", and the control flag input in the first detection instruction is "button11", so that the first detection result may be that the characterization control is abnormal, the "please input the control flag" may also be displayed in the display interface, and the first input may be "button1", so that it may be determined that the control attribute value of the control attribute of "control flag" is "button1".
According to embodiments of the present disclosure, a second detection instruction may be generated from the control attribute value.
According to the embodiment of the disclosure, the control attribute prompt information is displayed in the display interface, so that a user can know the input content more clearly, the first input can be obtained conveniently and quickly, and the detection efficiency is improved.
Fig. 3 schematically shows a flow chart of a further page processing method according to an embodiment of the disclosure.
As shown in fig. 3, the page processing method of this embodiment includes operations S310 to S360.
In operation S310, detecting the control in the page according to the second detection instruction to obtain an ith intermediate detection result, where i is an integer greater than 0;
in operation S320, determining whether the ith intermediate detection result characterizes the control as normal; if it is determined that the i-th intermediate detection result characterization control is normal, operation S360 is performed, and if it is determined that the i-th intermediate detection result characterization control is abnormal, operation S330 is performed.
In operation S330, the i-th intermediate abnormality notification is generated.
In operation S340, an i-th intermediate detection instruction is generated in response to receiving an i-th intermediate input by the user according to the i-th intermediate abnormality notification.
In operation S350, the control in the page is detected according to the ith intermediate detection instruction, so as to obtain an ith+1th intermediate detection result, let i=i+1, and operation S320 is executed.
In operation S360, if it is determined that the ith intermediate detection result representation control is normal, a second detection result is obtained.
According to the embodiment of the disclosure, under the condition that the control in the page is detected according to the second detection instruction, an ith intermediate detection result can be obtained.
According to the embodiment of the disclosure, when the ith intermediate detection result characterizes that the control is abnormal, that is, detection of the control is problematic, the ith intermediate abnormality prompt information can be generated. And under the condition that the ith intermediate detection result represents that the control is abnormal, taking the ith intermediate detection result as a second detection result, thereby obtaining the second detection result.
According to the embodiment of the disclosure, a user can generate an ith intermediate detection instruction according to the ith intermediate input performed by the ith intermediate abnormal prompt information, and the specific reference can be made to the display of control attribute prompt information in a display interface in the embodiment of the disclosure; receiving a first input related to control attribute prompt information, which is performed by a user on a display interface; determining a control attribute value related to the control attribute according to the first input; and generating a description of the second detection instruction according to the control attribute value, which is not described herein. And obtaining a second detection result until the ith intermediate detection result of the control represents that the control is normal.
According to the embodiment of the disclosure, when the ith intermediate detection result of the control is abnormal, debugging can be performed on the display interface until the ith intermediate detection result is normal, so that the process of exiting the detection program to the detection program when the control is detected to be abnormal is omitted, and the embodiment of the disclosure can directly debug the detection instruction in the detection process, thereby reducing the detection time and improving the detection efficiency.
According to an embodiment of the disclosure, the first detection result includes a query detection result and a click detection result;
detecting the control in the page according to the first detection instruction to obtain a first detection result, wherein the method comprises the following steps:
inquiring and detecting the control in the page according to the first detection instruction to obtain an inquiring and detecting result;
under the condition that the query detection result characterization control is not queried, determining that the first detection result characterization control is abnormal;
under the condition that the query detection result is confirmed to represent that the control is queried, clicking detection is carried out on the control to obtain a clicking detection result;
under the condition that the click detection result is determined to represent that the control is normal in clicking, determining that the first detection result represents that the control is normal;
And under the condition that the click detection result is determined to represent that the control is abnormal in clicking, determining that the first detection result represents that the control is abnormal.
According to the embodiment of the disclosure, the detection of the control in the page can be divided into two steps, wherein the first step is to inquire whether the control exists in the page, and the second step is to click the control to determine whether the control can be interacted normally.
According to the embodiment of the disclosure, query detection can be performed on the controls in the page according to the first detection instruction, and a query detection result is obtained.
According to the embodiment of the disclosure, the query detection result may represent whether the first detection instruction is correct or not, and may represent that the first detection instruction is correct when the control is queried, and may represent that the first detection instruction is incorrect when the control is queried, and may generate the abnormal prompt information.
According to the embodiment of the disclosure, in the case that the control is not queried, the control itself has a problem, so that the control cannot be queried.
According to the embodiment of the disclosure, in the case that the query detection result Bai E is being queried, click detection can be performed on the control to obtain a click detection result.
According to the embodiment of the disclosure, the clicking detection result can represent whether the first detection instruction is correct or not, and can represent that the first detection instruction is correct under the condition that the clicking control is not abnormal, and can represent that the first detection instruction is incorrect under the condition that the clicking control is abnormal, and can generate abnormal prompt information.
According to the embodiment of the disclosure, in the case that the clicking control is abnormal, the control itself can be problematic, so that the clicking of the control is abnormal.
According to the embodiment of the disclosure, under the condition that the query detection result is determined to represent that the control is not queried, determining that the abnormal type of the control is a query abnormal type;
under the condition that the first detection result characterization control is determined to be abnormal, generating abnormal prompt information further comprises:
under the condition that the first detection result is determined to represent that the control is abnormal, determining the abnormal type of the control;
and generating abnormal prompt information under the condition that the abnormal type of the control is determined to be the query abnormal type.
According to the embodiment of the disclosure, since query detection and click detection exist on the detection of the control, the user can make the first input in the case that the query detection has an abnormality, and therefore, the abnormality type characterized by the first detection result needs to be determined.
According to the embodiment of the disclosure, in the case that the abnormal type of the control is determined to be the query abnormal type, abnormal prompt information is generated.
According to the embodiment of the disclosure, when the click detection result is determined to represent that the control is abnormal in clicking, the abnormal type of the control is determined to be the abnormal type of clicking.
According to the embodiment of the disclosure, in the case that the abnormal type of the control is determined to be the click abnormal type, the existence of the control can be characterized, and the detection can be ended.
According to the embodiment of the disclosure, the abnormality prompt information is generated according to the abnormality type, so that the generation of the abnormality prompt information is more detailed.
According to the embodiment of the disclosure, through encapsulation of a method for positioning elements (namely controls), the problem that the elements cannot be found to directly close the browser and exit a program is solved, the new control attribute value can be input by performing first input on a display interface, and debugging can be continuously performed according to instructions. After the debugging code is executed correctly, the driver continues to run the content behind the instruction. After the instruction execution is completed, the correct instruction in the debugging process is updated into the script. Thus, the whole script flow can be successfully debugged once, and the time spent for repeatedly operating the script is greatly reduced. And the packaged positioning element method is called before the common operations such as clicking, inputting characters, selecting and the like are packaged, so that the dynamic debugging after UI automatic error reporting can be realized.
Based on the page processing method, the disclosure further provides a page processing device. The device will be described in detail below in connection with fig. 4.
Fig. 4 schematically shows a block diagram of a structure of a page processing apparatus according to an embodiment of the present disclosure.
As shown in fig. 4, the page processing apparatus 400 of this embodiment includes a first obtaining module 410, a first generating module 420, a second generating module 430, and a second obtaining module 440.
The first obtaining module 410 is configured to detect a control in the page according to the first detection instruction, so as to obtain a first detection result. In an embodiment, the first obtaining module 410 may be used to perform the operation S210 described above, which is not described herein.
The first generating module 420 is configured to generate an anomaly prompt message when it is determined that the first detection result characterizes the control as anomaly. In an embodiment, the first generating module 420 may be used to perform the operation S220 described above, which is not described herein.
The second generating module 430 is configured to generate a second detection instruction in response to receiving a first input by the user according to the abnormality prompt information. In an embodiment, the second generating module 430 may be configured to perform the operation S230 described above, which is not described herein.
And a second obtaining module 440, configured to detect the control in the page according to the second detection instruction, and obtain a second detection result, where the second detection result characterizes that the control is normal. In an embodiment, the second obtaining module 440 may be used to perform the operation S240 described above, which is not described herein.
According to an embodiment of the present disclosure, the second obtaining module 440 configured to detect the control in the page according to the second detection instruction, and obtain the second detection result includes:
the first obtaining unit is used for detecting the control in the page according to the second detection instruction to obtain an ith intermediate detection result, wherein i is an integer greater than 0;
the second obtaining unit is used for generating the ith intermediate abnormality prompt information under the condition that the ith intermediate detection result characterization control is determined to be abnormal;
a third obtaining unit, configured to generate an ith intermediate detection instruction in response to receiving an ith intermediate input by a user according to the ith intermediate abnormality prompt information;
a fourth obtaining unit, configured to detect a control in the page according to the i-1 th intermediate detection instruction, to obtain an i-1 th intermediate detection result, where i=i+1;
and a fifth obtaining unit, configured to obtain a second detection result when it is determined that the ith intermediate detection result represents that the control is normal.
According to an embodiment of the present disclosure, the first generating module 420 configured to generate the abnormality alert information when determining that the first detection result characterizes the control as abnormal includes:
the first generation unit is used for generating abnormal prompt information according to control attributes related to the control under the condition that the first detection result characterizes the control as abnormal.
According to an embodiment of the disclosure, the anomaly prompt information includes control attribute prompt information related to a control attribute;
wherein, the second generating module 430 for generating the second detection instruction in response to receiving the first input by the user according to the abnormality prompt information includes:
the second generation unit is used for displaying control attribute prompt information in the display interface;
the third generation unit is used for receiving a first input related to control attribute prompt information, which is performed by a user on the display interface;
the fourth generation unit is used for determining a control attribute value related to the control attribute according to the first input;
and the fifth generating unit is used for generating a second detection instruction according to the control attribute value.
According to an embodiment of the disclosure, the first detection result includes a query detection result and a click detection result;
The first obtaining module 410, configured to detect the control in the page according to the first detection instruction, and obtain the first detection result includes:
the sixth obtaining unit is used for inquiring and detecting the control in the page according to the first detection instruction to obtain an inquiring and detecting result;
a seventh obtaining unit, configured to determine that the first detection result characterization control is abnormal when it is determined that the query detection result characterization control is not queried;
the eighth obtaining unit is used for carrying out click detection on the control under the condition that the query detection result is determined to represent that the control is queried, so as to obtain a click detection result;
a ninth obtaining unit, configured to determine that the first detection result represents that the control is normal when it is determined that the click detection result represents that the control clicks normally;
and the tenth obtaining unit is used for determining that the first detection result represents that the control is abnormal under the condition that the click detection result represents that the control is abnormal in clicking.
According to the embodiment of the disclosure, under the condition that the query detection result is determined to represent that the control is not queried, determining that the abnormal type of the control is a query abnormal type;
wherein, the first generating module 420 configured to generate the anomaly prompt information when determining that the first detection result characterizes the control as anomaly further includes:
The sixth generation unit is used for determining the abnormal type of the control under the condition that the first detection result characterizes the control as abnormal;
and the seventh generation unit is used for generating the abnormal prompt information under the condition that the abnormal type of the control is the query abnormal type.
According to an embodiment of the present disclosure, the control attributes include at least one of a control identification, a control location, a control cascading style sheet, and a control name.
According to embodiments of the present disclosure, any of the first obtaining module 410, the first generating module 420, the second generating module 430, and the second obtaining module 440 may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the first obtaining module 410, the first generating module 420, the second generating module 430, and the second obtaining module 440 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging the circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, at least one of the first obtaining module 410, the first generating module 420, the second generating module 430, and the second obtaining module 440 may be at least partially implemented as computer program modules, which when executed, may perform the respective functions.
Fig. 5 schematically illustrates a block diagram of an electronic device adapted to implement a page detection method according to an embodiment of the disclosure.
As shown in fig. 5, an electronic device 500 according to an embodiment of the present disclosure includes a processor 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 503. The processor 501 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 501 may also include on-board memory for caching purposes. The processor 501 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 are stored. The processor 501, ROM 502, and RAM 503 are connected to each other by a bus 504. The processor 501 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 502 and/or the RAM 503. Note that the program may be stored in one or more memories other than the ROM 502 and the RAM 503. The processor 501 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the electronic device 500 may also include an input/output (I/O) interface 505, the input/output (I/O) interface 505 also being connected to the bus 504. The electronic device 500 may also include one or more of the following components connected to the I/O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output portion 507 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The drive 510 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as needed so that a computer program read therefrom is mounted into the storage section 508 as needed.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 502 and/or RAM 503 and/or one or more memories other than ROM 502 and RAM 503 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowcharts. The program code, when executed in a computer system, causes the computer system to perform the methods provided by embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 501. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed, and downloaded and installed in the form of a signal on a network medium, and/or installed from a removable medium 511 via the communication portion 509. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 509, and/or installed from the removable media 511. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 501. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.
Claims (11)
1. A method of page processing, comprising:
detecting a control in a page according to a first detection instruction to obtain a first detection result;
Generating abnormal prompt information under the condition that the first detection result represents that the control is abnormal;
generating a second detection instruction in response to receiving a first input by a user according to the abnormality prompt information;
and detecting the control in the page according to the second detection instruction to obtain a second detection result, wherein the second detection result represents that the control is normal.
2. The method of claim 1, wherein the detecting the control in the page according to the second detection instruction, to obtain a second detection result, includes:
detecting the control in the page according to the second detection instruction to obtain an ith intermediate detection result, wherein i is an integer greater than 0;
generating an ith intermediate abnormality prompt message under the condition that the ith intermediate detection result is determined to represent that the control is abnormal;
generating an ith intermediate detection instruction in response to receiving an ith intermediate input by a user according to the ith intermediate abnormality prompt information;
detecting the control in the page according to the ith intermediate detection instruction to obtain an ith+1 intermediate detection result, wherein i=i+1;
And under the condition that the ith intermediate detection result is determined to represent that the control is normal, obtaining the second detection result.
3. The method of claim 1, wherein the generating the anomaly prompt information if the first detection result is determined to characterize the control as anomaly comprises:
and under the condition that the first detection result represents that the control is abnormal, generating abnormal prompt information according to the control attribute related to the control.
4. The method of claim 3, wherein the anomaly prompt includes a control attribute prompt associated with the control attribute;
the responding to the first input of the user according to the abnormal prompt information, generating a second detection instruction, comprises the following steps:
displaying the control attribute prompt information in a display interface;
receiving the first input related to the control attribute prompt information, which is performed by a user on the display interface;
determining a control attribute value related to the control attribute according to the first input;
and generating the second detection instruction according to the control attribute value.
5. The method of any one of claims 2-4, wherein the first detection result comprises a query detection result and a click detection result;
The method for detecting the control in the page according to the first detection instruction, to obtain a first detection result, comprises the following steps:
inquiring and detecting the control in the page according to the first detection instruction to obtain an inquiring and detecting result;
under the condition that the query detection result is determined to indicate that the control is not queried, determining that the first detection result indicates that the control is abnormal;
under the condition that the query detection result is determined to represent that the control is queried, click detection is carried out on the control to obtain a click detection result;
under the condition that the click detection result is determined to represent that the control is normal in clicking, determining that the first detection result represents that the control is normal;
and under the condition that the click detection result is determined to represent that the control is abnormal in clicking, determining that the first detection result represents that the control is abnormal.
6. The method of claim 5, wherein determining that the anomaly type of the control is a query anomaly type if it is determined that the query detection result characterizes the control as not being queried;
wherein, when the first detection result is determined to characterize the control as abnormal, generating abnormal prompt information, and further comprising:
Determining the abnormal type of the control under the condition that the first detection result represents that the control is abnormal;
and generating the abnormality prompt information under the condition that the abnormality type of the control is determined to be the query abnormality type.
7. The method of claim 3 or 4, wherein the control attributes include at least one of a control identification, a control location, a control cascading style sheet, and a control name.
8. A page processing apparatus comprising:
the first obtaining module is used for detecting the control in the page according to the first detection instruction to obtain a first detection result;
the first generation module is used for generating abnormal prompt information under the condition that the first detection result represents that the control is abnormal;
the second generation module is used for responding to the received first input of the user according to the abnormal prompt information and generating a second detection instruction;
and the second obtaining module is used for detecting the control in the page according to the second detection instruction to obtain a second detection result, wherein the second detection result represents that the control is normal.
9. An electronic device, comprising:
One or more processors;
storage means for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-7.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any of claims 1-7.
11. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311566837.8A CN117493207A (en) | 2023-11-22 | 2023-11-22 | Page processing method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311566837.8A CN117493207A (en) | 2023-11-22 | 2023-11-22 | Page processing method, device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117493207A true CN117493207A (en) | 2024-02-02 |
Family
ID=89670666
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311566837.8A Pending CN117493207A (en) | 2023-11-22 | 2023-11-22 | Page processing method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117493207A (en) |
-
2023
- 2023-11-22 CN CN202311566837.8A patent/CN117493207A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9213625B1 (en) | Method and apparatus for performing automated user-interface layout testing | |
CN112463729B (en) | Data file warehousing method and device, electronic equipment and medium | |
CN112817831A (en) | Application performance monitoring method, device, computer system and readable storage medium | |
CN113760729A (en) | Code detection method and device | |
CN113535577B (en) | Application testing method and device based on knowledge graph, electronic equipment and medium | |
CN113918864A (en) | Website page testing method, testing system, testing device, electronic equipment and medium | |
CN113362173A (en) | Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium | |
CN111930629A (en) | Page testing method and device, electronic equipment and storage medium | |
CN113094268B (en) | Test method, test device, test equipment and test medium | |
CN115203178A (en) | Data quality inspection method and device, electronic equipment and storage medium | |
CN113392024B (en) | Method, device, equipment and medium for testing storage process | |
CN114691527A (en) | Unit test case generation method, apparatus, device, medium, and program product | |
CN112506781B (en) | Test monitoring method, device, electronic equipment, storage medium and program product | |
CN117493207A (en) | Page processing method, device, electronic equipment and storage medium | |
CN115499292B (en) | Alarm method, device, equipment and storage medium | |
CN114064484A (en) | Interface testing method and device, electronic equipment and readable storage medium | |
CN116894004A (en) | Information display method and device, electronic equipment and computer readable storage medium | |
CN112948269B (en) | Information processing method, information processing apparatus, electronic device, and readable storage medium | |
CN117435472A (en) | Page test method, device, equipment and medium | |
CN115629983A (en) | Test case set generation method, device, equipment and medium | |
CN117193879A (en) | Pipeline configuration detection method and device for application | |
CN116069312A (en) | Page rendering method and device, electronic equipment and computer readable storage medium | |
CN116467214A (en) | Code quality detection method, device, equipment and storage medium | |
CN117931668A (en) | Interface test management method, device, equipment and medium | |
CN114035788A (en) | Script file generation method, device, equipment 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 |