CN111949510B - Test processing method, device, electronic equipment and readable storage medium - Google Patents

Test processing method, device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN111949510B
CN111949510B CN201910415023.1A CN201910415023A CN111949510B CN 111949510 B CN111949510 B CN 111949510B CN 201910415023 A CN201910415023 A CN 201910415023A CN 111949510 B CN111949510 B CN 111949510B
Authority
CN
China
Prior art keywords
page
test
icon
identification mode
background color
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
CN201910415023.1A
Other languages
Chinese (zh)
Other versions
CN111949510A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910415023.1A priority Critical patent/CN111949510B/en
Publication of CN111949510A publication Critical patent/CN111949510A/en
Application granted granted Critical
Publication of CN111949510B publication Critical patent/CN111949510B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a test processing method, a test processing device, electronic equipment and a readable storage medium, wherein the test processing method comprises the following steps: acquiring a test page and a page element identification mode, wherein the page element identification mode comprises at least one of an icon identification mode, a box identification mode, a background color identification mode, a text identification mode and a picture identification mode; identifying at least one page element in the test page according to the identification mode of the page element; and executing test processing on the identified at least one page element to obtain a test result of the test page. The method can greatly improve the universality of the test, and further greatly improve the efficiency of the test.

Description

Test processing method, device, electronic equipment and readable storage medium
Technical Field
Embodiments of the present invention relate to computer technologies, and in particular, to a test processing method, a test processing device, an electronic device, and a readable storage medium.
Background
With the continuous development of mobile internet and mobile terminal technologies, more and more users access the mobile internet through mobile terminals to meet various demands of the users. A variety of web pages and Applications (APP) can be run on the mobile terminal, and these web pages and APP need to be tested before being formally released. Because the brands and models of mobile terminals on the market are numerous, various mobile terminals can be different in screen size and browser brands, and therefore, the display of the same webpage or APP on mobile terminals of different brands and models can be different, so how to efficiently realize the test of the webpage or APP on the mobile terminals of different brands and models is a problem to be solved.
In the prior art, two testing methods are proposed, in the first method, a web page display in a mobile terminal is simulated through a PC browser, and page elements are positioned and tested based on unique identifiers of the page elements in the web page. In the second method, page elements are located and tested by a specific APP test tool based on unique identification of the page elements in the APP. Wherein the unique identification of the page element is defined by the developer of the web page or APP during the development process.
However, the method in the prior art cannot adapt to mobile terminals with various brands and models or can not adapt to various page types, so that the universality of the test is low, and the test efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a test processing method, a test processing device, electronic equipment and a readable storage medium, which are used for solving the problem of low test universality in the prior art.
A first aspect of an embodiment of the present invention provides a test processing method, including:
Acquiring a test page and a page element identification mode, wherein the page element identification mode comprises at least one of an icon identification mode, a box identification mode, a background color identification mode, a text identification mode and a picture identification mode;
identifying at least one page element in the test page according to the identification mode of the page element;
And executing test processing on the identified at least one page element to obtain a test result of the test page.
Further, the executing test processing on the identified at least one page element to obtain a test result of the test page includes:
determining corresponding operation of each page element according to the identified at least one page element;
respectively executing corresponding operation of the page elements on each page element to obtain an operation result;
and determining the test result of the test page according to the operation result.
Further, the icon recognition mode is used for recognizing a first element belonging to a preset icon and a position of the first element in the test page, the box recognition mode is used for recognizing a second element belonging to a box and a position of the second element in the test page, the background color recognition mode is used for recognizing a third element belonging to a preset background color and a position of the third element in the test page, the character recognition mode is used for recognizing characters corresponding to the elements of the test page, and the picture recognition mode is used for recognizing a fourth element belonging to a picture and a position of the fourth element in the test page.
Further, the identifying at least one page element in the test page according to the identification manner of the page element includes:
and inputting the test page into a neural network to obtain the first element belonging to a preset icon and the position of the first element in the test page output by the neural network.
Further, before the step of inputting the test page into the neural network to obtain the first element belonging to the preset icon and the position of the first element in the test page output by the neural network, the method further includes:
Training the neural network using a training page comprising the preset icon.
Further, the obtaining the identification mode of the test page and the page element includes:
Reading a test case, wherein the test case comprises an acquisition address of the test page and an identification mode of the page element;
And acquiring the test page according to the acquisition address of the test page.
Further, the acquired addresses of the test pages comprise the acquired addresses of the test pages in a plurality of mobile terminals;
the step of obtaining the test page according to the obtained address of the test page includes:
And respectively acquiring the test pages from the plurality of mobile terminals according to the acquired addresses of the test pages in the plurality of mobile terminals.
Further, the executing the corresponding operation of the page element on each page element to obtain an operation result includes:
And respectively executing corresponding operation of the page elements on each page element according to the test case to obtain an operation result.
A second aspect of an embodiment of the present invention provides a test processing apparatus, including:
The acquisition module is used for acquiring the identification modes of the test page and the page elements, wherein the identification modes comprise at least one of an icon identification mode, a box identification mode, a background color identification mode, a text identification mode and a picture identification mode.
And the identification module is used for identifying at least one page element in the test page according to the identification mode of the page element.
And the test module is used for executing test processing on the identified at least one page element to obtain a test result of the test page.
Further, the test module includes:
And the first determining unit is used for determining corresponding operation of each page element according to the identified at least one page element.
And the operation unit is used for respectively executing the corresponding operation of the page elements on each page element to obtain an operation result.
And the second determining unit is used for determining the test result of the test page according to the operation result.
Further, the icon recognition mode is used for recognizing a first element belonging to a preset icon and a position of the first element in the test page, the box recognition mode is used for recognizing a second element belonging to a box and a position of the second element in the test page, the background color recognition mode is used for recognizing a third element belonging to a preset background color and a position of the third element in the test page, the character recognition mode is used for recognizing characters corresponding to the elements of the test page, and the picture recognition mode is used for recognizing a fourth element belonging to a picture and a position of the fourth element in the test page.
Further, the identification module includes:
the identification unit is used for inputting the test page into a neural network to obtain the first element belonging to a preset icon and the position of the first element in the test page output by the neural network.
Further, the method further comprises the following steps:
and the training module is used for training the neural network by using a training page comprising the preset icon.
Further, the obtaining module includes:
The reading unit is used for reading a test case, wherein the test case comprises an acquisition address of the test page and an identification mode of the page element;
and the acquisition unit is used for acquiring the test page according to the acquisition address of the test page.
Further, the acquired addresses of the test pages comprise the acquired addresses of the test pages in a plurality of mobile terminals;
The acquisition unit is specifically configured to:
And respectively acquiring the test pages from the plurality of mobile terminals according to the acquired addresses of the test pages in the plurality of mobile terminals.
Further, the operation unit is specifically configured to:
And respectively executing corresponding operation of the page elements on each page element according to the test case to obtain an operation result.
A third aspect of an embodiment of the present invention provides an electronic device, including:
A memory for storing program instructions;
And the processor is used for calling and executing the program instructions in the memory and executing the method steps in the first aspect.
A fourth aspect of the embodiments of the present invention provides a readable storage medium having stored therein a computer program for executing the method according to the first aspect.
A fifth aspect of embodiments of the present invention provides a computer program product comprising: a computer program stored in a readable storage medium, from which it can be read by at least one processor of an electronic device, the at least one processor executing the computer program causing the electronic device to perform the method of the first aspect. The electronic device may be, for example, a test device.
According to the test processing method, the device, the electronic equipment and the readable storage medium, various page elements in a test page can be automatically identified according to the identification method corresponding to the page elements, including at least one of an icon identification mode, a box identification mode, a background color identification mode, a text identification mode and a picture identification mode, and then test processing can be performed on the elements. The method directly identifies the page elements by at least one of an icon identification mode, a box identification mode, a background color identification mode, a text identification mode and a picture identification mode, so that the method can be used for carrying out page testing no matter what brand and model of the test page is in the mobile terminal, no matter whether the test page belongs to an APP page or a webpage, and meanwhile, the method does not need to rely on unique identification marked by a developer, therefore, the method can greatly improve the universality of testing, and further greatly improve the efficiency of testing. In addition, the method is directly applied to the real mobile terminal for testing the webpage or the APP page, so that the page style actually accessed by the user can be obtained, and the accuracy of the test result can be improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description of the embodiments or the drawings used in the description of the prior art will be given in brief, it being obvious that the drawings in the description below are some embodiments of the invention and that other drawings can be obtained from them without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a system architecture of a test processing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a test processing method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a test processing method according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of a test processing method according to an embodiment of the present invention;
FIG. 5 is a block diagram of a test processing device according to an embodiment of the present invention;
FIG. 6 is a block diagram of a test processing device according to an embodiment of the present invention;
FIG. 7 is a block diagram of a test processing device according to an embodiment of the present invention;
FIG. 8 is a block diagram of a test processing device according to an embodiment of the present invention;
FIG. 9 is a block diagram of a test processing device according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an electronic device 1000 according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the existing first method, a web page display in a mobile terminal is simulated through a PC browser, and page elements are positioned and tested based on unique identifiers of the page elements in the web page. The method can not completely simulate the real page condition under the condition of a multi-machine browser, and meanwhile, the method also needs to rely on unique identification marked by a developer. In the second method, page elements are located and tested by a particular APP test tool based on their unique identification in the APP. The method cannot accurately position the webpage loaded by the browser of the mobile terminal, and cannot accurately position the webpage nested in the APP, and meanwhile, the method also depends on the unique identification marked by the developer.
As can be seen from the above, the method in the prior art cannot adapt to mobile terminals of various brands and models or cannot adapt to various page types, and meanwhile, the method in the prior art needs to rely on unique identifiers marked by developers, so that the universality of testing is low, and the testing efficiency is low.
Based on the above problems, the embodiment of the invention provides a test processing method, which can automatically identify various page elements in a test page according to a page element identification method, including at least one of an icon identification mode, a box identification mode, a background color identification mode, a text identification mode and a picture identification mode, so that corresponding test operations can be executed for the page elements. The method directly identifies the page elements by at least one of an icon identification mode, a box identification mode, a background color identification mode, a text identification mode and a picture identification mode, so that the method can be used for carrying out page testing no matter what brand and model of the test page is in the mobile terminal, no matter whether the test page belongs to an APP page or a webpage, and meanwhile, the method does not need to rely on unique identification marked by a developer, therefore, the method can greatly improve the universality of testing, and further greatly improve the efficiency of testing. In addition, the method is directly applied to the real mobile terminal for testing the webpage or the APP page, so that the page style actually accessed by the user can be obtained, and the accuracy of the test result can be improved.
Fig. 1 is a schematic diagram of a system architecture of a test processing method according to an embodiment of the present invention, where, as shown in fig. 1, the method includes a test device and at least one mobile terminal to be tested. The test equipment can be a desktop computer, a notebook computer and the like, and the mobile terminal can be a tested mobile phone, a tablet computer and the like. When the number of the mobile terminals is plural, one mobile terminal cluster may be formed. The test equipment is respectively connected with each mobile terminal in a communication way. For example, each mobile terminal may be connected to the test device via a universal serial bus (Universal Serial Bus, simply USB). The test equipment acquires and executes the test case, and according to the test case, the test equipment can send operation instructions to one or a plurality of mobile terminals at the same time, for example, the instruction of intercepting a specific page and the instruction of executing the specific operation, and the test equipment also receives information such as page images and the like fed back by the mobile terminals, and determines a test result based on the information fed back by the mobile terminals.
When the test device is connected with a plurality of mobile terminals, the interfaces of each mobile terminal for communication with the test device may not be the same, and the test device may adapt the instruction to be sent to each mobile terminal to the instruction respectively matched with each mobile terminal through the driving layer of the test device and send the instruction to the corresponding mobile terminal, thereby realizing the communication between the test device and the plurality of mobile terminals.
Fig. 2 is a flow chart of a test processing method provided by an embodiment of the present invention, where an execution body of the method is the test device described above, as shown in fig. 2, and the method includes:
S201, acquiring a test page and a page element identification mode, wherein the page element identification mode comprises at least one of an icon identification mode, a box identification mode, a background color identification mode, a text identification mode and a picture identification mode.
Optionally, the test page may be a screenshot of a real page running on the mobile terminal, the mobile terminal intercepts the screenshot of the page according to an instruction of the test device, and sends the obtained screenshot to the test device, where the test device uses the screenshot as the test page.
Alternatively, the test page may be any page running on the mobile terminal, for example, an APP page, a web page, etc., which is not limited in particular by the embodiment of the present invention.
Optionally, in the embodiment of the present invention, for a test page, a set of identification methods may be used for all page elements in the test page, a set of identification methods may be used for part of the page elements, or a set of identification methods may be used for each page element, which is not limited in particular in the embodiment of the present invention.
The set of recognition modes may be one of the icon recognition mode, the box recognition mode, the background color recognition mode, the text recognition mode, and the picture recognition mode, or may be a plurality of kinds of recognition modes.
For example, for a page in an APP, a set of recognition methods is used for a phone icon element in the page, and another set of recognition methods is used for an input box element, where the set of recognition methods used for the phone icon element is: the icon recognition mode+background color recognition mode, a set of recognition modes used for inputting frame elements are as follows: block identification mode. For the phone icon element, the button element may be identified using a combination of icon identification with background color identification.
S202, identifying at least one page element in the test page according to the identification mode of the page element.
Taking the same set of recognition modes as an example for all page elements in a test page, after the recognition modes of the page elements are acquired, if the recognition modes of the page elements are one of the icon recognition mode, the box recognition mode, the background color recognition mode, the text recognition mode and the picture recognition mode, taking the result of the one recognition mode as the recognition result of the page elements. For example, using an icon recognition method for all page elements in the test page, and obtaining a result that a specific icon exists at a specific position, the test device may determine that the page element identified by the specific icon exists at the specific position.
If the recognition mode of the page element is a plurality of icon recognition modes, box recognition modes, background color recognition modes, text recognition modes and picture recognition modes, the recognition result of the page element can be comprehensively determined by combining the result of each recognition mode. For example, for all page elements in a certain test page, an icon recognition mode and a background color recognition mode are combined to obtain a recognition result, if the icon recognition mode recognizes that a specific icon exists at a specific position and the background color recognition mode recognizes that a specific background color exists at the specific position, the test device can determine whether the combination of the specific icon and the specific background color corresponds to a specific element, and if so, the test device determines that the specific element exists at the specific position.
S203, executing test processing on the identified at least one page element to obtain a test result of the test page.
Before testing the page elements, the operations that each page element needs to perform, and the expected results after performing the operations, are specified in advance by a tester. In this step, after the page elements are identified, for each page element, test processing may be performed according to information specified by the tester, so as to obtain a test result of the test page.
In this embodiment, according to the identification method corresponding to the page element, including at least one of an icon identification mode, a box identification mode, a background color identification mode, a text identification mode and a picture identification mode, various page elements in the test page can be automatically identified, and further test processing can be performed on the elements. The method directly identifies the page elements by at least one of an icon identification mode, a box identification mode, a background color identification mode, a text identification mode and a picture identification mode, so that the method can be used for carrying out page testing no matter what brand and model of the test page is in the mobile terminal, no matter whether the test page belongs to an APP page or a webpage, and meanwhile, the method does not need to rely on unique identification marked by a developer, therefore, the method can greatly improve the universality of testing, and further greatly improve the efficiency of testing. In addition, the method is directly applied to the real mobile terminal for testing the webpage or the APP page, so that the page style actually accessed by the user can be obtained, and the accuracy of the test result can be improved.
Fig. 3 is a flow chart of a test processing method according to an embodiment of the present invention, as shown in fig. 3, an alternative way of executing test processing on the identified at least one page element in the step S203 includes:
S301, determining corresponding operation of each page element according to the identified at least one page element.
Alternatively, the corresponding operation of each page element specified by the user and the expected result may be recorded in the form of a test case. By reading the test cases, the corresponding operation of each page element can be determined.
S302, respectively executing corresponding operation of the page elements on each page element to obtain an operation result.
Alternatively, the operations may include clicking, swiping, reversing, and the like.
Optionally, the operation corresponding to the page element may be recorded in advance through a test case, after the element in the test page is identified, an operation instruction is sent to the mobile terminal through a driving layer of the test device according to the operation recorded in the test case, the mobile terminal executes the corresponding operation according to the operation instruction, and returns the page screenshot after the operation to the test device after the operation is completed, where the test device uses the returned page screenshot as an operation result.
S303, determining a test result of the test page according to the operation result.
Optionally, after obtaining the screenshot as the operation result, the test device may verify whether the test result meets the expected result according to the verification information recorded by the test case. After the mobile terminal is instructed to click the "next page" button on the test page and receive the page screenshot returned by the mobile terminal, the test device may identify whether the expected page name exists in the page screenshot by using the above-mentioned text recognition method, and if so, determine that the test result meets the expected result. The test equipment can further continue to judge whether the test needs to be continued for the current screenshot based on the test case, if yes, the test is continued from the step S201, and if not, a test report of successful test can be output. If the expected page name does not exist in the page screenshot, the test result can be determined to be not in accordance with the expected result, and the test equipment can output a test report of test failure.
In an optional implementation manner, the icon identifying manner is used for identifying a first element belonging to a preset icon and a position of the first element in the test page. The box recognition mode is used for recognizing a second element belonging to the box in the test page and the position of the second element. The background color recognition mode is used for recognizing a third element belonging to a preset background color and the position of the third element in the test page. The character recognition mode is used for recognizing characters corresponding to elements of the test page. The picture identification mode is used for identifying a fourth element belonging to the picture and the position of the fourth element in the test page.
In the icon identification manner, the test device can identify a first element belonging to a preset icon in the test page and a position of the first element in the test page, wherein the first element may be one element or a plurality of elements. The preset icon is any icon in a preset icon library. For example, icons that may appear in the mobile terminal may be formed into a preset icon library in advance, and when any icon in the preset icon library is included in the test page, the icon and its position may be identified by using the icon identification manner described above. For example, the preset icons in the preset icon library may include a phone icon, a short message icon, a voice icon, and the like.
As an alternative embodiment, a neural network may be used for icon recognition. The neural network may be, for example, a convolutional neural network. Before the neural network is used for icon identification, the neural network can be trained by utilizing a training page comprising the preset icons, so that network parameters with higher accuracy can be trained. After the neural network training is completed, after the test page is acquired, the test page can be input into the neural network, and the neural network can output the first element belonging to the preset icon and the position of the first element in the test page.
In the above-mentioned block identification manner, whether an element in the test page is a block may be identified according to the position of the boundary pixel of the element. By way of example, the boxes in the test page, such as the input box, button selection box, etc., may be identified by the above-described box identification method.
In the above background color recognition method, a solid color region in a page may be recognized according to the color of a pixel in the page, and then a third element represented by the solid color region and its position may be recognized. For example, in some pages, some specific elements use a specific background color, in which case, the element corresponding to the area where the background color is located can be determined by identifying the background color.
In the above-mentioned character recognition method, characters in the test page may be recognized by a specific character recognition algorithm.
In the above-mentioned picture recognition method, the picture in the test page may be recognized by a specific picture recognition algorithm.
As described above, when identifying an element of a test page, one of the above-described various identification methods may be used, or the element identification may be performed in combination with the various identification methods therein. In the specific implementation process, the identification mode can be flexibly selected according to the actual requirement of the test page. For example, if there is a "more click load" link in the test page, the link is displayed as a box on the test page, and the background color is gray, and the "more click load" text is also displayed, then when the element is identified, the text identification mode, the box identification mode, and the background color identification mode may be combined to identify, specifically, when the "more click load" text is identified at a certain position on the test page, and the box is identified, and when the background color of the position is gray, the "more click load" link of the element at the position may be determined.
It should be noted that the first element, the second element, the third element, and the fourth element may represent different elements or may represent the same element.
As an alternative embodiment, the test device may implement one of the above by executing a pre-written test case. The test cases can be stored on the test equipment for direct execution by the test equipment, or the test is used for being stored on other equipment, and when the test is required to be performed, the test equipment acquires the test cases from the other equipment and executes the test cases. One test case may be used for one mobile terminal or may be used for a plurality of mobile terminals at the same time.
Fig. 4 is a flow chart of a test processing method provided by an embodiment of the present invention, and as shown in fig. 4, a process of obtaining, by a test device, a test page and an identification manner of a page element based on a test case includes:
S401, reading a test case, wherein the test case comprises the acquisition address of the test page and the identification mode of the page element.
Alternatively, the acquisition address of the test page may be a link to the page.
S402, acquiring the test page according to the acquisition address of the test page.
Optionally, after the test device reads the acquired address of the test page from the test case, the test device generates an instruction for the mobile terminal through the driving layer of the test device, where the instruction includes the acquired address of the test page, and the instruction is used to instruct the mobile terminal to jump to the address. After the mobile terminal jumps to the test page corresponding to the address according to the instruction, the page is subjected to screenshot, and the screenshot is returned to the test equipment, so that the test equipment acquires the test page.
As described above, one test case may be directed to one mobile terminal, or may be directed to a plurality of mobile terminals at the same time. When the test page is acquired according to the acquisition addresses of the test pages in the mobile terminals, the test page can be acquired from the mobile terminals respectively according to the acquisition addresses of the test pages in the mobile terminals, and the test can be performed by using the method for each test page. Specifically, the test equipment generates an instruction aiming at each mobile terminal through a driving layer of the test equipment, each instruction comprises an address of a test page in a corresponding terminal, and each mobile terminal respectively jumps to the test page according to the instruction and returns the screenshot to the test equipment after the screenshot.
In an alternative manner, the test case may further include an operation for the identified page element. Correspondingly, when the test equipment executes the operation corresponding to a certain page element in the test page, the test equipment can execute the operation corresponding to the page element on each page element according to the test case, so as to obtain an operation result.
In an exemplary embodiment, a clicking operation is described in a test case for a certain button element, after the test device identifies the button element by using the foregoing method, according to the operation described in the test case for the button element, it is determined that the clicking operation needs to be performed on the button element, and further, the test device sends, to the mobile terminal through a driving layer thereof, an instruction, where the instruction is used to instruct the mobile terminal to perform the clicking operation for the button element.
Fig. 5 is a block diagram of a test processing device according to an embodiment of the present invention, as shown in fig. 5, where the test processing device includes:
The obtaining module 501 is configured to obtain a test page and a recognition mode of a page element, where the recognition mode of the page element includes at least one of an icon recognition mode, a box recognition mode, a background color recognition mode, a text recognition mode, and a picture recognition mode.
And the identifying module 502 is configured to identify at least one page element in the test page according to the identifying manner of the page element.
And the test module 503 is configured to perform test processing on the identified at least one page element, so as to obtain a test result of the test page.
The device is used for realizing the foregoing method embodiments, and its implementation principle and technical effects are similar, and will not be repeated here.
Fig. 6 is a block diagram of a test processing apparatus according to an embodiment of the present invention, and as shown in fig. 6, a test module 503 includes:
A first determining unit 5031 configured to determine a corresponding operation of each of the page elements according to the identified at least one page element;
An operation unit 5032, configured to perform, for each of the page elements, a corresponding operation of the page element, to obtain an operation result;
A second determining unit 5033, configured to determine a test result of the test page according to the operation result.
In another embodiment, the icon recognition mode is used for recognizing a first element belonging to a preset icon and a position of the first element in the test page, the box recognition mode is used for recognizing a second element belonging to a box and a position of the second element in the test page, the background color recognition mode is used for recognizing a third element belonging to a preset background color and a position of the third element in the test page, the text recognition mode is used for recognizing text corresponding to an element of the test page, and the picture recognition mode is used for recognizing a fourth element belonging to a picture and a position of the fourth element in the test page.
Fig. 7 is a block diagram of a test processing device according to an embodiment of the present invention, and as shown in fig. 7, an identification module 502 includes:
the identifying unit 5021 is configured to input the test page into a neural network, and obtain the first element belonging to a preset icon and a position of the first element in the test page output by the neural network.
Fig. 8 is a block diagram of a test processing device according to an embodiment of the present invention, as shown in fig. 8, further including:
a training module 504, configured to train the neural network using a training page that includes the preset icon.
Fig. 9 is a block diagram of a test processing device according to an embodiment of the present invention, and as shown in fig. 9, an obtaining module 501 includes:
The reading unit 5011 is configured to read a test case, where the test case includes an obtained address of the test page and an identification manner of the page element.
An obtaining unit 5012, configured to obtain the test page according to the obtaining address of the test page.
In another embodiment, the acquired addresses of the test pages include acquired addresses of the test pages in a plurality of mobile terminals;
the acquisition unit 5012 is specifically configured to:
And respectively acquiring the test pages from the plurality of mobile terminals according to the acquired addresses of the test pages in the plurality of mobile terminals.
In another embodiment, the operation unit 5032 is specifically configured to execute, according to the test case, a corresponding operation of the page element on each of the page elements, so as to obtain an operation result.
It should be noted that, it should be understood that the division of the modules of the above apparatus is merely a division of a logic function, and may be fully or partially integrated into a physical entity or may be physically separated. And these modules may all be implemented in software in the form of calls by the processing element; or can be realized in hardware; the method can also be realized in a form of calling software by a processing element, and the method can be realized in a form of hardware by a part of modules. For example, the determining module may be a processing element that is set up separately, may be implemented in a chip of the above apparatus, or may be stored in a memory of the above apparatus in the form of program code, and may be called by a processing element of the above apparatus and execute the functions of the determining module. The implementation of the other modules is similar. In addition, all or part of the modules can be integrated together or can be independently implemented. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in a software form.
For example, the modules above may be one or more integrated circuits configured to implement the methods above, such as: one or more Application SPECIFIC INTEGRATED Circuits (ASIC), or one or more microprocessors (DIGITAL SIGNAL processors, DSP), or one or more field programmable gate arrays (field programmable GATE ARRAY, FPGA), etc. For another example, when a module above is implemented in the form of processing element scheduler code, the processing element may be a general purpose processor, such as a central processing unit (central processing unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk Solid STATE DISK (SSD)), etc.
Fig. 10 is a schematic structural diagram of an electronic device 1000 according to an embodiment of the present invention. The electronic device may be the test device described above. As shown in fig. 10, the electronic device may include: the system comprises a processor 101, a memory 102, a communication interface 103 and a system bus 104, wherein the memory 102 and the communication interface 103 are connected with the processor 101 through the system bus 104 and are used for completing communication among each other, the memory 102 is used for storing computer execution instructions, the communication interface 103 is used for communicating with other devices, and the processor 101 realizes the scheme of the embodiment shown in the figures 1-4 when executing the computer program.
The system bus referred to in fig. 10 may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The system bus may be classified into an address bus, a data bus, a control bus, and the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus. The communication interface is used to enable communication between the database access apparatus and other devices (e.g., clients, read-write libraries, and read-only libraries). The memory may include random access memory (random access memory, RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor may be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; but may also be a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
Optionally, an embodiment of the present invention further provides a storage medium, where instructions are stored, when the storage medium runs on a computer, to cause the computer to perform the method of the embodiment shown in fig. 1 to fig. 4.
Optionally, an embodiment of the present invention further provides a chip for executing instructions, where the chip is configured to perform the method of the embodiment shown in fig. 1 to fig. 4.
Embodiments of the present invention also provide a computer program product comprising a computer program stored in a readable storage medium, from which at least one processor of an electronic device can read, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments of fig. 1 to 4 described above. The electronic device may be, for example, a test device.
In embodiments of the present invention, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the front and rear associated objects are an "or" relationship; in the formula, the character "/" indicates that the front and rear associated objects are a "division" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). 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 plural.
It will be appreciated that the various numbers referred to in the embodiments of the present invention are merely for ease of description and are not intended to limit the scope of the embodiments of the present invention.
It should be understood that, in the embodiment of the present invention, the sequence number of each process does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (8)

