CN111190574B - Method, device, equipment and storage medium for selecting options of multi-stage linkage assembly - Google Patents

Method, device, equipment and storage medium for selecting options of multi-stage linkage assembly Download PDF

Info

Publication number
CN111190574B
CN111190574B CN201811353786.XA CN201811353786A CN111190574B CN 111190574 B CN111190574 B CN 111190574B CN 201811353786 A CN201811353786 A CN 201811353786A CN 111190574 B CN111190574 B CN 111190574B
Authority
CN
China
Prior art keywords
option
current
level
script
stage
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
CN201811353786.XA
Other languages
Chinese (zh)
Other versions
CN111190574A (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.)
Guangdong Infinite Information Technology Co ltd
Original Assignee
Guangdong Infinite Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Infinite Information Technology Co ltd filed Critical Guangdong Infinite Information Technology Co ltd
Priority to CN201811353786.XA priority Critical patent/CN111190574B/en
Publication of CN111190574A publication Critical patent/CN111190574A/en
Application granted granted Critical
Publication of CN111190574B publication Critical patent/CN111190574B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to an option selection method, an option selection device, option selection equipment and a storage medium for a multi-stage linkage assembly. The method comprises the following steps: acquiring text information corresponding to a current-level option group loaded by a current web page through the matching of a calling script and an operation script; the text information of the current-stage option group comprises the text information of each option in the current-stage option group; matching the current-stage input reference text with the text information corresponding to the current-stage option group, determining the current-stage target option corresponding to the input reference text, and selecting the current-stage target option through the matching of the calling script and the operation script. The method improves the efficiency of automatic testing, and the robustness of the test script is higher.

Description

