CN113325976A - Application program testing method, device, equipment and storage medium - Google Patents

Application program testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN113325976A
CN113325976A CN202110583470.5A CN202110583470A CN113325976A CN 113325976 A CN113325976 A CN 113325976A CN 202110583470 A CN202110583470 A CN 202110583470A CN 113325976 A CN113325976 A CN 113325976A
Authority
CN
China
Prior art keywords
control
page
tested
position information
coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110583470.5A
Other languages
Chinese (zh)
Inventor
徐晓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110583470.5A priority Critical patent/CN113325976A/en
Publication of CN113325976A publication Critical patent/CN113325976A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/04817Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance using icons
    • 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/3684Test management for test design, e.g. generating new test cases
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/40Document-oriented image-based pattern recognition
    • G06V30/41Analysis of document content
    • G06V30/413Classification of content, e.g. text, photographs or tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Biophysics (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Multimedia (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a method, a device, equipment and a storage medium for testing an application program, wherein the method comprises the following steps: after a page to be tested of an application program on second equipment is obtained, position information of a control which can trigger page change in the page to be tested is determined, a control instruction used for triggering touch operation on the control is generated according to the position information, the control instruction is sent to the second equipment, and page change of the application program on the second equipment is monitored. The test scheme can be used for testing the application program pages of different types of equipment, has strong universality, reduces the test cost of the application program and improves the test efficiency.

Description

Application program testing method, device, equipment and storage medium
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 testing an application program.
Background
With the rapid development of the mobile internet in recent years, the application program APP also increases explosively, and the corresponding APP performance test becomes an important link before the APP is online.
Different test model need write test script alone, and the commonality of test script on different terminal test machines is poor to the test page of same section APP, because the page pattern is various, lead to efficiency of software testing lower, be unfavorable for APP's quick line-going.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for testing an application program, and the testing efficiency of the application program in different testing machine types is improved.
A first aspect of an embodiment of the present application provides a method for testing an application, which is applied to a first device, where the first device is connected to a second device, and the method includes:
acquiring a page to be tested of the application program on the second equipment, wherein the page to be tested comprises a control capable of triggering page change;
determining the position information of the control on the page to be tested;
generating a first control instruction according to the position information, wherein the first control instruction is used for triggering touch operation on the control;
sending the first control instruction to the second device;
and generating a test result according to the page change condition of the application program on the second equipment.
In an optional embodiment of the present application, the control comprises an icon control; the determining the position information of the control on the page to be tested comprises the following steps:
and determining the position information of the icon control on the page to be tested through a picture recognition model, wherein the picture recognition model is obtained based on deep learning model training.
In an optional embodiment of the present application, the control comprises a text control; the determining the position information of the control on the page to be tested comprises the following steps:
determining whether preset characters exist on the page to be tested or not through an Optical Character Recognition (OCR) technology;
and if the preset characters exist, determining the position information of the character control including the preset characters on the page to be tested.
In an optional embodiment of the present application, the determining the position information of the control on the page to be tested includes:
determining the position information of the control on the page to be tested by calling a third-party service interface; the third party service interface comprises a picture recognition service interface and/or an OCR text recognition service interface.
In an optional embodiment of the present application, the position information includes a first position coordinate of the control on the page to be tested; the generating a first control instruction according to the position information includes:
performing coordinate conversion on the first position coordinate to obtain a second position coordinate, wherein the second position coordinate is the position coordinate of the control on the second device;
and generating the first control instruction according to the second position coordinate.
In an optional embodiment of the present application, the performing coordinate transformation on the first position coordinate to obtain a second position coordinate includes:
and performing coordinate conversion on the first position coordinate according to the screen resolution of the second device to obtain the second position coordinate.
A second aspect of the embodiments of the present application provides an apparatus for testing an application, including:
the acquisition module is used for acquiring a page to be tested of the application program on the second equipment, wherein the page to be tested comprises a control capable of triggering page change;
the processing module is used for determining the position information of the control on the page to be tested;
generating a first control instruction according to the position information, wherein the first control instruction is used for triggering touch operation on the control;
a sending module, configured to send the first control instruction to the second device;
the processing module is further configured to generate a test result according to the page change condition of the application program on the second device.
In an optional embodiment of the present application, the control comprises an icon control; the processing module is specifically configured to:
and determining the position information of the icon control on the page to be tested through a picture recognition model, wherein the picture recognition model is obtained based on deep learning model training.
In an optional embodiment of the present application, the control comprises a text control; the processing module is specifically configured to:
determining whether preset characters exist on the page to be tested or not through an Optical Character Recognition (OCR) technology;
and if the preset characters exist, determining the position information of the character control including the preset characters on the page to be tested.
In an optional embodiment of the present application, the processing module is specifically configured to:
determining the position information of the control on the page to be tested by calling a third-party service interface; the third party service interface comprises a picture recognition service interface and/or an OCR text recognition service interface.
In an optional embodiment of the present application, the position information includes a first position coordinate of the control on the page to be tested; the processing module is specifically configured to:
performing coordinate conversion on the first position coordinate to obtain a second position coordinate, wherein the second position coordinate is the position coordinate of the control on the second device;
and generating the first control instruction according to the second position coordinate.
In an optional embodiment of the present application, the processing module is specifically configured to:
and performing coordinate conversion on the first position coordinate according to the screen resolution of the second device to obtain the second position coordinate.
A third aspect of embodiments of the present application provides an electronic device, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any of the first aspects.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium having stored thereon a computer program for execution by a processor to perform the method according to any one of the first aspect.
A fifth aspect of embodiments of the present application provides a computer program product comprising a computer program that, when executed by a processor, implements the method of any one of the first aspects.
The embodiment of the application provides a method, a device, equipment and a storage medium for testing an application program, wherein the method comprises the following steps: after a page to be tested of an application program on second equipment is obtained, position information of a control which can trigger page change in the page to be tested is determined, a control instruction used for triggering touch operation on the control is generated according to the position information, the control instruction is sent to the second equipment, and page change of the application program on the second equipment is monitored. The test scheme can be used for testing the application program pages of different types of equipment, has strong universality, reduces the test cost of the application program and improves the test efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a first scenario diagram of a method for testing an application according to an embodiment of the present application;
fig. 2 is a schematic view of a scenario illustrating a method for testing an application according to an embodiment of the present application;
fig. 3 is a first flowchart illustrating a method for testing an application according to an embodiment of the present application;
fig. 4 is a second flowchart illustrating a method for testing an application according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a testing apparatus for an application according to an embodiment of the present disclosure;
fig. 6 is a hardware structure diagram of an electronic device according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and in the claims, and in the drawings, of the embodiments of the application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than described or illustrated herein.
It will be understood that the terms "comprises" and "comprising," and any variations thereof, as used herein, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the description of the embodiments of the present application, the term "correspond" may indicate that there is a direct correspondence or an indirect correspondence between the two, may also indicate that there is an association between the two, and may also indicate and be indicated, configure and configured, and so on.
In the existing APP test scheme, test scripts need to be written respectively for test terminals of an android system or an IOS system, and the test scripts are not universal. The tester needs to have certain code compiling capability to compile the script, the difficulty of the tester is high, a large amount of time and energy are consumed, and the stability of script execution is low.
In order to reduce an automatic test threshold and realize a multi-terminal universal test script, the embodiment of the application provides a test method of an application program, which is used for solving the problem of automatic test of an APP page. The method is based on image recognition and Optical Character Recognition (OCR) technologies, obtains position information of page elements such as icon and character controls, generates touch control operation aiming at each page element according to the position information, achieves automatic click operation, and monitors page changes of an APP in practical application. According to the test scheme, the automatic test of the multi-terminal APP page is realized, the test cost is reduced, and the test efficiency is improved.
Before introducing the test scheme of the application program provided by the present application, first, a brief description is given to an application scenario of the test scheme.
Fig. 1 is a schematic view of a scenario of a testing method for an application according to an embodiment of the present application, as shown in fig. 1, the scenario includes a first device 11 and a second device 12, and the first device 11 is in communication connection with the second device 12.
In this embodiment, the first device 11 presets a picture identification model, where the picture identification model is used to identify the position of an icon control in a picture to be detected, and the picture identification model may be obtained based on deep learning model training. The first device 11 is also preset with an optical character recognition OCR algorithm, which can automatically recognize the text information in the picture to be detected.
In a possible implementation manner of this embodiment, the first device 11 may automatically generate a touch operation of a corresponding icon or text control in the page to be tested based on the image recognition model and/or the OCR algorithm by obtaining the page to be tested of the second device, and simulate a page click operation, thereby implementing an automatic test on the switching of the application page.
Fig. 2 is a schematic view of a second scenario of the testing method of the application program according to the embodiment of the present application, as shown in fig. 2, the scenario includes a first device 11, a second device 12, a first server 13, and a second server 14. The first device 11 is in communication connection with the second device 12, the first server 13 and the second server 14, respectively.
In this embodiment, the first server 13 presets a picture identification model, the picture identification model is used to identify the position of the icon control in the picture to be detected, and the picture identification model may be obtained based on deep learning model training. The second server 14 presets an Optical Character Recognition (OCR) algorithm, and can automatically recognize the character information in the picture to be detected.
In a possible implementation manner of this embodiment, the first device 11 may obtain the position information of the icon control or the text control in the page to be tested by calling the first interface of the first server 13 and the second interface of the second server 14, so as to generate a touch operation of the corresponding icon control or text control in the page to be tested, simulate a page click operation, and implement an automatic test on application page switching.
The first device 11 includes, but is not limited to, a notebook computer, a desktop computer, etc., and the second device 12 includes, but is not limited to, a smart phone, a tablet computer, etc., a mobile device having a display function. The first server 13 and the second server may be third party servers that provide open-source, cross-platform APP automated testing.
Based on the application scenario, the technical solutions provided in the embodiments of the present application are described in detail below by specific embodiments. It should be noted that the technical solutions provided in the embodiments of the present application may include part or all of the following contents, and these specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 3 is a first flowchart illustrating a method for testing an application according to an embodiment of the present application. The method for testing an application provided in this embodiment may be applied to the first device 11 shown in fig. 1 or fig. 2, or other apparatuses that can execute the testing method, and this embodiment is not limited in any way.
As shown in fig. 3, the method for testing an application program of the present embodiment includes the following steps:
step 201, obtaining a page to be tested of an application program on a second device, where the page to be tested includes a control capable of triggering page change.
In this embodiment, the first device is a test device, the second device is a device to be tested based on any operating system, and the first device is in communication connection with the second device. The second device can be loaded with an application program, and the test script of the embodiment is executed on the first device, so that the page switching condition of the application program on the second device (namely different tester models) in response to the click operation is simulated.
The control which can trigger the page change in the page to be tested in the embodiment includes at least one of an icon control and a text control.
Step 202, determining the position information of the control on the page to be tested.
In this embodiment, the position information of the control on the page to be tested can be determined through an image recognition technology and/or an optical character recognition technology.
In an optional embodiment of the application, the control of the page to be tested includes an icon control, and the position information of the icon control on the page to be tested can be determined through a picture recognition model preset by the first device.
The position information of the icon control comprises the center position coordinates of the icon control on the page to be tested and the length and width range of the icon control.
In this embodiment, the image recognition model is obtained based on deep learning model training. Common deep learning models include a Convolutional Neural Network (CNN) model, a Recurrent Neural Network (RNN) model, and the like, which is not limited in this embodiment.
The following describes a training process of the image recognition model, and the model training includes the following steps:
step 1, establishing an initial picture recognition model;
and 2, obtaining a picture sample and an annotation result of the picture sample, wherein the picture sample comprises page screenshots of different types or styles in the application program to be tested, the page screenshots comprise icon controls, and a user can realize page jump by clicking the icon controls. The labeling result comprises a position frame of the icon control, an identifier of the icon control and the like in the page screenshot.
And 3, taking the picture sample as the input of the picture recognition model, taking the labeling result of the picture sample as the output of the picture recognition model, and training the initial picture recognition model to obtain the final picture recognition model.
In practical application, the input of the picture identification model is a page to be tested, and the output of the picture identification model comprises position coordinates of the icon control, namely a position frame of the icon control.
Optionally, in some embodiments, the output of the picture recognition model further includes an identifier of the icon control, i.e., a type of the icon control, such as a "return" control, a "cancel" control, a "close" control, and the like, and a confidence level corresponding to the identifier of each icon control.
For example, a user may input an identifier of an icon control, for example, input an identifier of a "return" control, and obtain, by calling the picture recognition model, a recognition result of the "return" control in the page to be tested, where the recognition result includes a position of the "return" control in the page to be tested and a confidence degree corresponding to the position, for example, the position of the "return" control in the page to be tested includes a position 1 and a position 2, and the confidence degrees corresponding to the position 1 and the position 2 are 80% and 20%, respectively. The "return" control with the lower confidence may be rejected according to the recognition result, for example, the "return" control with the confidence smaller than a preset threshold (for example, the preset threshold is 60%) is rejected.
For example, if the user does not input the identifier of the icon control, the picture recognition model returns all the recognition results of all the controls in the current page to be detected, for example, the model outputs a recognition result 1 of the "return" control, a recognition result 2 of the "cancel" control, and a recognition result 3 of the "close" control. The recognition result of each control comprises the identification, the position and the confidence of the control.
The embodiment increases the data filtering of the output result of the model, only retains the data processing result with high accuracy, and improves the accuracy of the model detection.
The first device of this embodiment adopts the above-mentioned picture recognition model to carry out the detection of icon control to the page that awaits measuring, can improve the rate of accuracy and the detection efficiency who detects greatly.
In an optional embodiment of the application, the control of the page to be tested includes a text control, whether preset text exists on the page to be tested can be determined through an OCR technology, and if the preset text exists on the page to be tested, the position information of the text control including the preset text on the page to be tested is determined.
The position information of the character control comprises the center position coordinates of the characters on the page to be tested and the length and width ranges of the characters.
The OCR technology is a process of analyzing, recognizing and processing an image file of text data to obtain characters and layout information. I.e. the text in the image is recognized and returned in the form of text. OCR processing mainly includes image preprocessing, word detection, and text recognition. Common image pre-processing includes geometric transformation (perspective, warping, rotation, etc.), distortion correction, deblurring, image enhancement, and ray correction, among others. The character detection is to detect the position and range of the text, and usually includes layout analysis, character line detection, and the like. The text recognition is to recognize the text content on the basis of text detection and convert the text information in the image into text information. It should be noted that the screenshot in this embodiment does not usually involve the image preprocessing process, and mainly performs text detection and text recognition.
Step 203, generating a first control instruction according to the position information of the control on the page to be tested, wherein the first control instruction is used for triggering touch operation on the control.
In this embodiment, the position information of the control on the page to be tested includes a first position coordinate (i.e., a center position coordinate) of the control on the page to be tested and a length and width range of the control.
In an optional embodiment of the present application, the first position coordinate is subjected to coordinate transformation to obtain a second position coordinate, and then the first control instruction is generated according to the second position coordinate. And the second position coordinate is the position coordinate of the control on the second equipment, namely the physical coordinate of the page to be tested displayed on the screen of the second equipment.
In an optional embodiment of the application, the first position coordinate may be subjected to coordinate conversion in combination with a resolution of a screen of the second device to obtain a second position coordinate, and a first control instruction for the control is generated according to the second position coordinate, so as to simulate an actually received touch operation instruction.
In the above embodiment, it is considered that the page to be detected acquired by the first device may be obtained by compressing a picture, and therefore the first position coordinate determined by the picture recognition model or the OCR technology is a relative coordinate of the control on the page to be detected, that is, the first position coordinate. Therefore, in order to simulate the touch operation on the control on the second device, the relative coordinates of the control on the page to be detected need to be converted into the physical coordinates of the control displayed on the second device, that is, the second position coordinates.
And step 204, sending a first control instruction to the second equipment.
And step 205, generating a test result according to the page change condition of the application program on the second device.
Specifically, whether the page jump is successful or not can be determined by predefining jump pages of different pages and comparing the actual jump condition of the page with the predefined jump page. For example, taking the login operation as an example, after the login is successful, if the page pops up a prompt of "login success", it is determined that the execution of the login operation is successful, and if the prompt is not popped up, it is determined that the execution of the login operation is failed.
Specifically, if the page jump of the application program on the second device fails, or the page jump is incorrect (i.e., the page jump is not performed according to the preset path), a test report of the page abnormality can be generated.
It should be noted that, if the page to be tested includes multiple controls, the first control instruction of each control may be generated according to the position information of each control, and the first control instruction of each control is executed on the second device in sequence to obtain multiple test records.
In the method for testing the application program, after a to-be-tested page of the application program on the second device is obtained, position information of a control which can trigger page change in the to-be-tested page is determined, a control instruction for triggering touch operation on the control is generated according to the position information, the control instruction is sent to the second device, and page change of the application program on the second device is monitored. The test scheme can be used for testing the application program pages of different types of equipment, has strong universality, reduces the test cost of the application program and improves the test efficiency.
Fig. 4 is a second flowchart illustrating a method for testing an application according to an embodiment of the present application, where as shown in fig. 4, the method for testing an application according to the present embodiment includes the following steps:
step 301, obtaining a page to be tested of the application program on the second device, where the page to be tested includes a control capable of triggering page change.
Step 302, determining the position information of the control on the page to be tested by calling a third-party service interface.
Step 303, generating a first control instruction according to the position information of the control on the page to be tested, where the first control instruction is used to trigger a touch operation on the control.
Step 304, sending a first control instruction to the second device.
And 305, generating a test result according to the page change condition of the application program on the second device.
In this embodiment, the third party service interface includes: a picture recognition service interface, and/or an OCR text recognition service interface.
In an optional embodiment of the application, the position information of the icon control on the page to be tested is obtained by calling the picture recognition service interface. Namely, the first device can obtain the position information of the icon control in the page to be detected by calling a picture identification service interface provided by the third-party server.
In an optional embodiment of the application, the position information of the character control on the page to be tested is obtained by calling an OCR text recognition service interface. Namely, the first device can obtain the position information of the character control in the page to be tested by calling an OCR text recognition service interface provided by the third-party server.
According to the testing method of the application program, after the page to be tested of the application program on the second device is obtained, the position information of the icon control and the character control on the page to be tested is obtained by calling the picture recognition and OCR text recognition interface provided by the third-party server, then the control instruction for triggering the touch operation on the control is generated according to the position information, the control instruction is sent to the second device, and the page change of the application program on the second device is monitored. According to the scheme, the external interface provided by the network server is utilized, only the method for calling the picture recognition service and the OCR service needs to be packaged, and only the icon control identification or text information to be recognized needs to be transmitted in the test, so that the complexity of the test script is greatly simplified, the effect of writing the script in natural language is realized, the universality of the test script is high, the automatic test of various test machine type application program pages is supported, the test cost of the application program is reduced, and the test efficiency is improved.
The above describes a method for testing an application program provided in an embodiment of the present application, and a device for testing an application program provided in an embodiment of the present application will be described below.
In the embodiment of the present application, the functional modules of the test apparatus of the application program may be divided according to the above method embodiment, for example, each functional module may be divided according to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a form of hardware or a form of a software functional module. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation. The following description will be given by taking an example in which each functional module is divided by using a corresponding function.
Fig. 5 is a schematic structural diagram of a testing apparatus for an application according to an embodiment of the present disclosure. As shown in fig. 5, the apparatus 400 for testing an application according to this embodiment includes: an acquisition module 401, a processing module 402 and a sending module 403.
An obtaining module 401, configured to obtain a to-be-tested page of the application program on the second device, where the to-be-tested page includes a control that can trigger a page change;
a processing module 402, configured to determine position information of the control on the page to be tested;
generating a first control instruction according to the position information, wherein the first control instruction is used for triggering touch operation on the control;
a sending module 403, configured to send the first control instruction to the second device;
the processing module 402 is further configured to generate a test result according to a page change condition of the application program on the second device.
In an optional embodiment of the present application, the control comprises an icon control; the processing module 402 is specifically configured to:
and determining the position information of the icon control on the page to be tested through a picture recognition model, wherein the picture recognition model is obtained based on deep learning model training.
In an optional embodiment of the present application, the control comprises a text control; the processing module 402 is specifically configured to:
determining whether preset characters exist on the page to be tested or not through an Optical Character Recognition (OCR) technology;
and if the preset characters exist, determining the position information of the character control including the preset characters on the page to be tested.
In an optional embodiment of the present application, the processing module 402 is specifically configured to:
determining the position information of the control on the page to be tested by calling a third-party service interface; the third party service interface comprises a picture recognition service interface and/or an OCR text recognition service interface.
In an optional embodiment of the present application, the position information includes a first position coordinate of the control on the page to be tested; the processing module 402 is specifically configured to:
performing coordinate conversion on the first position coordinate to obtain a second position coordinate, wherein the second position coordinate is the position coordinate of the control on the second device;
and generating the first control instruction according to the second position coordinate.
In an optional embodiment of the present application, the processing module is specifically configured to:
and performing coordinate conversion on the first position coordinate according to the screen resolution of the second device to obtain the second position coordinate.
The testing apparatus for application programs provided in this embodiment may implement the technical solutions of any of the above method embodiments, and the implementation principles and technical effects thereof are similar, and are not described herein again.
Fig. 6 is a hardware structure diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 6, an electronic device 500 according to the embodiment includes:
a memory 501;
a processor 502; and
a computer program;
the computer program is stored in the memory 501 and configured to be executed by the processor 502 to implement the technical solution of any one of the above method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Optionally, the memory 501 may be separate or integrated with the processor 502. When the memory 501 is a separate device from the processor 502, the electronic device 500 further comprises: a bus 503 for connecting the memory 501 and the processor 502.
The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by the processor 502 to implement the technical solution in any of the foregoing method embodiments.
The present application provides a computer program product, including a computer program, which when executed by a processor implements the technical solutions in any of the foregoing method embodiments.
An embodiment of the present application further provides a chip, including: a processing module and a communication interface, wherein the processing module can execute the technical scheme in any one of the method embodiments.
Further, the chip further includes a storage module (e.g., a memory), where the storage module is configured to store instructions, and the processing module is configured to execute the instructions stored in the storage module, and the execution of the instructions stored in the storage module causes the processing module to execute the technical solution in any one of the foregoing method embodiments.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, etc.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The storage medium may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the storage medium may reside as discrete components in an electronic device.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications or substitutions do not depart from the spirit and scope of the present disclosure as defined by the appended claims.

Claims (15)

1. A method for testing an application program, the method being applied to a first device, the first device being connected to a second device, the method comprising:
acquiring a page to be tested of the application program on the second equipment, wherein the page to be tested comprises a control capable of triggering page change;
determining the position information of the control on the page to be tested;
generating a first control instruction according to the position information, wherein the first control instruction is used for triggering touch operation on the control;
sending the first control instruction to the second device;
and generating a test result according to the page change condition of the application program on the second equipment.
2. The method of claim 1, wherein the control comprises an icon control; the determining the position information of the control on the page to be tested comprises the following steps:
and determining the position information of the icon control on the page to be tested through a picture recognition model, wherein the picture recognition model is obtained based on deep learning model training.
3. The method of claim 1, wherein the control comprises a text control; the determining the position information of the control on the page to be tested comprises the following steps:
determining whether preset characters exist on the page to be tested or not through an Optical Character Recognition (OCR) technology;
and if the preset characters exist, determining the position information of the character control including the preset characters on the page to be tested.
4. The method of claim 1, wherein the determining the position information of the control on the page to be tested comprises:
determining the position information of the control on the page to be tested by calling a third-party service interface; the third party service interface comprises a picture recognition service interface and/or an OCR text recognition service interface.
5. The method according to any one of claims 1-4, wherein the position information comprises a first position coordinate of the control on the page to be tested; the generating a first control instruction according to the position information includes:
performing coordinate conversion on the first position coordinate to obtain a second position coordinate, wherein the second position coordinate is the position coordinate of the control on the second device;
and generating the first control instruction according to the second position coordinate.
6. The method of claim 5, wherein the coordinate transforming the first location coordinate to obtain a second location coordinate comprises:
and performing coordinate conversion on the first position coordinate according to the screen resolution of the second device to obtain the second position coordinate.
7. An apparatus for testing an application, comprising:
the acquisition module is used for acquiring a page to be tested of the application program on the second equipment, wherein the page to be tested comprises a control capable of triggering page change;
the processing module is used for determining the position information of the control on the page to be tested;
generating a first control instruction according to the position information, wherein the first control instruction is used for triggering touch operation on the control;
a sending module, configured to send the first control instruction to the second device;
the processing module is further configured to generate a test result according to the page change condition of the application program on the second device.
8. The apparatus of claim 7, wherein the control comprises an icon control; the processing module is specifically configured to:
and determining the position information of the icon control on the page to be tested through a picture recognition model, wherein the picture recognition model is obtained based on deep learning model training.
9. The apparatus of claim 7, wherein the control comprises a text control; the processing module is specifically configured to:
determining whether preset characters exist on the page to be tested or not through an Optical Character Recognition (OCR) technology;
and if the preset characters exist, determining the position information of the character control including the preset characters on the page to be tested.
10. The apparatus of claim 7,
the processing module is specifically configured to:
determining the position information of the control on the page to be tested by calling a third-party service interface; the third party service interface comprises a picture recognition service interface and/or an OCR text recognition service interface.
11. The apparatus according to any one of claims 7-10, wherein the position information comprises a first position coordinate of the control on the page to be tested; the processing module is specifically configured to:
performing coordinate conversion on the first position coordinate to obtain a second position coordinate, wherein the second position coordinate is the position coordinate of the control on the second device;
and generating the first control instruction according to the second position coordinate.
12. The apparatus of claim 11, wherein the processing module is specifically configured to:
and performing coordinate conversion on the first position coordinate according to the screen resolution of the second device to obtain the second position coordinate.
13. An electronic device, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-6.
14. A computer-readable storage medium, having stored thereon a computer program for execution by a processor to perform the method of any one of claims 1-6.
15. A computer program product, characterized in that it comprises a computer program which, when being executed by a processor, carries out the method of any one of claims 1-6.
CN202110583470.5A 2021-05-27 2021-05-27 Application program testing method, device, equipment and storage medium Pending CN113325976A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110583470.5A CN113325976A (en) 2021-05-27 2021-05-27 Application program testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110583470.5A CN113325976A (en) 2021-05-27 2021-05-27 Application program testing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113325976A true CN113325976A (en) 2021-08-31

Family

ID=77421622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110583470.5A Pending CN113325976A (en) 2021-05-27 2021-05-27 Application program testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113325976A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114490395A (en) * 2022-01-27 2022-05-13 北京飞书科技有限公司 Test processing method, device, equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114490395A (en) * 2022-01-27 2022-05-13 北京飞书科技有限公司 Test processing method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN107783898B (en) Test method and test equipment for mobile application
CN109062809B (en) Online test case generation method and device and electronic equipment
CA3018196C (en) Visual regresssion testing tool
CN109871326B (en) Script recording method and device
CN110704304B (en) Application program testing method and device, storage medium and server
CN109033772B (en) Verification information input method and device
US20180173614A1 (en) Technologies for device independent automated application testing
CN109684008B (en) Card rendering method, device, terminal and computer readable storage medium
CN113325976A (en) Application program testing method, device, equipment and storage medium
CN109697164A (en) Test method, device, storage medium and the terminal of App have been adjusted in browser
CN109902001B (en) Method for detecting uninitialized variable and terminal equipment
CN111078529A (en) Client write-in module testing method and device and electronic equipment
CN113468058B (en) Regression testing method and device for software as service platform and electronic equipment
CN117667658A (en) Test program generating method and test program generating device
CN113238969A (en) Interface automation test method, device, equipment and storage medium
CN112380133A (en) Method and device for simulating instruction set simulator by using function library
CN112966671A (en) Contract detection method and device, electronic equipment and storage medium
Chu et al. Automated GUI testing for android news applications
CN113220382A (en) Anomaly detection method and device for application language package
CN111104308A (en) Display page testing method and device, storage medium and electronic equipment
US11397662B2 (en) Method for debugging computer program, device employing method, and storage medium
CN118069949B (en) Dynamic layout method and system based on component tree architecture
CN113111713A (en) Image detection method and device, electronic equipment and storage medium
CN118193376A (en) Test method, system, electronic equipment, storage medium and test terminal
CN113326202A (en) UI automation test code generation method, device, equipment and 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