1. A test processing method, comprising:
obtaining a test page and a recognition mode of page elements, wherein all page elements in the test page are combined with a background color recognition mode to obtain a recognition result, or different page elements in the test page are combined with a background color recognition mode to obtain a recognition result, a telephone icon element in the test page is combined with a background color recognition mode to obtain a recognition result, and an input frame element in the test page is combined with a box recognition mode to obtain a recognition result, wherein the combination of the icon recognition mode and the background color recognition mode to obtain the recognition result comprises the following steps: if the icon identification mode identifies that a specific icon exists at a specific position, and the background color identification mode identifies that a specific background color exists at the specific position, judging whether a combination of the specific icon and the specific background color corresponds to a specific element, if so, determining that the specific element exists at the specific position, wherein the icon identification mode is used for identifying a first element belonging to a preset icon and the position of the first element in the test page, the box identification mode is used for identifying a second element belonging to a box and the position of the second element in the test page, and the background color identification mode is used for identifying a third element belonging to the preset background color and the position of the third element in the test page;
identifying at least one page element in the test page according to the identification mode of the page element;
determining corresponding operation of each page element according to the identified at least one page element;
respectively executing corresponding operation of the page elements on each page element to obtain an operation result;
and determining the test result of the test page according to the operation result.
2. The method according to claim 1, wherein the identifying at least one page element in the test page according to the page element identification manner comprises:
and inputting the test page into a neural network to obtain the first element belonging to a preset icon and the position of the first element in the test page output by the neural network.
3. The method according to claim 2, wherein before the inputting the test page into the neural network to obtain the first element belonging to the preset icon and the position of the first element in the test page output by the neural network, the method further comprises:
Training the neural network using a training page comprising the preset icon.
4. A method according to any one of claims 1-3, wherein the obtaining the identification manner of the test page and the page element comprises:
Reading a test case, wherein the test case comprises an acquisition address of the test page and an identification mode of the page element;
And acquiring the test page according to the acquisition address of the test page.
5. The method of claim 4, wherein the acquisition address of the test page comprises acquisition addresses of the test page in a plurality of mobile terminals;
the step of obtaining the test page according to the obtained address of the test page includes:
And respectively acquiring the test pages from the plurality of mobile terminals according to the acquired addresses of the test pages in the plurality of mobile terminals.
6. A test handler, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a test page and an identification mode of page elements, all page elements in the test page are combined with a background color identification mode to obtain an identification result by using an icon identification mode, or different page elements in the test page are combined with a background color identification mode to obtain an identification result by using an icon identification mode, and input frame elements in the test page are combined with a background color identification mode to obtain an identification result by using a box identification mode, wherein the identification result is obtained by combining the icon identification mode with the background color identification mode, and the processing module comprises the following steps: if the icon identification mode identifies that a specific icon exists at a specific position, and the background color identification mode identifies that a specific background color exists at the specific position, judging whether a combination of the specific icon and the specific background color corresponds to a specific element, if so, determining that the specific element exists at the specific position, wherein the icon identification mode is used for identifying a first element belonging to a preset icon and the position of the first element in the test page, the box identification mode is used for identifying a second element belonging to a box and the position of the second element in the test page, and the background color identification mode is used for identifying a third element belonging to the preset background color and the position of the third element in the test page;
The identification module is used for identifying at least one page element in the test page according to the identification mode of the page element;
The testing module is used for determining corresponding operation of each page element according to the identified at least one page element; respectively executing corresponding operation of the page elements on each page element to obtain an operation result; and determining the test result of the test page according to the operation result.
7. An electronic device, comprising:
A memory for storing program instructions;
a processor for invoking and executing program instructions in said memory to perform the method of any of claims 1-5.
8. A readable storage medium, characterized in that the readable storage medium has stored therein a computer program for executing the method of any of claims 1-5.
CN201910415023.1A 2019-05-17 2019-05-17 Test processing method, device, electronic equipment and readable storage medium Active CN111949510B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910415023.1A CN111949510B (en) 2019-05-17 2019-05-17 Test processing method, device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910415023.1A CN111949510B (en) 2019-05-17 2019-05-17 Test processing method, device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN111949510A CN111949510A (en) 2020-11-17
CN111949510B true CN111949510B (en) 2024-05-14