Method, device, equipment and storage medium for selecting options of multi-stage linkage assembly
Technical Field
The present application relates to the field of internet technologies, and in particular, to a method, an apparatus, a device, and a storage medium for selecting options of a multi-level linkage component.
Background
With the rapid development of computer technology, web page (web) applications have been produced. Testing of web applications is a crucial task in the web application development process. As most of web applications are developed based on a Mobile application Interface (MUI) framework and a multi-level linkage selection component (MUI-popicker) is an important component in the MUI framework, the MUI-popicker needs to be operated by a test script in the test process of the web applications, so that the test script can automatically select various levels of options in the MUI-popicker according to the provided parameters.
In the traditional technology, specific position coordinates of the MUI-popicker in a page are obtained firstly, and then options in the MUI-popicker are selected by simulating a click according to the position coordinates of the MUI-popicker and input parameters provided, so that the aim of automatically selecting all levels of options in the MUI-popicker is fulfilled.
However, when the hardware environment for testing changes (for example, a device is replaced for testing), the position coordinates of the page of the MUI-popicker in the replaced device may change because the resolutions of different hardware may be different. Therefore, the testing script cannot select the options of the MUI-popplicker, so that the efficiency of automatic testing is reduced, and the robustness of the testing script is low.
Disclosure of Invention
Based on this, it is necessary to provide an option selection method, apparatus, device and storage medium for a multi-stage linkage component, aiming at the problems of low automation test efficiency and low robustness of a test script in the conventional technology.
A method of option selection for a multi-level linkage assembly, the multi-level linkage assembly comprising a plurality of levels of sets of options, the method comprising:
performing a text acquisition operation, the text acquisition operation comprising: acquiring text information corresponding to a current-level option group loaded by a current web page through the matching of a calling script and an operating script; the text information of the current-stage option group comprises the text information of each option in the current-stage option group;
matching the reference text with the text information corresponding to the current-level option group, determining the current-level target option corresponding to the reference text, and selecting the current-level target option through the matching of the calling script and the operation script.
According to the option selection method for the multi-stage linkage assembly, after the computer equipment acquires the text information corresponding to the current-stage option group loaded on the current web page through the cooperation of the calling script and the operating script, the computer equipment matches the current-stage entry parameter text with the text information corresponding to the current-stage option group, determines the current-stage target option corresponding to the current-stage entry parameter text, and selects the current-stage target option through the cooperation of the calling script and the operating script. The computer equipment determines the current-level target option based on the matching result of the text information corresponding to the current-level option group and the current-level input reference text; meanwhile, the operation script selects the options based on the class attribute of the options, so that the computer equipment can select the determined current-level target option by matching the call script and the operation script. Therefore, when the tested hardware environment changes, the computer equipment can select options of the multi-level linkage assembly, so that the efficiency of automatic testing is improved, and the robustness of the testing script is improved.
In one embodiment, the calling script is a JavaScript language, and the operating script is a java language or a python language;
the acquiring the text information corresponding to the current-level option group loaded on the current web page through the cooperation of the calling script and the operation script comprises the following steps:
displaying each option of the current-level option group on a current web page by executing the calling script;
and acquiring the text attribute of each option by executing the operation script so as to obtain the text information of each option.
According to the option selection method of the multi-stage linkage component, the computer device displays each option of the current-stage option group on the current web page by executing the call script, and obtains the text attribute of each option by executing the operation script so as to obtain the text information of each option. The computer equipment acquires the text attribute of each option in the current-level option group based on the cooperation of the calling script and the operation script so as to obtain the text information of each option. Therefore, the computer equipment can match the acquired text information of each option with the reference text, so that the current-level target option is determined, and the determined current-level target option is selected by combining the calling script and the operation script. Therefore, when the tested hardware environment changes, the computer equipment can select options of the multi-stage linkage assembly, so that the automatic testing efficiency is improved, and the robustness of the testing script is improved.
In one embodiment, after the selecting the current-level target option through the cooperation of the calling script and the operation script, the method further includes:
acquiring a next-level option group of the current group option group;
judging whether the number of options in the next level option group is equal to 1;
if yes, determining one option in the next-level option group as a next-level target option;
and if not, taking the next level option group as a new current level option group, and executing the text acquisition operation.
According to the option selection method of the multi-stage linkage assembly, the computer equipment can determine the selection process of the next-stage target option according to the number of options in the next-stage option group, and when the number of options in the next-stage option group is equal to 1, the option can be directly determined to be the next-stage target option and can be directly selected through the operation script. Therefore, the process of selecting options of the multi-stage linkage assembly by the computer equipment is simplified, and the efficiency of automatic testing is further improved.
In one embodiment, the displaying the options of the current-level option group on the current web page by executing the calling script includes:
and changing the class attribute of each option of the current-level option group into a visible state by executing the calling script so as to display each option of the current-level option group on the current web page.
In one embodiment, before the matching between the reference text and the text information corresponding to the current-level option group, the method further includes:
and changing the class attribute of each option of the current-level option group from a visible state to an invisible state and changing the display attribute of each option of the current-level option group to none through the calling script so as to enable each option of the current-level option group on the current page to be in a hidden state.
In one embodiment, the selecting the current-level target option through the cooperation of the calling script and the operation script includes:
changing the class attribute of the current-level target option from an invisible state to a visible state and changing the display attribute of the current-level target option from none to null through the calling script so as to display the current-level target option on the current web page;
deleting the component mask of the multi-stage linkage component through the calling script;
and selecting the current-level target option through the operation script.
In one embodiment, before deleting the component mask of the multi-level linkage component through the calling script, the method further comprises:
and placing the current-level target option at the top of the current-level option group through the calling script.
In the option selection method for the multi-stage linkage component provided by this embodiment, the computer device may modify the class attribute and the display attribute of each option in the current-stage option group by executing the call script, so that each option in the current-stage option group is in a hidden state, and then modify the determined class attribute and display attribute of the current-stage target option by executing the call script, so that the current-stage target option is separately displayed on the current web page. Because the operation script selects the options based on the class attribute of the options when selecting the options, and only the class attribute of the current-level target option on the current web page is in a visible state, the current-level target option can be selected by executing the operation script. Therefore, when the tested hardware environment changes, the computer equipment can select options of the multi-stage linkage assembly, so that the automatic testing efficiency is improved, and the robustness of the testing script is improved.
An option selection device for a multi-stage linkage assembly, the multi-stage linkage assembly including a plurality of stages of option groups, the device comprising:
the first acquisition module is used for acquiring text information corresponding to a current-level option group loaded on a current web page through the matching of a calling script and an operating script; the text information of the current-stage option group comprises the text information of each option in the current-stage option group;
the first determining module is used for matching a reference text with text information corresponding to the current-level option group and determining a current-level target option corresponding to the reference text;
and the selection module is used for selecting the current-level target option through the matching of the calling script and the operation script.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
performing a text acquisition operation, the text acquisition operation comprising: acquiring text information corresponding to a current-level option group loaded by a current web page through the matching of a calling script and an operating script; the text information of the current-stage option group comprises the text information of each option in the current-stage option group;
matching the reference text with the text information corresponding to the current-level option group, determining the current-level target option corresponding to the reference text, and selecting the current-level target option through the matching of the calling script and the operation script.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
performing a text acquisition operation, the text acquisition operation comprising: acquiring text information corresponding to a current-level option group loaded by a current web page through the matching of a calling script and an operating script; the text information of the current-stage option group comprises the text information of each option in the current-stage option group;
matching the reference text with the text information corresponding to the current-level option group, determining the current-level target option corresponding to the reference text, and selecting the current-level target option through the matching of the calling script and the operation script.
According to the option selection device, the equipment and the storage medium of the multi-stage linkage component, after the text information corresponding to the current-stage option group loaded on the current web page is obtained through the coordination of the calling script and the operating script, the computer equipment can be enabled to match the current-stage entry parameter text with the text information corresponding to the current-stage option group, determine the current-stage target option corresponding to the current-stage entry parameter text, and select the current-stage target option through the coordination of the calling script and the operating script. The computer equipment determines the current-level target option based on the matching result of the text information corresponding to the current-level option group and the current-level input reference text; meanwhile, the operation script selects the options based on the class attribute of the options, so that the computer equipment can select the determined current-level target option by the cooperation of the call script and the operation script. Therefore, when the tested hardware environment changes, the computer equipment can select options of the multi-stage linkage assembly, so that the automatic testing efficiency is improved, and the robustness of the testing script is improved.
Drawings
Fig. 1 is a schematic internal structural diagram of a computer device according to an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating a method for selecting options for a multi-stage linkage assembly according to one embodiment;
FIG. 3 is a schematic illustration of a multi-stage linkage assembly according to one embodiment;
FIG. 4 is a schematic flow chart diagram illustrating a method for selecting options for a multi-stage linkage assembly according to another embodiment;
FIG. 5 is a schematic flow chart diagram illustrating a method for selecting options for a multi-stage linkage assembly according to another embodiment;
FIG. 6 is a schematic flow chart diagram illustrating a method for selecting options for a multi-stage linkage assembly according to another embodiment;
FIG. 7 is a schematic flow chart diagram illustrating a method for selecting options for a multi-stage linkage assembly according to another embodiment;
FIG. 8 is a schematic diagram illustrating an embodiment of an option selection device for a multi-stage linkage assembly;
FIG. 9 is a schematic diagram of an alternative selection apparatus for a multi-stage linkage assembly according to another embodiment;
FIG. 10 is a schematic diagram illustrating an alternative selection mechanism for a multi-stage linkage assembly according to another embodiment;
FIG. 11 is a schematic diagram illustrating an alternative selection mechanism for a multi-stage linkage assembly according to another embodiment;
FIG. 12 is a schematic diagram of an alternative selection apparatus for a multi-stage linkage assembly according to another embodiment;
fig. 13 is a schematic structural diagram of an option selection device of a multi-stage linkage assembly according to another embodiment.
Detailed Description
The option selection method of the multi-stage linkage assembly provided by the embodiment of the application can be applied to computer equipment shown in fig. 1. The computer device comprises a processor, a memory connected by a system bus, and a computer program stored in the memory, which when executed by the processor, performs the steps of the method embodiments described below. Optionally, the computer device may further comprise a network interface, a display screen and an input device. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a nonvolatile storage medium storing an operating system and a computer program, and an internal memory. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. Optionally, the computer device may be an electronic device that has an image data processing function and can interact with an external device or a user, such as a personal computer PC (personal computer), a mobile terminal, and a portable device, and the specific form of the computer device is not limited in this embodiment.
In the web automation test, in order to achieve the purpose that a test script can automatically select all levels of options in the MUI-popicker according to the provided access parameters, the traditional technology simulates clicking to select the options in the MUI-popicker according to the position coordinates of the MUI-popicker and the provided access parameters. However, when the hardware environment of the test changes, the test script cannot select an option for the MUI-popup, so that the efficiency of the automated test is reduced, and the robustness of the test script is low.
The embodiment of the application provides a method, a device, equipment and a storage medium for selecting options of a multi-stage linkage assembly, and aims to solve the technical problems in the conventional technology. It should be noted that, in the option selection method for a multi-stage linkage assembly provided in the embodiments of the present application, the execution main body may be an option selection device for the multi-stage linkage assembly, and the option selection device may be implemented as part or all of a computer device by software, hardware, or a combination of software and hardware. The execution subject of the method embodiments described below is illustrated with a computer device as an example.
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application are further described in detail by the following embodiments in combination with the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not limiting of the application.
Fig. 2 is a flowchart illustrating a method for selecting options of a multi-stage linkage assembly according to an embodiment. The present embodiment relates to a specific process of how a computer device selects options in a multi-level linkage assembly by invoking scripts and manipulating scripts. As shown in fig. 2, the method includes:
s101, executing a text acquisition operation, wherein the text acquisition operation comprises the following steps: acquiring text information corresponding to a current-level option group loaded by a current web page through the matching of a calling script and an operating script; wherein the text information of the current-stage option group comprises the text information of each option in the current-stage option group.
Specifically, the multi-stage linkage assembly includes a multi-stage option group, and a linkage relationship exists between the current-stage option group and the next-stage option group. Meanwhile, each level of option group has a corresponding class attribute, and the computer device can determine the current level option group through the class attribute corresponding to the current level option group by executing the call script so as to perform subsequent operation of acquiring the text information corresponding to the current level option group. The current-level option group comprises 1 or more options, and each option has a corresponding text attribute. Taking the multi-stage linkage assembly shown in fig. 3, and taking the current-stage option group as a first-stage option group as an example, the linkage stage number of the multi-stage linkage assembly is two stages, the first-stage option group includes 5 options, and the options are guangdong, fujian, shanxi, beijing, and henna, respectively; the options included in the secondary option group are linked based on the primary target option. For example, when the primary target option is beijing, the options included in the secondary option group are beijing.
Optionally, the invoking script is written in JavaScript language and is configured to modify the relevant attribute of each option in the current-level option group, and the operating script is written in java language or python language and is configured to obtain the text attribute of each option in the current-level option group. Continuing to take fig. 3 as an example, the computer device executes the call script and the operation script to obtain the text information corresponding to the current-level option group, which is, respectively, guangdong, fujian, shanxi, beijing, and henan.
S102, matching a current-stage entry parameter text with text information corresponding to the current-stage option group, determining a current-stage target option corresponding to the entry parameter text, and selecting the current-stage target option through the matching of the calling script and the operating script.
Specifically, the current-level entry text is a text parameter input into the test script, and the test script selects an option in the current-level option group based on the current-level entry text. The current-level target option is a current-level option to be selected. Continuing with the example of the multi-stage linkage component shown in fig. 3, assuming that the current-stage reference text is the guangdong, after the computer device acquires text information of each option in the current-stage option group, the computer device matches the text information (guangdong, fujian, shanxi, beijing, and henna) corresponding to the guangdong and the current-stage option group, so as to determine the current-stage target option corresponding to the guangdong. Since the operation script selects the option based on the class attribute of the option, and the class attribute of the option is modified by the call script, after the current-level target option corresponding to the current-level input parameter text is determined, the computer device needs to select the current-level target option by the cooperation of the call script and the operation script.
In this way, after determining the current-level target option corresponding to the reference text, the computer device executes the call script to modify the relevant attributes of each option, so that the current-level target option is separately displayed on the current web page, thereby enabling the operation script to select the determined current-level target option.
According to the option selection method of the multi-level linkage component, after the computer equipment acquires the text information corresponding to the current-level option group loaded on the current web page through the cooperation of the calling script and the operating script, the computer equipment matches the current-level entry parameter text with the text information corresponding to the current-level option group, determines the current-level target option corresponding to the current-level entry parameter text, and selects the current-level target option through the cooperation of the calling script and the operating script. The computer equipment determines the current-level target option based on the matching result of the text information corresponding to the current-level option group and the current-level input reference text; meanwhile, the operation script selects the options based on the class attribute of the options, so that the computer equipment can select the determined current-level target option by matching the call script and the operation script. Therefore, when the tested hardware environment changes, the computer equipment can select options of the multi-stage linkage assembly, so that the automatic testing efficiency is improved, and the robustness of the testing script is improved.
Fig. 4 is a flowchart illustrating a method for selecting options of a multi-stage linkage assembly according to another embodiment. The embodiment relates to a specific process for acquiring text information corresponding to a current-level option group by computer equipment. On the basis of the above embodiment, as shown in fig. 4, the above S101 includes:
s201, displaying each option of the current-level option group on the current web page by executing the calling script.
Specifically, each option in the current-level option group has a corresponding class attribute. The class attribute corresponding to the option is used for representing whether the option is displayed on the current web page. Optionally, the process of displaying, by the computer device, each option of the current-level option group on the current page by executing the call script may be: the computer device may change the class attribute of each option of the current level option group to a visible state by executing the call script so that each option of the current level option group is displayed on the current page. The visible state may be represented by a visible, and may of course be represented by other manners, and the representation manner of the visible state is not limited in this embodiment of the application.
S202, acquiring the text attribute of each option by executing the operation script to obtain the text information of each option.
According to the option selection method of the multi-stage linkage component, the computer device displays each option of the current-stage option group on the current web page by executing the call script, and obtains the text attribute of each option by executing the operation script so as to obtain the text information of each option. The computer equipment acquires the text attribute of each option in the current-level option group based on the cooperation of the calling script and the operation script so as to obtain the text information of each option. Therefore, the computer equipment can match the acquired text information of each option with the reference text, so that the current-level target option is determined, and the determined current-level target option is selected by combining the calling script and the operation script. Therefore, when the tested hardware environment changes, the computer equipment can select options of the multi-level linkage assembly, so that the efficiency of automatic testing is improved, and the robustness of the testing script is improved.
Optionally, before S102, the method further includes: and changing the class attribute of each option of the current-level option group from a visible state to an invisible state and changing the display attribute of each option of the current-level option group to none through the calling script so as to enable each option of the current-level option group on the current web page to be in a hidden state.
In summary, the computer device modifies the class attribute and the display attribute of each option in the current-level option group by executing the call script, so that each option in the current-level option group is in a hidden state, the content of human-computer interaction is richer, and the intelligence of human-computer interaction is improved.
Fig. 5 is a flowchart illustrating a method for selecting options of a multi-stage linkage assembly according to another embodiment. The embodiment relates to a specific process of how the computer device selects the next level target option. On the basis of the above embodiment, as shown in fig. 5, after the above S102, the method further includes:
s301, acquiring a next-level option group of the current group option group.
The present level option group and the next level option group have linkage relation, thus, after the computer equipment selects the present level target option, the next level options linked with the present level target option can be automatically loaded.
S302, judging whether the number of the options in the next level option group is equal to 1. If so, go to step S303, otherwise, go to step S304.
S303, determining one option in the next-level option group as a next-level target option.
When the number of the options in the next-level option group is equal to 1, the computer equipment determines the option as a next-level target option and selects the next-level target option through the operation script. Continuing with the example of the multi-stage linkage assembly shown in fig. 3, when the first-stage target option is beijing, after the computer device selects beijing, the number of options in the automatically loaded second-stage option group is only 1 (which is beijing). At this time, the computer device can directly determine Beijing as a secondary target option and select Beijing through the operation script.
S304, taking the next level option group as a new current level option group, and executing the text acquisition operation.
When the number of the options in the next-level option group is not equal to 1, the computer equipment acquires the text information corresponding to the next-level option group through the matching of the calling script and the operation script, then matches the reference text of the next level with the text information corresponding to the next-level option group, determines the next-level target option corresponding to the next-level reference text, and selects the next-level target option through the matching of the calling script and the operation script.
According to the option selection method of the multi-stage linkage assembly, the computer equipment can determine the selection process of the next-stage target option according to the number of options in the next-stage option group, and when the number of options in the next-stage option group is equal to 1, the option can be directly determined to be the next-stage target option and can be directly selected through the operation script. Therefore, the process of selecting options of the multi-stage linkage assembly by the computer equipment is simplified, and the efficiency of automatic testing is further improved.
Fig. 6 is a schematic flowchart of an option selection method of a multi-stage linkage assembly according to another embodiment. The embodiment relates to a specific process of how the computer device selects the current-stage target option through the cooperation of the calling script and the operation script. On the basis of the foregoing embodiment, as shown in fig. 6, the process of the computer device in S102 selecting the current-stage target option through cooperation of the calling script and the operation script includes:
s401, through the calling script, changing the class attribute of the current-level target option from an invisible state to a visible state, and changing the display attribute of the current-level target option from none to null so as to display the current-level target option on the current web page.
S402, deleting the component mask of the multi-stage linkage component through the calling script.
And S403, selecting the current-level target option through the operation script.
In summary, the computer device modifies the class attribute and the display attribute of the determined current-level target option by executing the call script, so that the current-level target option is separately displayed on the current web page. Because the operation script selects the options based on the class attribute of the options, and only the class attribute of the current-level target option is in a visible state on the current web page, the current-level target option can be selected by executing the operation script.
In a practical application scenario, limited by the screen size of the computer device, the current level target option is not displayed within the current web page display frame. In order to facilitate the operation script to select the current-level target option, optionally before S402, the method further includes: and placing the current-level target option at the top of the current-level option group through the calling script.
According to the option selection method of the multi-stage linkage component, computer equipment modifies the class attribute and the display attribute of the determined current-stage target option by executing a call script, so that the current-stage target option is independently displayed on the current web page. Because the operation script selects the options based on the class attribute of the options when selecting the options, and only the class attribute of the current-level target option on the current web page is in a visible state, the current-level target option can be selected by executing the operation script. Therefore, when the tested hardware environment changes, the computer equipment can select options of the multi-level linkage assembly, so that the efficiency of automatic testing is improved, and the robustness of the testing script is improved.
For the understanding of those skilled in the art, the process of the present application is described by taking the current-stage option group as the one-stage option group, and the linkage stage number of the multi-stage linkage assembly as 3 stages. Specifically, as shown in fig. 7, the method may include:
s501, acquiring text information corresponding to the first-level option group loaded on the current web page through the matching of the calling script and the operation script.
Optionally, the computer device may obtain the text information corresponding to the primary option group in the following manner: and the computer equipment displays each option of the primary option group on the current web page by executing the calling script, and acquires the text attribute of each option by executing the operating script so as to obtain the text information of each option.
Optionally, before S502, the method further includes: and the computer equipment changes the class attribute of each option of the primary option group from a visible state to an invisible state and changes the display attribute of each option of the primary option group to none by executing the calling script, so that each option of the primary option group on the current web page is in a hidden state.
S502, matching the first-level parameter entering text with the text information corresponding to the first-level option group, determining a current-level target option corresponding to the first-level parameter entering text, and selecting the first-level target option through the matching of a calling script and an operating script.
Optionally, the process of the computer device selecting the primary target option by matching the call script and the operation script may be: through calling a script, changing the class attribute of the primary target option from an invisible state to a visible state, and changing the display attribute of the primary target option from none to null so as to display the primary target option on the current web page; deleting the component mask of the multi-stage linkage component by calling a script; the primary target option is selected by the operation script.
Optionally, before the computer device deletes the component mask of the multi-level linkage component by calling the script, the method further includes: and the computer equipment places the primary target option at the top of the option group through the calling script.
And S503, acquiring a secondary option group.
S504, judging whether the number of the options in the secondary option group is equal to 1. If so, then S505 is executed, otherwise, S506 is executed.
And S505, determining one option in the secondary option group as a secondary target option, and selecting the secondary target option through the operation script.
S506, acquiring text information corresponding to the secondary option group loaded on the current web page through the matching of the calling script and the operation script.
And by analogy, after the computer equipment selects the second-level target option according to the second-level parameter entering text, the computer equipment acquires the third-level option group and judges whether the number of options in the third-level option group is equal to 1. If yes, taking one option in the three-level option group as a three-level target option, and selecting the three-level target option through the operation script; if not, acquiring text information corresponding to the three-level option group loaded on the current web page through the matching of the calling script and the operation script, matching the three-level entry text with the text information corresponding to the three-level option group, determining a three-level target option corresponding to the three-level entry text, and selecting the determined three-level target option through the matching of the calling script and the operation script.
It should be understood that, although the steps in the flowcharts of fig. 1 to 7 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-7 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least some of the sub-steps or stages of other steps.
FIG. 8 is an alternative selection apparatus for a multi-stage linkage assembly according to one embodiment. As shown in fig. 8, the apparatus may include: a first obtaining module 10, a first determining module 11 and a selecting module 12.
Specifically, the first obtaining module 10 is configured to obtain, through cooperation of a call script and an operation script, text information corresponding to a current-level option group loaded on a current web page; the text information of the current-stage option group comprises the text information of each option in the current-stage option group;
a first determining module 11, configured to match a reference text with text information corresponding to the current-level option group, and determine a current-level target option corresponding to the reference text;
and the selection module 12 is configured to select the current-level target option through cooperation between the call script and the operation script.
The option selection device of the multi-stage linkage assembly provided by the embodiment can implement the method embodiment, and the implementation principle and the technical effect are similar, and are not described herein again.
FIG. 9 illustrates an alternative selection apparatus for a multi-stage linkage assembly according to another embodiment. On the basis of the embodiment shown in fig. 8, optionally, as shown in fig. 9, the first obtaining module 10 may include: a display unit 101 and an acquisition unit 102.
Specifically, the display unit 101 is configured to display each option of the current-level option group on a current web page by executing the call script;
an obtaining unit 102, configured to obtain text attributes of the options by executing the operation script, so as to obtain text information of the options.
The calling script is a JavaScript language, and the operating script is a java language or a python language.
The option selection device of the multi-stage linkage assembly provided by this embodiment may implement the method embodiments described above, and the implementation principle and technical effects are similar, which are not described herein again.
FIG. 10 is an alternative embodiment of a multi-stage linkage assembly option selection device. On the basis of the above embodiment, optionally, as shown in fig. 10, the apparatus further includes: a second obtaining module 13, a judging module 14, a second determining module 15 and a processing module 16.
A second obtaining module 13, configured to obtain a next-level option group of the current group option group after the selecting module 12 selects the current-level target option through cooperation between the calling script and the operation script;
a judging module 14, configured to judge whether the number of options in the next-level option group is equal to 1;
a second determining module 15, configured to determine, when the determining module 14 determines that the number of options in the next-level option group is equal to 1, one option in the next-level option group as a next-level target option;
a processing module 16, configured to execute the text obtaining operation when the determining module 14 determines that the number of options in the next-level option group is not equal to 1.
Optionally, the display unit 101 is specifically configured to change the class attribute of each option in the current-level option group to a visible state by executing the call script, so that each option in the current-level option group is displayed on the current web page.
FIG. 11 illustrates an alternative selection device for a multi-stage linkage assembly according to another embodiment. On the basis of the above embodiment, optionally, as shown in fig. 11, the apparatus further includes: a modification module 17.
Specifically, the changing module 17 is configured to change, by the call script, a class attribute of each option of the current-level option group from a visible state to an invisible state and change a display attribute of each option of the current-level option group to none before the first determining module 11 matches the current-level entry parameter text with the text information corresponding to the current-level option group, so that each option of the current-level option group on the current page is in a hidden state.
FIG. 12 is a schematic view of an alternative selection device for a multi-stage linkage assembly according to another embodiment. On the basis of the above embodiment, optionally, as shown in fig. 12, the selecting module 12 includes: a change unit 121, a deletion unit 122, and a selection unit 123.
Specifically, the changing unit 121 is configured to change, through the call script, the class attribute of the current-level target option from an invisible state to a visible state, and change the display attribute of the current-level target option from none to null, so that the current-level target option is displayed on the current web page;
a deleting unit 122, configured to delete the component mask of the multi-stage linkage component through the calling script;
a selecting unit 123, configured to select the current-level target option through the operation script.
The option selection device of the multi-stage linkage assembly provided by the embodiment can implement the method embodiment, and the implementation principle and the technical effect are similar, and are not described herein again.
FIG. 13 is a schematic view of an alternative selection device for a multi-stage linkage assembly according to another embodiment. On the basis of the above embodiment, optionally, as shown in fig. 13, the selecting module 12 further includes: a processing unit 124.
Specifically, the processing unit 124 is configured to place the current-stage target option at the top of the current-stage option group through the calling script before the deleting unit 122 deletes the component mask of the multi-stage linkage component through the calling script.
The option selection device of the multi-stage linkage assembly provided by this embodiment may implement the method embodiments described above, and the implementation principle and technical effects are similar, which are not described herein again.
For specific definition of the option selection device of the multi-stage linkage assembly, reference may be made to the above definition of the option selection method of the multi-stage linkage assembly, and details are not repeated here. All or part of each module in the option selection device of the multi-stage linkage assembly can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, the internal structure of which may be as shown in FIG. 1. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of option selection for a multi-level linkage assembly. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 1 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
performing a text acquisition operation, the text acquisition operation comprising: acquiring text information corresponding to a current-level option group loaded by a current web page through the matching of a calling script and an operating script; the text information of the current-stage option group comprises the text information of each option in the current-stage option group;
matching the reference text with the text information corresponding to the current-level option group, determining the current-level target option corresponding to the reference text, and selecting the current-level target option through the matching of the calling script and the operation script.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
displaying each option of the current-level option group on a current web page by executing the calling script; and acquiring the text attribute of each option by executing the operation script to obtain the text information of each option. The calling script is a JavaScript language, and the operating script is a java language or a python language.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a next-level option group of the current group option group; judging whether the number of the options in the next level option group is equal to 1; if yes, determining one option in the next-level option group as a next-level target option; and if not, taking the next level option group as a new current level option group, and executing the text acquisition operation.
In one embodiment, the processor when executing the computer program further performs the steps of:
and changing the class attribute of each option of the current-level option group into a visible state by executing the call script so that each option of the current-level option group is displayed on the current web page.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
changing the class attribute of each option of the current-level option group from a visible state to an invisible state and changing the display attribute of each option of the current-level option group to none through the calling script, so that each option of the current-level option group on the current page is in a hidden state.
In one embodiment, the processor when executing the computer program further performs the steps of:
changing the class attribute of the current-level target option from an invisible state to a visible state and changing the display attribute of the current-level target option from none to null through the calling script so as to display the current-level target option on the current web page;
deleting a component mask of the multi-stage linkage component through the calling script;
and selecting the current-level target option through the operation script.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and placing the current-level target option at the top of the current-level option group through the calling script.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
performing a text acquisition operation, the text acquisition operation comprising: acquiring text information corresponding to a current-level option group loaded by a current web page through the matching of a calling script and an operation script; the text information of the current-stage option group comprises the text information of each option in the current-stage option group;
matching the reference text with the text information corresponding to the current-stage option group, determining the current-stage target option corresponding to the reference text, and selecting the current-stage target option through the matching of the calling script and the operating script.
In one embodiment, the computer program when executed by the processor further performs the steps of:
displaying each option of the current-level option group on a current web page by executing the calling script; and acquiring the text attribute of each option by executing the operation script to obtain the text information of each option. The calling script is a JavaScript language, and the operating script is a java language or a python language.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a next-level option group of the current group option group; judging whether the number of options in the next level option group is equal to 1; if yes, determining one option in the next-level option group as a next-level target option; and if not, taking the next level option group as a new current level option group, and executing the text acquisition operation.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and changing the class attribute of each option of the current-level option group into a visible state by executing the calling script so as to display each option of the current-level option group on the current web page.
In one embodiment, the computer program when executed by the processor further performs the steps of:
changing the class attribute of each option of the current-level option group from a visible state to an invisible state and changing the display attribute of each option of the current-level option group to none through the calling script, so that each option of the current-level option group on the current page is in a hidden state.
In one embodiment, the computer program when executed by the processor further performs the steps of:
changing the class attribute of the current-level target option from an invisible state to a visible state and changing the display attribute of the current-level target option from none to null through the calling script so as to display the current-level target option on the current web page; deleting the component mask of the multi-stage linkage component through the calling script; and selecting the current-level target option through the operation script.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and placing the current-level target option at the top of the current-level option group through the calling script.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct Rambus Dynamic RAM (DRDRAM), and Rambus Dynamic RAM (RDRAM), among others.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is specific and detailed, but not to be understood as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present patent application shall be subject to the appended claims.

