CN109634857B - Method, device and storage medium for testing page object - Google Patents

Method, device and storage medium for testing page object Download PDF

Info

Publication number
CN109634857B
CN109634857B CN201811479925.3A CN201811479925A CN109634857B CN 109634857 B CN109634857 B CN 109634857B CN 201811479925 A CN201811479925 A CN 201811479925A CN 109634857 B CN109634857 B CN 109634857B
Authority
CN
China
Prior art keywords
page
page object
target
target page
current
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.)
Active
Application number
CN201811479925.3A
Other languages
Chinese (zh)
Other versions
CN109634857A (en
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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201811479925.3A priority Critical patent/CN109634857B/en
Publication of CN109634857A publication Critical patent/CN109634857A/en
Application granted granted Critical
Publication of CN109634857B publication Critical patent/CN109634857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

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 embodiment of the application provides a method, a device and a storage medium for testing page objects, wherein the method comprises the following steps: determining that a target page object with a cycle operation identifier exists in a current page, wherein the cycle operation identifier of the target page object is obtained according to a script of the target page object; executing the target page object on the current page to obtain a next page; and if the target page object does not exist in the next page, stopping executing the target page object. According to the method and the device, when the page object is automatically tested, the page object is tested according to the cyclic operation identifier of the page object and the service logic, the fixed cyclic operation times in the testing process are not limited, so that the target page object does not need to be reset when the service logic is changed, and the efficiency of automatically testing the page object is improved.

Description

Method, device and storage medium for testing page object
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for testing a page object and a storage medium.
Background
For a page object in a page, a loop operation on a certain page object is often involved (for example, for a user to continuously click on the page object, the page object is continuously executed for multiple times); the page object may be, for example, a button or an icon such as "previous step" or "next step".
Currently, in order to realize the recyclable operation of a page object, the number of recyclable operations of the page object is set. In the automatic test process, the page objects of the times are executed according to the times of the circulation operation set by the script.
By the method, once the business logic changes, for example, when the business logic of the page changes from the page object needing to be executed 4 times to the page object needing to be executed 3 times, the number of the loop operations of the page object needs to be reset, so that the efficiency of performing the automatic test on the page object is reduced.
Disclosure of Invention
The embodiment of the application provides a method, a device and a storage medium for testing a page object, and improves the efficiency of automatic testing of the page object.
In a first aspect, an embodiment of the present application provides a method for testing a page object, which is applied to a terminal, and includes:
determining that a target page object with a cycle operation identifier exists in a current page, wherein the cycle operation identifier of the target page object is obtained according to a script of the target page object;
executing the target page object on the current page to obtain a next page;
and if the target page object exists in the next page, executing the target page object on the next page, and if the target page object does not exist in the next page, stopping executing the target page object.
In one possible design, before determining that the target page object with the looping operation identifier exists in the current page, the method further includes:
receiving a page object selection instruction input by a user, wherein the page object selection instruction comprises a page object selected by the user;
setting the page object selected by the user as the target page object, wherein the target page object is provided with the cycle operation identifier.
In one possible design, after setting the user-selected page object as the target page object, the method further includes:
and receiving the circulation times of the target page object set by the user.
In one possible design, the determining that the target page object with the rotation operation identifier exists in the current page includes:
acquiring a page object in a current page, and judging whether the page object has a cycle operation identifier or not;
if yes, determining the page object with the cyclic operation identification as a target page object;
if not, judging whether the next page object in the current page has a cycle operation identifier or not.
In one possible design, after the target page object is executed on the current page to obtain a next page, the method further includes:
if the current page is a page with the target page object appearing for the first time and the target page object does not exist in the next page, outputting abnormal prompt information; alternatively, the first and second electrodes may be,
and if the current page is not the page with the target page object appearing for the first time and the next page does not have the page object, outputting abnormal prompt information.
In a second aspect, an embodiment of the present application provides an apparatus for testing a page object, including:
the determining module is used for determining that a target page object with a cyclic operation identifier exists in a current page, and the cyclic operation identifier of the target page object is obtained according to a script of the target page object;
the execution module is used for executing the target page object on the current page to obtain a next page;
the executing module is further configured to execute the target page object on the next page if the target page object exists in the next page, and stop executing the target page object if the target page object does not exist in the next page.
In one possible design, further comprising: the device comprises a receiving module and a setting module;
the receiving module is used for receiving a page object selection instruction input by a user before the target page object with the cyclic operation identifier exists in the current page, wherein the page object selection instruction comprises a page object selected by the user;
the setting module is configured to set the page object selected by the user as the target page object, where the target page object has the cyclic operation identifier.
In a possible design, the receiving module is further configured to receive a cycle number of the target page object set by a user.
In one possible design, the determining module is specifically configured to:
acquiring a page object in a current page, and judging whether the page object has a cycle operation identifier or not;
if yes, determining the page object with the cyclic operation identification as a target page object;
if not, judging whether the next page object in the current page has a cycle operation identifier or not.
In one possible design, the system further includes an output module configured to:
if the current page is a page with the target page object appearing for the first time and the target page object does not exist in the next page, outputting abnormal prompt information; alternatively, the first and second electrodes may be,
and if the current page is not the page with the target page object appearing for the first time and the next page does not have the page object, outputting abnormal prompt information.
In a third aspect, an embodiment of the present application provides a readable storage medium, which includes a program or instructions, and when the program or instructions are executed on a computer, the method in the first aspect and any possible design of the first aspect is performed.
In a fourth aspect, an apparatus for testing a page object in an embodiment of the present application includes: a processor coupled with a memory;
the memory is used for storing a computer program;
the processor is configured to invoke the computer program stored in the memory to implement the first aspect and the method performed in any of the possible designs of the first aspect.
When the method and the device for automatically testing the page object needing the loop operation are used for automatically testing the page object needing the loop operation, because the page object needing the loop operation has the loop operation identifier and does not have the loop operation times, the continuous execution times of the page object needing the loop operation can be determined according to the service logic of the current page (whether the page object is included in the page displayed later in the executed page object) and are not limited by the fixed loop operation times. Therefore, if the business logic corresponding to the page where the page object needing the loop operation is located is changed, when the page object needing the loop operation is automatically tested again, the new loop operation frequency does not need to be set for the page object needing the loop operation again.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic diagram of a system architecture according to an embodiment of the present application;
FIG. 2 is a first flowchart of a method for testing page objects according to an embodiment of the present disclosure;
FIG. 3 is a second flowchart of a method for testing page objects according to an embodiment of the present application;
FIG. 4 is a first schematic structural diagram of an apparatus for testing page objects according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a device for testing a page object according to an embodiment of the present application;
fig. 6 is a third schematic structural diagram of a device for testing a page object according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple. The terms "first," "second," and the like in this application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Fig. 1 is a schematic diagram of a system architecture according to an embodiment of the present application; referring to fig. 1, the system architecture of the present embodiment includes a server 11 and a terminal 12. The terminal 12 includes a device for testing a page object, and the device for testing a page object can execute the method in fig. 2.
The technical means shown in the present application will be described in detail below with reference to specific examples. It should be noted that the following embodiments may be combined with each other, and the description of the same or similar contents in different embodiments is not repeated.
FIG. 2 is a method for testing page objects according to an embodiment of the present disclosure; referring to fig. 2, the method of the present embodiment includes:
step S201, determining that a target page object having a loop operation identifier exists in the current page, where the loop operation identifier of the target page object is obtained according to a script of the target page object.
Specifically, the page object in the present embodiment may be an icon button, such as "previous step", "next step", "agree", and the like. From the aspect of the number of times of executing a business logic, the page object that needs to be executed multiple times in succession may be referred to as a page object that needs to be operated circularly, and the page object that needs to be executed once may be referred to as a page object that needs to be operated once. For example, "previous step", "next step", etc. are page objects that need to be cyclically operated, and "commit" is a page object of a single operation. The method for testing the page object in this embodiment is a method for testing a page object that needs to be cyclically operated.
The method for testing page objects in this embodiment is described below in terms of a process for testing a target page object, which is a page object that requires a looping operation.
When testing a page object, it is first necessary to open a page on which the target page object appears for the first time. The current page in this embodiment may be any page in which the target page object exists in the pages involved in the test process of the target page object.
If the current page is the page with the target page object appearing for the first time, determining that the target page object with the cycle operation identifier exists in the current page comprises the following steps:
acquiring a page object in a current page, and judging whether the page object has a cycle operation identifier or not; if yes, determining the page object with the cyclic operation identification as a target page object; if not, judging whether the next page object in the current page has the cycle operation identification.
Specifically, the determining whether the page object has the loop operation identifier may be determined by a script of the page object, and before acquiring the page object in the current page and determining whether the page object has the loop operation identifier, the method may further include: and acquiring the script of the page object.
In order to save the storage space of the terminal, the script for acquiring the page object in one mode can be realized by the following a 1-a 2:
a1, sending a script obtaining request to the server, wherein the script obtaining request comprises the identification of the page object.
Specifically, since the script of the page object includes the identifier of the page object, when the terminal acquires the script of the page object, the identifier of the page object is carried in the script acquisition request.
a2, receiving script of the page object from the server, the script of the page object including identification of the page object.
Specifically, after receiving the script acquisition request, the server acquires a script including an identifier of the page object according to the script acquisition request, that is, acquires the script of the page object, and sends the script of the page object to the terminal, and the terminal receives the script of the page object from the server.
In another mode, the script of the page object can also be stored in the terminal in advance, so that the script of the page object is obtained by the terminal from the memory of the terminal, and the script obtaining speed is high. In this case, the script of the page object stored in advance in the terminal may be transmitted to the terminal after the server generates the script of the page object.
After the terminal acquires the script of the page object, if the script of the page object comprises the cyclic operation identifier, determining that the page object has the cyclic operation identifier, and determining that the page object is the target page object, if the script of the page object does not comprise the cyclic operation identifier, determining that the page object does not have the cyclic operation identifier, and judging whether the next page object in the current page has the cyclic operation identifier according to the same method.
If the current page is not the page on which the target page object appears for the first time but is the other pages on which the target page object appears in the pages related in the test process except the page on which the target page object appears for the first time, determining that the target page object with the cyclic operation identifier exists in the current page comprises the following steps: and determining whether a page object identified as the identification of the target page object is stored in the current page, and if so, determining that the target page object with the cyclic operation identification exists in the current page. That is, if the current page is not the page on which the target page object appears for the first time but is the other pages on which the target page object appears in the pages related in the test process except the page on which the target page object appears for the first time, when it is determined that the target page object with the cyclic operation identifier exists in the current page, the script of the page object does not need to be obtained again.
Step S202, executing a target page object on the current page to obtain a next page;
specifically, after determining that the target page object with the cyclic operation identifier exists in the current page, the terminal executes the target page object once on the current page to obtain the next page.
Step S203, if the target page object exists in the next page, executing the target page object on the next page, and if the target page object does not exist in the next page, stopping executing the target page object.
Specifically, the specific method for determining that the target page object exists in the next page is as follows: and determining whether the next page has a page object identified as the target page object, if so, determining that the target page object exists in the next page, and executing the target page object once on the next page. After determining that the target page object exists in the next page and executing the target page object once on the next page, another page is obtained, and a subsequent processing method for obtaining another page is the same as that in step S203, which is not described herein again.
And if the next page does not have the page object identified as the target page object, determining that the target page object does not exist in the next page, and stopping executing the target page object. And stopping executing the target page object, and showing that the test on the target page object is finished.
The method for judging whether the target page object is successfully executed in the test process may be: if the target page object is executed once, the displayed page includes the target page object or other page objects, which indicates that the target page object is executed successfully, so that if each execution of the target page object is successful in the test process, the target page object is tested successfully. And stopping executing the page object does not necessarily indicate that the page object is successfully tested, wherein after determining that the target page object does not exist in the next page, the following conditions exist:
(1) and if the current page is the page with the target page object appearing for the first time and the target page object does not exist in the next page, outputting abnormal prompt information.
Because the target page object is a page object that needs to be operated circularly, that is, in a one-time complete service logic, the target page object needs to be executed at least twice, when the current page is a page where the target page object appears for the first time, the next page should have the target page object, and if the target page object does not exist in the next page, the test process is abnormal, so that abnormal prompt information can be output.
(2) And if the current page is not the page with the target page object appearing for the first time and the next page does not have the page object, outputting abnormal prompt information.
It can be understood that, since the target page object is a page object that needs to be cyclically operated, in a complete business logic of a time, a last executed page object is not the target page object, and therefore, if the current page is not a page on which the target page object appears for the first time and the target page object does not exist in the next page, other page objects should exist. That is, if the current page is not the page on which the target page object appears for the first time and the next page does not have a page object (neither the target page object nor other page objects exist), it indicates that the test process is abnormal, and therefore, abnormal prompt information may be output.
(3) If the current page is not the object of the target page appearing for the first time, the target page object does not exist in the next page, and other page objects exist in the next page, other page objects are continuously tested.
Based on the analysis in (2), this case shows that the test on the target page object is completed and the test is successful.
The method for testing page objects in the present embodiment is explained above through steps S201 to S203. The following describes a method for testing page objects according to this embodiment by way of specific example.
Illustratively, the page on which page object A appears for the first time, referred to herein as the first page, is opened; and acquiring a script of the page object A, wherein the script of the page object A comprises an identifier of the circular operation, namely the page object A is a page object needing the circular operation.
There are at least several cases during the test:
(1) executing the page object A on the first page to obtain a second page, executing the page object A on the second page to obtain a third page, executing the page object A on the third page to obtain a fourth page, wherein the page object A does not exist on the fourth page, the page object B exists on the third page, the execution of the page object A is stopped, and the page object A is tested completely and successfully.
(2) Executing the page object A on the first page to obtain a second page, executing the page object A on the second page to obtain a third page, executing the page object A on the third page to obtain a fourth page if the page object A exists on the third page, and outputting abnormal information if the page object does not exist on the fourth page.
(3) And executing the page object A on the first page to obtain a second page, executing the page object A on the second page if the page object A exists in the second page to obtain a third page, stopping executing the page object A if the page object A does not exist in the third page and the page object B exists in the second page, and finishing and successfully testing the page object A.
(4) And executing the page object A on the first page to obtain a second page, if the second page has the page object A, executing the page object A on the second page to obtain a third page, and if the third page does not have the page object, outputting abnormal information.
(5) And executing the page object A on the first page to obtain a second page, and outputting abnormal information if the page object A does not exist in the second page.
The test method of the page object which does not need to be circularly operated can refer to the current test method, or the page object which does not need to be circularly operated is obtained according to the script and has the single operation identifier, and the page object is executed once after the page object with the single operation identifier exists in the current page.
In this embodiment, when performing an automatic test on a page object that needs to be cyclically operated, because the page object that needs to be cyclically operated has a cyclic operation identifier and does not have a cyclic operation frequency, the continuous execution frequency of the page object that needs to be cyclically operated may be determined according to the service logic of the current page (whether the page object is included in the page displayed later in the executed page object), and is no longer limited to a fixed cyclic operation frequency. Therefore, if the business logic corresponding to the page where the page object needing the loop operation is located is changed, when the page object needing the loop operation is automatically tested again, the new loop operation frequency does not need to be set for the page object needing the loop operation again.
It should be understood that the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
The following describes setting of a target page object in the previous embodiment with reference to a specific embodiment.
Fig. 3 is a second flowchart of a method for testing a page object according to an embodiment of the present application, and referring to fig. 3, before the step "determining that a target page object having a loop operation identifier exists in a current page" of the previous embodiment, the method of the present embodiment includes:
step S301, receiving a page object selection instruction input by a user, wherein the page object selection instruction comprises a page object selected by the user.
Specifically, a user inputs a page object selection instruction by selecting a page object in the current page, and the terminal receives the page object selection instruction. For example, the user may input a page object selection command by double-clicking a page object in the current page.
It will be appreciated that the page object selected by the user may be any page object in the current page that requires a looping operation.
And step S302, setting the page object selected by the user as a target page object, wherein the target page object is provided with a cycle operation identifier.
Specifically, after receiving the page selection instruction, the terminal determines a page object selected by the user according to the page selection instruction, and sets the page object as a target page object, where the target page object has a cyclic operation identifier.
The method comprises the following steps of setting a page object selected by a user as a target page object, wherein the target page object is provided with a cycle operation identifier, and the method can be realized by the following method:
b1, acquiring a setting instruction input by a user, wherein the setting instruction comprises a loop operation identifier.
Specifically, the terminal may obtain information of the page object selected by the user on the current page, and the information of the page object selected by the user may include at least one of the following: identification (ID), diagonal coordinates, whether text is included, what the text is if included, and the like.
And the terminal can reversely check and acquire the information of the page object selected by the user through the Webdriver.
After the terminal acquires the information of the page object selected by the user, the information of the page object selected by the user can be displayed to the user, and the user can input a setting instruction by adding an attribute field in the information of the page object selected by the user and inputting the content-cycle operation identifier of the attribute field.
b2, setting the page object selected by the user as the target page object according to the setting instruction, the target page object is provided with a cycle operation identifier,
specifically, after receiving the setting instruction, the terminal sets the page object selected by the user as the target page object with the cyclic operation identifier. And the cycle operation identifier is used for indicating that the target page object is a page object needing cycle operation.
Further, after step S302, the method may further include: and sending the identification of the target page object and the cyclic operation identification of the target page object to a server so as to enable the server to generate a script of the target page object, wherein the script of the target page object comprises the identification of the target page object and the cyclic operation identification of the target page object.
In this way, when the target page object is tested, the script of the target page object is obtained, the target page object is determined to be a page object requiring a loop operation according to the loop operation identifier included in the script, and the test of the target page object is performed according to steps S201 to S203 in the embodiment shown in fig. 2.
Through the process, the page object needing the circular operation is set to be the page object with the circular operation identification, and the circular operation frequency of the page object needing the circular operation is not set, so that the continuous execution frequency of the page object needing the circular operation is not limited to the fixed circular operation frequency, when the script of the page object needing the circular operation is used for the automatic test of the page object, if the business logic corresponding to the page where the page object needing the circular operation is located is changed, the page object needing the circular operation does not need to be reset, and therefore the efficiency of the automatic test of the page object is improved.
It should be understood that the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 4 is a first schematic structural diagram of an apparatus for processing a page object according to an embodiment of the present disclosure, as shown in fig. 4, the apparatus of this embodiment may include: a determination module 41 and an execution module 42;
a determining module 41, configured to determine that a target page object with a cyclic operation identifier exists in a current page, where the cyclic operation identifier of the target page object is obtained according to a script of the target page object;
an executing module 42, configured to execute the target page object on the current page to obtain a next page;
the executing module 42 is further configured to execute the target page object on the next page if the target page object exists in the next page, and stop executing the target page object if the target page object does not exist in the next page.
Optionally, the determining module 41 is specifically configured to:
acquiring a page object in a current page, and judging whether the page object has a cycle operation identifier or not;
if yes, determining the page object with the cyclic operation identification as a target page object;
if not, judging whether the next page object in the current page has a cycle operation identifier or not.
The apparatus of this embodiment may be configured to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 5 is a schematic structural diagram of a device for processing a page object according to an embodiment of the present application, and as shown in fig. 5, the device according to the embodiment further includes, based on the embodiment shown in fig. 4: a receiving module 43, a setting module 44 and an output module 45.
The receiving module 43 is configured to receive a page object selection instruction input by a user before determining that a target page object with a loop operation identifier exists in the current page, where the page object selection instruction includes a page object selected by the user;
the setting module 44 is configured to set the page object selected by the user as the target page object, where the target page object has the cycle operation identifier.
Optionally, the receiving module 43 is further configured to receive a cycle number of the target page object set by a user.
Optionally, an output module 45 is further included, where the output module 45 is configured to:
if the current page is a page with the target page object appearing for the first time and the target page object does not exist in the next page, outputting abnormal prompt information; alternatively, the first and second electrodes may be,
and if the current page is not the page with the target page object appearing for the first time and the next page does not have the page object, outputting abnormal prompt information.
The apparatus of this embodiment may be configured to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram three of the apparatus for testing a page object according to the embodiment of the present application, and as shown in fig. 6, the apparatus according to the embodiment includes: a processor 61 and a memory 62, the processor 61 being coupled to the memory 62;
the memory 62 is used for storing a computer program;
the processor 61 is configured to execute the computer program stored in the memory 62, so that the apparatus for testing page objects executes the method corresponding to any of the above-mentioned method embodiments.
The embodiment of the present application provides a readable storage medium, which includes a program or instructions, and when the program or instructions are run on a computer, the method corresponding to any of the above method embodiments is executed.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present application, and are not limited thereto; although the embodiments of the present application have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the embodiments of the present application.

Claims (9)

1. A method for testing page objects is applied to a terminal, and is characterized by comprising the following steps:
determining that a target page object with a cycle operation identifier exists in a current page, wherein the cycle operation identifier of the target page object is obtained according to a script of the target page object;
executing the target page object on the current page to obtain a next page;
if the target page object exists in the next page, executing the target page object on the next page, and if the target page object does not exist in the next page, stopping executing the target page object;
after the target page object is executed on the current page to obtain a next page, the method further includes:
if the current page is a page with the target page object appearing for the first time and the target page object does not exist in the next page, outputting abnormal prompt information; alternatively, the first and second electrodes may be,
and if the current page is not the page with the target page object appearing for the first time and the next page does not have the page object, outputting abnormal prompt information.
2. The method of claim 1, wherein before determining that the target page object with the looping operation identifier exists in the current page, the method further comprises:
receiving a page object selection instruction input by a user, wherein the page object selection instruction comprises a page object selected by the user;
setting the page object selected by the user as the target page object, wherein the target page object is provided with the cycle operation identifier.
3. The method of claim 2, wherein after setting the user-selected page object to the target page object, the method further comprises:
and receiving the circulation times of the target page object set by the user.
4. The method of claim 1, wherein determining that a target page object with a looping operation identifier exists in a current page comprises:
acquiring a page object in a current page, and judging whether the page object has a cycle operation identifier or not;
if yes, determining the page object with the cyclic operation identification as a target page object;
if not, judging whether the next page object in the current page has a cycle operation identifier or not.
5. An apparatus for testing page objects, comprising:
the determining module is used for determining that a target page object with a cyclic operation identifier exists in a current page, and the cyclic operation identifier of the target page object is obtained according to a script of the target page object;
the execution module is used for executing the target page object on the current page to obtain a next page;
the executing module is further configured to execute the target page object on the next page if the target page object exists in the next page, and stop executing the target page object if the target page object does not exist in the next page;
the output module is used for outputting abnormal prompt information if the current page is a page with the target page object appearing for the first time and the target page object does not exist in the next page; or if the current page is not the page with the target page object appearing for the first time and the next page does not have the page object, outputting abnormal prompt information.
6. The apparatus of claim 5, further comprising: the device comprises a receiving module and a setting module;
the receiving module is used for receiving a page object selection instruction input by a user before the target page object with the cyclic operation identifier exists in the current page, wherein the page object selection instruction comprises a page object selected by the user;
the setting module is configured to set the page object selected by the user as the target page object, where the target page object has the cyclic operation identifier.
7. The apparatus of claim 5, wherein the determining module is specifically configured to:
acquiring a page object in a current page, and judging whether the page object has a cycle operation identifier or not;
if yes, determining the page object with the cyclic operation identification as a target page object;
if not, judging whether the next page object in the current page has a cycle operation identifier or not.
8. A readable storage medium, comprising a program or instructions for performing the method of any of claims 1 to 4 when the program or instructions are run on a computer.
9. An apparatus for testing page objects, comprising: a processor coupled with a memory;
the memory is used for storing a computer program;
the processor is used for calling the computer program stored in the memory so as to realize the method of any one of claims 1 to 4.
CN201811479925.3A 2018-12-05 2018-12-05 Method, device and storage medium for testing page object Active CN109634857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811479925.3A CN109634857B (en) 2018-12-05 2018-12-05 Method, device and storage medium for testing page object

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811479925.3A CN109634857B (en) 2018-12-05 2018-12-05 Method, device and storage medium for testing page object

Publications (2)

Publication Number Publication Date
CN109634857A CN109634857A (en) 2019-04-16
CN109634857B true CN109634857B (en) 2022-02-15

Family

ID=66071361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811479925.3A Active CN109634857B (en) 2018-12-05 2018-12-05 Method, device and storage medium for testing page object

Country Status (1)

Country Link
CN (1) CN109634857B (en)

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101135989B (en) * 2006-08-31 2010-11-24 中国银联股份有限公司 Automatization test method and device for Web applied system
US8522212B1 (en) * 2010-07-21 2013-08-27 Google Inc. Auto generation of test utility bots using compile time heuristics of user interface source code
US9697012B2 (en) * 2010-10-22 2017-07-04 Hewlett Packard Enterprise Development Lp Relation-based identification of automation objects
US8695027B2 (en) * 2011-06-30 2014-04-08 Mcafee, Inc. System and method for application security assessment
CN103729285B (en) * 2012-10-11 2018-06-05 腾讯科技(深圳)有限公司 A kind of webpage test method, equipment and system
CN104391786B (en) * 2014-10-31 2018-04-27 任子行网络技术股份有限公司 Webpage automatization test system and its method
CN104820634B (en) * 2014-12-25 2018-04-13 平安科技(深圳)有限公司 The detection method and device of page test trails
CN106484609B (en) * 2015-09-01 2019-04-09 博雅网络游戏开发(深圳)有限公司 Page test method and device
CN108733555A (en) * 2017-04-25 2018-11-02 中移信息技术有限公司 A kind of application testing method and device
CN107577607B (en) * 2017-09-07 2020-07-21 携程旅游信息技术(上海)有限公司 User interface automatic testing method and device, electronic equipment and storage medium
CN107908639A (en) * 2017-09-26 2018-04-13 东软集团股份有限公司 Page object lookup method and device, storage medium, electronic equipment
CN108536603B (en) * 2018-04-16 2021-03-02 哈尔滨工业大学 Automatic testing method for Web browser behaviors aiming at new top-level domain name
CN108897684A (en) * 2018-06-28 2018-11-27 郑州云海信息技术有限公司 A kind of feed-back type webpage automatic test script design method based on TestNG

Also Published As

Publication number Publication date
CN109634857A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
US9465724B2 (en) Method, program, and system for generating test cases
WO2017083207A1 (en) Digital assistant setting up device
US20190332970A1 (en) Component releasing method, component creation method, and graphic machine learning algorithm platform
US20130283100A1 (en) Testing device
WO2007055610A1 (en) Iterative search with data accumulation in a cognitive control framework
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN114546738A (en) Server general test method, system, terminal and storage medium
CN113434396A (en) Interface test method, device, equipment, storage medium and program product
CN111831542A (en) API application debugging method and device and storage medium
CN112181749A (en) Hardware testing method and device, electronic equipment and storage medium
CN109634857B (en) Method, device and storage medium for testing page object
US20180101294A1 (en) Information generating system, information generating device, information generating method, and information generating program
CN116126719A (en) Interface testing method and device, electronic equipment and storage medium
CN112100086B (en) Software automation test method, device, equipment and computer readable storage medium
CN112202724B (en) Data aggregation method and device of all-in-one arrangement mode
CN110515834B (en) Interface testing method and device, mobile terminal and storage medium
CN109684525B (en) Document display method and device, storage medium and test equipment
JP2017111798A (en) Event driven software test
CN113468564A (en) Data processing method and device, electronic equipment and storage medium
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN111160403A (en) Method and device for multiplexing and discovering API (application program interface)
CN106604129B (en) The method and apparatus for detecting video broadcasting condition
CN113225717B (en) Control method and device of Bluetooth equipment and computer readable storage medium
CN107122164A (en) Function address obtains and applied its method, device, equipment and storage medium
CN112100077B (en) Transaction 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
GR01 Patent grant
GR01 Patent grant