Family

ID=73335503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910415023.1A Active CN111949510B (en) 2019-05-17 2019-05-17 Test processing method, device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111949510B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821437A (en) * 2021-09-23 2021-12-21 北京光启元数字科技有限公司 Page testing method, device, equipment and medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013071728A1 (en) * 2011-11-18 2013-05-23 华为技术有限公司 Page testing method and page testing device
CN103873318A (en) * 2012-12-18 2014-06-18 阿里巴巴集团控股有限公司 Website automated testing method and automated testing system
CN105224462A (en) * 2015-10-27 2016-01-06 小米科技有限责任公司 The recognition methods of control element and device
CN106776301A (en) * 2016-12-01 2017-05-31 广州酷狗计算机科技有限公司 Daughter element method of testing and device
JP2017162120A (en) * 2016-03-08 2017-09-14 三菱電機株式会社 Information processor, information processing method, and information processing program
CN107239397A (en) * 2017-05-17 2017-10-10 北京微影时代科技有限公司 A kind of web automated testing methods and electronic equipment
CN107783898A (en) * 2017-07-24 2018-03-09 平安科技(深圳)有限公司 The method of testing and test equipment of Mobile solution
EP3343378A1 (en) * 2016-12-30 2018-07-04 Accenture Global Solutions Limited Device-based visual test automation
CN108509342A (en) * 2018-04-04 2018-09-07 成都中云天下科技有限公司 A kind of precisely quick App automated testing methods
CN108628741A (en) * 2018-04-10 2018-10-09 平安科技(深圳)有限公司 Webpage test method, device, electronic equipment and medium
CN108733555A (en) * 2017-04-25 2018-11-02 中移信息技术有限公司 A kind of application testing method and device
CN109086203A (en) * 2018-07-20 2018-12-25 百度在线网络技术(北京)有限公司 The detection method and device of the page
CN109271323A (en) * 2018-10-10 2019-01-25 东软集团股份有限公司 Processing method, device, test equipment and the storage medium of page elements
CN109359056A (en) * 2018-12-21 2019-02-19 北京搜狗科技发展有限公司 A kind of applied program testing method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9424167B2 (en) * 2014-05-21 2016-08-23 Cgi Technologies And Solutions Inc. Automated testing of an application system
US10445224B2 (en) * 2017-04-25 2019-10-15 Microsoft Technology Licensing, Llc Visible elements-based application testing

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013071728A1 (en) * 2011-11-18 2013-05-23 华为技术有限公司 Page testing method and page testing device
CN103873318A (en) * 2012-12-18 2014-06-18 阿里巴巴集团控股有限公司 Website automated testing method and automated testing system
CN105224462A (en) * 2015-10-27 2016-01-06 小米科技有限责任公司 The recognition methods of control element and device
JP2017162120A (en) * 2016-03-08 2017-09-14 三菱電機株式会社 Information processor, information processing method, and information processing program
CN106776301A (en) * 2016-12-01 2017-05-31 广州酷狗计算机科技有限公司 Daughter element method of testing and device
EP3343378A1 (en) * 2016-12-30 2018-07-04 Accenture Global Solutions Limited Device-based visual test automation
CN108733555A (en) * 2017-04-25 2018-11-02 中移信息技术有限公司 A kind of application testing method and device
CN107239397A (en) * 2017-05-17 2017-10-10 北京微影时代科技有限公司 A kind of web automated testing methods and electronic equipment
CN107783898A (en) * 2017-07-24 2018-03-09 平安科技(深圳)有限公司 The method of testing and test equipment of Mobile solution
CN108509342A (en) * 2018-04-04 2018-09-07 成都中云天下科技有限公司 A kind of precisely quick App automated testing methods
CN108628741A (en) * 2018-04-10 2018-10-09 平安科技(深圳)有限公司 Webpage test method, device, electronic equipment and medium
CN109086203A (en) * 2018-07-20 2018-12-25 百度在线网络技术(北京)有限公司 The detection method and device of the page
CN109271323A (en) * 2018-10-10 2019-01-25 东软集团股份有限公司 Processing method, device, test equipment and the storage medium of page elements
CN109359056A (en) * 2018-12-21 2019-02-19 北京搜狗科技发展有限公司 A kind of applied program testing method and device