Claims (10)

1. A method of selecting options for a multi-stage linkage assembly, the multi-stage linkage assembly comprising a plurality of stages of groups of options, the method comprising:
performing a text acquisition operation, the text acquisition operation comprising: acquiring text information corresponding to a current-level option group loaded by a current web page through the matching of a calling script and an operation script; the text information of the current-stage option group comprises the text information of each option in the current-stage option group;
matching the current-stage entry parameter text with the text information corresponding to the current-stage option group, determining the current-stage target option corresponding to the entry parameter text, and selecting the current-stage target option through the matching of the calling script and the operating script.
2. The method of claim 1, wherein the calling script is a JavaScript language, and the operating script is a java language or a python language;
the acquiring the text information corresponding to the current-level option group loaded by the current web page through the matching of the calling script and the operation script comprises the following steps:
displaying each option of the current-level option group on a current web page by executing the calling script;
and acquiring the text attribute of each option by executing the operation script to obtain the text information of each option.
3. The method of claim 1, wherein after selecting the current level target option through cooperation of the calling script and the operating script, the method further comprises:
acquiring a next-level option group of the current-level option group;
judging whether the number of the options in the next level option group is equal to 1;
if yes, determining one option in the next-level option group as a next-level target option;
if not, taking the next level option group as a new current level option group, and executing the text acquisition operation.
4. The method of claim 2, wherein said displaying the options of the current level group of options on the current web page by executing the calling script comprises:
and changing the class attribute of each option of the current-level option group into a visible state by executing the calling script so as to display each option of the current-level option group on the current web page.
5. The method of claim 4, wherein before matching the reference text with the text information corresponding to the current group of options, the method further comprises:
and changing the class attribute of each option of the current-level option group from a visible state to an invisible state and changing the display attribute of each option of the current-level option group to none through the calling script so as to enable each option of the current-level option group on the current page to be in a hidden state.
6. The method of claim 5, wherein selecting the current level target option through cooperation of the calling script and the operation script comprises:
changing the class attribute of the current-level target option from an invisible state to a visible state and changing the display attribute of the current-level target option from none to null through the calling script so as to display the current-level target option on the current web page;
deleting a component mask of the multi-stage linkage component through the calling script;
and selecting the current-level target option through the operation script.
7. The method of claim 6, wherein prior to said deleting a component mask for the multi-level linkage component via the calling script, the method further comprises:
and placing the current-level target option at the top of the current-level option group through the calling script.
8. An option selection device for a multi-stage linkage assembly, the multi-stage linkage assembly including a plurality of stages of option groups, the device comprising:
the first acquisition module is used for acquiring text information corresponding to a current-level option group loaded on a current web page through the matching of a calling script and an operation script; the text information of the current-stage option group comprises the text information of each option in the current-stage option group;
the first determining module is used for matching the reference text with the text information corresponding to the current-level option group and determining the current-level target option corresponding to the reference text;
and the selection module is used for selecting the current-level target option through the matching of the calling script and the operation script.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN201811353786.XA 2018-11-14 2018-11-14 Method, device, equipment and storage medium for selecting options of multi-stage linkage assembly Active CN111190574B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811353786.XA CN111190574B (en) 2018-11-14 2018-11-14 Method, device, equipment and storage medium for selecting options of multi-stage linkage assembly

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811353786.XA CN111190574B (en) 2018-11-14 2018-11-14 Method, device, equipment and storage medium for selecting options of multi-stage linkage assembly

Publications (2)

Publication Number Publication Date
CN111190574A CN111190574A (en) 2020-05-22
CN111190574B true CN111190574B (en) 2023-03-10

Family

ID=70707233

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811353786.XA Active CN111190574B (en) 2018-11-14 2018-11-14 Method, device, equipment and storage medium for selecting options of multi-stage linkage assembly

Country Status (1)

Country Link
CN (1) CN111190574B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515707B (en) * 2020-09-21 2024-02-09 腾讯科技(深圳)有限公司 Data processing method, intelligent device, intelligent equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103873318A (en) * 2012-12-18 2014-06-18 阿里巴巴集团控股有限公司 Website automated testing method and automated testing system
CN105426305A (en) * 2015-11-03 2016-03-23 上海斐讯数据通信技术有限公司 Control attribute analysis system and method
CN108170611A (en) * 2018-01-23 2018-06-15 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
EP3343378A1 (en) * 2016-12-30 2018-07-04 Accenture Global Solutions Limited Device-based visual test automation
CN108280026A (en) * 2018-01-23 2018-07-13 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007118271A1 (en) * 2006-04-13 2007-10-25 Todaycom Pty Ltd A method and system and product for conditioning software

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103873318A (en) * 2012-12-18 2014-06-18 阿里巴巴集团控股有限公司 Website automated testing method and automated testing system
CN105426305A (en) * 2015-11-03 2016-03-23 上海斐讯数据通信技术有限公司 Control attribute analysis system and method
EP3343378A1 (en) * 2016-12-30 2018-07-04 Accenture Global Solutions Limited Device-based visual test automation
CN108170611A (en) * 2018-01-23 2018-06-15 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN108280026A (en) * 2018-01-23 2018-07-13 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment

Also Published As

Publication number Publication date
CN111190574A (en) 2020-05-22

Similar Documents

Publication Publication Date Title
CN111061526B (en) Automatic test method, device, computer equipment and storage medium
KR20180103881A (en) Test method, system, apparatus and readable storage medium
CN111414309B (en) Automatic test method of application program, computer equipment and storage medium
CN110955418A (en) Code generation method and device, computer equipment and storage medium
CN109189686A (en) Automation regression testing method, apparatus, storage medium and computer equipment
CN112748843B (en) Page switching method and device, computer equipment and storage medium
CN110659092A (en) Webpage screenshot method and device, computer equipment and storage medium
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN103870123A (en) Information processing method and electronic equipment
CN111596911A (en) Method and device for generating control, computer equipment and storage medium
CN114461533A (en) Method, system, electronic device and storage medium for automatic testing of Web page
CN112130729A (en) Page processing method and device, computer equipment and storage medium
CN104156305A (en) Application program testing method and device
CN117290236A (en) Software testing method, device, computer equipment and computer readable storage medium
CN112015378A (en) Skeleton screen page generation method and device, computer equipment and storage medium
CN111190574B (en) Method, device, equipment and storage medium for selecting options of multi-stage linkage assembly
CN113467862A (en) Desktop shortcut generation method and device, mobile terminal and storage medium
CN107102937B (en) User interface testing method and device
CN110232018A (en) Interface test method, device, computer equipment
CN109448120A (en) Processing method, device and the computer equipment of three-dimensional building model
CN110007833A (en) A kind of intelligence programming implementation method and device realized terminal screen and roll screenshot
CN109815127B (en) Automatic script conversion method and device, computer equipment and storage medium
CN113672826B (en) Page jump method, device, computer equipment and storage medium
CN111159027B (en) Automatic testing method and device, computer equipment and readable storage medium
CN116521567A (en) Buried point testing method and device, vehicle 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
GR01 Patent grant
GR01 Patent grant