Also Published As

Publication number Publication date
CN111949510A (en) 2020-11-17

Similar Documents

Publication Publication Date Title
CN109542399B (en) Software development method and device, terminal equipment and computer readable storage medium
CN109325195B (en) Rendering method and system for browser, computer device and computer storage medium
CN107783898B (en) Test method and test equipment for mobile application
US20130117855A1 (en) Apparatus for automatically inspecting security of applications and method thereof
US8660833B2 (en) Method, computer program product and apparatus for providing an interactive network simulator
CN110955409B (en) Method and device for creating resources on cloud platform
CN111597110B (en) Page test method and device, electronic equipment and storage medium
CN108111364B (en) Service system testing method and device
CN111831542B (en) API application debugging method and device and storage medium
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN111858296A (en) Interface test method, device, equipment and storage medium
CN114676040A (en) Test coverage verification method and device and storage medium
CN113268243A (en) Memory prediction method and device, storage medium and electronic equipment
CN114579452A (en) Interface influence detection method and related equipment
CN111949510B (en) Test processing method, device, electronic equipment and readable storage medium
CN111046393B (en) Vulnerability information uploading method and device, terminal equipment and storage medium
CN113377648B (en) Software system diagnosis method, device, electronic equipment and computer readable medium
CN115576711A (en) Method and system for simulating returned data and computing equipment
CN112631949A (en) Debugging method and device, computer equipment and storage medium
CN115145464B (en) Page testing method and device, electronic equipment and storage medium
CN112015650B (en) Event testing method and device based on computer vision
US20220197945A1 (en) Computer-implemented method for analyzing a transaction log
CN115629964A (en) Access method, apparatus, device, storage medium and computer program product
CN115543807A (en) Automatic regression testing method and device, computer equipment and storage medium
CN117056211A (en) Low-code automatic test method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant