[go: up one dir, main page]

CN108595329B - Application testing method and device and computer storage medium - Google Patents

Application testing method and device and computer storage medium Download PDF

Info

Publication number
CN108595329B
CN108595329B CN201810367819.XA CN201810367819A CN108595329B CN 108595329 B CN108595329 B CN 108595329B CN 201810367819 A CN201810367819 A CN 201810367819A CN 108595329 B CN108595329 B CN 108595329B
Authority
CN
China
Prior art keywords
test
webpage
target application
application
instruction
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
CN201810367819.XA
Other languages
Chinese (zh)
Other versions
CN108595329A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810367819.XA priority Critical patent/CN108595329B/en
Publication of CN108595329A publication Critical patent/CN108595329A/en
Application granted granted Critical
Publication of CN108595329B publication Critical patent/CN108595329B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses an application testing method, an application testing device and a computer storage medium, wherein the method comprises the following steps: acquiring an application to be tested, and repacking the application to be tested according to the test packet data to obtain a target application; the process of the target application comprises test packet data; searching a webpage view in the process of the target application according to the operation instruction and the test packet data aiming at the target application, acquiring control information associated with the operation instruction in the webpage view, and generating a test script according to the control information and the operation behavior indicated by the operation instruction; and loading the test script, searching a webpage view in the process of the target application according to the test script and the test packet data, searching coordinate information corresponding to the control information in the webpage view, and performing simulation operation on the control positioned at the coordinate information in the target application to generate a test result. By adopting the invention, the automatic test can be carried out on the mobile terminal webpage program based on the self-defined webview kernel.

Description

Application testing method and device and computer storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an application testing method and apparatus, and a computer storage medium.
Background
At present, the number of developed applications is increasing, and in order to ensure the performance and quality of the applications, the applications are usually required to be tested, and the content of the tests is usually more and more rigorous, and if the tests are performed step by hand, very high labor cost is required, so the automated tests are very important.
At present, the mobile terminal web page program can be automatically tested, and the current mainstream test mode can be as follows: the method can obtain the page content in the native webview (a web page view, a control for a web page) in the mobile terminal web page program through an Application Programming Interface (API) provided by the Uiautomator (a tool for automated testing of a user Interface launched by google), and further realize automated testing according to the obtained page content. However, at present, many mobile-side web programs are implemented based on a customized webview kernel (for example, X5webview developed in Tencent), and at this time, effective page elements cannot be captured in the customized webview through the uiautomator, which further results in that the mobile-side web programs based on the customized webview kernel cannot be automatically tested.
Disclosure of Invention
The embodiment of the invention provides an application testing method, an application testing device and a computer storage medium, which can be used for automatically testing a mobile terminal webpage program based on a user-defined webview kernel.
An embodiment of the present invention provides an application test method, including:
acquiring an application to be tested, and repacking the application to be tested according to test packet data to obtain a target application; the process of the target application includes the test package data;
searching a webpage view in the process of the target application according to the operation instruction and the test packet data aiming at the target application, acquiring control information associated with the operation instruction in the webpage view, and generating a test script according to the control information and the operation behavior indicated by the operation instruction;
and loading the test script, searching the webpage view in the process of the target application according to the test script and the test package data, searching the coordinate information corresponding to the control information in the webpage view, and performing simulation operation on the control positioned at the coordinate information in the target application to generate a test result.
Wherein, still include:
starting the target application, initializing the test packet data in the target application, and establishing process communication service for the process of the target application and the process of the test application; the process of the test application is used to load the test script.
The searching a web page view in a process of the target application according to the operation instruction and the test packet data for the target application, acquiring control information associated with the operation instruction in the web page view, and generating a test script according to the control information and an operation behavior indicated by the operation instruction includes:
reading a view structure tree corresponding to the interface of the target application in the process of the target application according to the test packet data, and traversing the view structure tree to generate a view structure array;
receiving an operation instruction for the target application, and traversing the page content of the webpage view through a query code segment when the webpage view is found at the operation position indicated by the operation instruction according to the view structure array to obtain a traversal result;
acquiring coordinate information of an operation position indicated by the operation instruction, and acquiring control information corresponding to the coordinate information from the traversal result;
and returning the control information to the test application according to the callback function in the target application, and converting the control information and the operation behavior indicated by the operation instruction into the test script in the test application.
The searching a web page view in a process of the target application according to the operation instruction and the test packet data for the target application, acquiring control information associated with the operation instruction in the web page view, and generating a test script according to the control information and an operation behavior indicated by the operation instruction includes:
reading a view structure tree corresponding to an interface of the target application in the process of the target application according to the test packet data, and traversing the view structure tree to generate a view structure array;
receiving an operation instruction for the target application, and when the webpage view is found at the operation position indicated by the operation instruction according to the view structure array, acquiring control information of the operation position indicated by the operation instruction from the page content of the webpage view through a loadURL;
intercepting the control information acquired by the loadURL, returning the intercepted control information to the test application through a coding language registration channel, and converting the control information and the operation behavior indicated by the operation instruction into the test script in the test application.
The loading the test script, searching the web view in the process of the target application according to the test script and the test package data, searching the coordinate information corresponding to the control information in the web view, and performing simulation operation on the control located at the coordinate information in the target application to generate a test result includes:
loading the test script in the process of the test application, and sending the test instruction in the test script to the process of the target application through the process communication service;
reading a view structure tree corresponding to the interface of the target application in the process of the target application according to the test package data and the test instruction, and traversing the view structure tree to generate a view structure array;
if the webpage view is found in the object to be operated indicated by the test instruction according to the view structure array, finding a control corresponding to the control information in the test script in the webpage view through an inquiry code segment, and acquiring coordinate information of the control;
returning the coordinate information of the control to a system testing frame through a callback function;
and performing simulation operation on the control positioned at the coordinate information in the target application based on the system test framework to generate a test result.
Wherein, still include:
acquiring a detection instruction, and setting a user-defined webpage callback interface service according to the detection instruction;
if the interface of the target application contains the webpage view, triggering the user-defined webpage callback interface service to detect and record webpage detection information in the interface of the target application;
and adding the webpage detection information to the test result, and displaying the added test result.
The acquiring a detection instruction and setting a user-defined webpage callback interface service according to the detection instruction comprises the following steps:
acquiring a detection instruction;
if the webpage view contains the webpage callback interface service, acquiring the webpage callback interface service according to the detection instruction, and rewriting a function in the webpage callback interface service to obtain a user-defined webpage callback interface service;
and if the webpage view does not contain the webpage callback interface service, creating the user-defined webpage callback interface service.
If the interface of the target application is detected to contain the webpage view, triggering the user-defined webpage callback interface service to detect and record webpage detection information in the interface of the target application, wherein the detection comprises the following steps:
if the interface of the target application is detected to contain the webpage view, triggering the user-defined webpage callback interface service to detect the webpage in the target application;
if the webpage is detected to be in the loading starting state, recording webpage loading starting time information through a first function in the user-defined webpage callback interface service;
if the webpage is detected to be in the loading ending state, recording webpage loading ending time information through a second function in the user-defined webpage callback interface service;
if the webpage is detected to be in a page jump state, recording page jump information through a third function in the user-defined webpage callback interface service;
if the webpage is detected to be in a page loading abnormal state, recording page loading abnormal information through a fourth function in the user-defined webpage callback interface service;
if the webpage is detected to be in the resource request state, counting the resource loading quantity through a fifth function in the user-defined webpage callback interface service;
and determining the webpage loading starting time information, the webpage loading ending time information, the page jump information, the page loading abnormal information and the resource loading quantity as the webpage page detection information.
An embodiment of the present invention provides an application testing apparatus, including:
the repacking module is used for acquiring an application to be tested and repacking the application to be tested according to the test packet data to obtain a target application; the process of the target application includes the test package data;
the script generation module is used for searching a webpage view in the process of the target application according to the operation instruction and the test packet data aiming at the target application, acquiring control information associated with the operation instruction in the webpage view, and generating a test script according to the control information and the operation behavior indicated by the operation instruction;
and the test module is used for loading the test script, searching the webpage view in the process of the target application according to the test script and the test packet data, searching the coordinate information corresponding to the control information in the webpage view, and performing simulation operation on the control positioned at the coordinate information in the target application to generate a test result.
Wherein, still include:
the initialization module is used for starting the target application, initializing the test packet data in the target application and establishing process communication service for the process of the target application and the process of the test application; the process of the test application is used to load the test script.
Wherein the script generation module comprises:
the first array generating unit is used for reading a view structure tree corresponding to an interface of the target application in the process of the target application according to the test packet data, traversing the view structure tree and generating a view structure array;
the page traversing unit is used for receiving the operation instruction aiming at the target application, and traversing the page content of the webpage view through the query code segment when the webpage view is found at the operation position indicated by the operation instruction according to the view structure array to obtain a traversing result;
the first control acquiring unit is used for acquiring coordinate information of an operation position indicated by the operation instruction and acquiring control information corresponding to the coordinate information from the traversal result;
and the first script conversion unit is used for returning the control information to the test application according to a callback function in the target application, and converting the control information and the operation behavior indicated by the operation instruction into the test script in the test application.
Wherein the script generation module comprises:
the second array generating unit is used for reading a view structure tree corresponding to the interface of the target application in the process of the target application according to the test packet data, traversing the view structure tree and generating a view structure array;
the second control obtaining unit is used for receiving an operation instruction for the target application, and obtaining control information of an operation position indicated by the operation instruction from the page content of the webpage view through a loadURL when the webpage view is found at the operation position indicated by the operation instruction according to the view structure array;
and the second script conversion unit is used for intercepting the control information acquired by the loadURL, returning the intercepted control information to the test application through a coding language registration channel, and converting the control information and the operation behavior indicated by the operation instruction into the test script in the test application.
Wherein the test module comprises:
the instruction sending unit is used for loading the test script in the process of the test application and sending the test instruction in the test script to the process of the target application through the process communication service;
the third array generating unit is used for reading a view structure tree corresponding to the interface of the target application in the process of the target application according to the test packet data and the test instruction, traversing the view structure tree and generating a view structure array;
the coordinate obtaining unit is used for searching a control corresponding to the control information in the test script in the webpage view through an inquiry code segment and obtaining the coordinate information of the control if the webpage view is searched in the object to be operated indicated by the test instruction according to the view structure array;
the coordinate sending unit is used for returning the coordinate information of the control to the system testing frame through a callback function;
and the simulation operation unit is used for performing simulation operation on the control positioned at the coordinate information in the target application based on the system test framework to generate a test result.
Wherein, still include:
the setting module is used for acquiring a detection instruction and setting a user-defined webpage callback interface service according to the detection instruction;
the detection module is used for triggering the user-defined webpage callback interface service to detect and record webpage page detection information in the interface of the target application if the interface of the target application is detected to contain the webpage view;
and the display module is used for adding the webpage detection information to the test result and displaying the added test result.
Wherein the setting module includes:
the instruction acquisition unit is used for acquiring a detection instruction;
the function rewriting unit is used for acquiring the webpage callback interface service according to the detection instruction if the webpage view contains the webpage callback interface service, and rewriting a function in the webpage callback interface service to obtain a user-defined webpage callback interface service;
and the creating unit is used for creating the self-defined webpage callback interface service if the webpage view does not contain the webpage callback interface service.
Wherein the detection module comprises:
the triggering unit is used for triggering the user-defined webpage callback interface service to detect the webpage in the target application if the interface of the target application is detected to contain the webpage view;
the detection information recording unit is used for recording webpage loading starting time information through a first function in the customized webpage callback interface service if the webpage is detected to be in a loading starting state;
the detection information recording unit is further configured to record webpage loading end time information through a second function in the customized webpage callback interface service if the webpage is detected to be in an end loading state;
the detection information recording unit is further configured to record page jump information through a third function in the customized web page callback interface service if it is detected that the web page is in a page jump state;
the detection information recording unit is further configured to record page loading abnormal information through a fourth function in the customized web page callback interface service if it is detected that the web page is in a page loading abnormal state;
the detection information recording unit is further configured to count the resource loading amount through a fifth function in the customized web page callback interface service if the web page is detected to be in the resource request state;
and the determining unit is used for determining the webpage loading starting time information, the webpage loading ending time information, the page jump information, the page loading abnormal information and the resource loading quantity as the webpage page detection information.
An embodiment of the present invention provides a terminal device, including: a processor and a memory;
the processor is connected to a memory, wherein the memory is used for storing program codes, and the processor is used for calling the program codes to execute the method in one aspect of the embodiment of the invention.
An aspect of an embodiment of the present invention provides a computer storage medium storing a computer program, the computer program comprising program instructions that, when executed by a processor, perform a method as in an aspect of an embodiment of the present invention.
The method comprises the steps of obtaining an application to be tested, and repacking the application to be tested according to test packet data to obtain a target application; the process of the target application comprises test packet data; acquiring a webpage view in the process of the target application according to the operation instruction and the test packet data aiming at the target application, acquiring control information associated with the operation instruction in the webpage view, and generating a test script according to the control information and the operation behavior indicated by the operation instruction; and loading the test script, acquiring a webpage view in the process of the target application according to the test script and the test packet data, searching coordinate information corresponding to the control information in the webpage view, and performing simulation operation on the control positioned at the coordinate information in the target application to generate a test result. Therefore, through a repacking mechanism, a process of a target application can contain test packet data, and further grabbing and event simulation of control information in a native webpage view or a self-defined webpage view (such as X5webview) can be realized based on the test packet data, so that recording and automatic testing of a test script can be realized, the whole set of scheme not only can be adapted to a WeChat applet based on X5webview, but also can be applicable to all applications of an X5 kernel, namely, the embodiment of the invention can carry out automatic testing on the applications based on the native webpage view or the self-defined webpage view.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of an application testing method according to an embodiment of the present invention;
FIG. 2 is a schematic interface diagram of a test application according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of process interaction between a test application and a target application according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a test script recording method according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of an automated testing method according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a page detection method according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of an application testing apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
Referring to fig. 1, a schematic flow chart of an application testing method according to an embodiment of the present invention is shown, where the method includes:
s101, acquiring an application to be tested, and repacking the application to be tested according to test packet data to obtain a target application; the process of the target application includes the test package data;
specifically, the user terminal may obtain the application to be tested through the test application, for example, an application list may be displayed in the test application, the application list may include a plurality of application names, the user may click a certain application name in the application list, and the user terminal selects the application corresponding to the application name according to the click instruction, so as to serve as the application to be tested. The test application may refer to an application installed in the user terminal for testing the application program. The test application can comprise a test service, the test service can provide test packet data and a repacking function, namely after the test application selects the application to be tested, the application to be tested can be repacked through the test packet data, namely the test service can pack the test packet data into the application to be tested, the application to be tested containing the test packet data is called as a target application, and the test packet data can be a dex file. The test package data may include a test module code, and the test module code has a function of acquiring control information in the current page, so that the target application can have the function of acquiring the control information in the current page by running the test module code.
After repacking the application to be tested, the target application can be started, in the starting process, the test packet data in the target application can also be loaded together, and the test packet data is initialized, wherein the initializing process can comprise the following steps: initializing katappication, initializing Art Hook. The kataplication can be called as a self-defined application initialization class, in an Android system, each application start can execute the application initialization class firstly, the kataplication has the effect that communication service and registration interface interception service are established during application initialization, namely, in the initialization process, process communication service can be established for a process of a target application and a process of a test application based on the kataplication, the process communication service can be a socket server, and the socket server can provide socket communication, namely, data communication between two different application processes can be realized through the socket server. The process communication service is located in a process of the target application. The Art Hook can be called method interception, and is used for intercepting a certain method when a system calls the method, so that a specified function is executed before and after the method is executed. Therefore, by initializing the Art Hook, the embodiment of the invention can intercept the application to be tested based on the Art Hook after the application to be tested is started so as to start the socket communication service. The processes of initialization of katappication and initialization of Art Hook are realized in the process of the target application.
S102, searching a webpage view in the process of the target application according to the operation instruction and the test packet data aiming at the target application, acquiring control information associated with the operation instruction in the webpage view, and generating a test script according to the control information and the operation behavior indicated by the operation instruction;
in particular, the web page view may include a native webview or an X5 webview. Before the automated test is executed, a test script of the target application needs to be generated, and the test script is used for performing the automated test on the target application subsequently. The method comprises the steps that a recording key for recording a test script can be displayed in an interface of a test application in a user terminal, when a user clicks the recording key, the user terminal can trigger the test application to send a script recording command according to a click instruction, the test application can specifically send the script recording command to a target application through socket communication, after a socket server in the target application monitors the script recording command, all operation behaviors of the user on the target application (including operations such as clicking and sliding on the target application) can be recorded based on functions provided by test packet data and the script recording command, and information of an operated control in each operation behavior can be recorded, wherein the information of the control can include xpath (extensible markup language path language) information of the control. The specific process of recording the information of the operated control in each operation behavior may be as follows:
based on that the test packet data in the target application can be reflected and read to the view tree of the current activity (because the test packet data and the target application are in the same process, the view tree can be directly obtained based on the test packet data, and also the native view or X5 view in the view tree can be obtained), then the whole view tree is traversed through a depth-first traversal algorithm, and then stored in a list array, and then according to the list array and the operation instruction (such as the operation instruction generated by clicking and sliding) for the target application in the recording process, whether the coordinate information indicated by the operation instruction is the native view or X5 view is searched, if so, a query code segment based on JavaScript (an transliterated script language, which is a dynamic type, a weak type, a prototype-based language, and a built-in support type) is injected, and through the query code segment, the mobile end page (such as the page in the cookie) can be traversed, searching a control meeting the condition (namely, a control located in the coordinate information indicated by the operation instruction) in the document through the coordinate information indicated by the operation instruction, obtaining the control information of the control meeting the condition, finally returning the control information and all recorded operation behaviors to the test application through a callback function provided by the evaluateJavascript, and converting the control information and the operation behaviors indicated by the operation instruction into the test script in the test application, namely, converting the operation behavior information and the operated control information generated by each operation of the target application by the user into the test script until the user finishes the operation of the target application, and finishing the whole script recording process. The evaluateJavascript is a method name provided by the Android system, and can also be called as a Javascript code execution function.
S103, loading the test script, searching the webpage view in the process of the target application according to the test script and the test package data, searching the coordinate information corresponding to the control information in the webpage view, and performing simulation operation on the control located at the coordinate information in the target application to generate a test result.
Specifically, after the test script is recorded, the user terminal may load the test script through the test application, and the test application may generate one test instruction in a loading process, and send each test instruction one by one to the process communication service of the target application through socket communication, so that the content indicated by each test instruction may be executed one by one in the target application based on the test packet data. The sequence of sending the test instruction is consistent with the sequence of each operation behavior in the process of recording the test script, the content indicated by one test instruction is one operation behavior aiming at a target application in the process of recording the test script, and the test instruction can also contain control information associated with the operation instruction in the process of recording. After receiving the test instruction, the target application can reflect and read the test packet data to the views tree of activity corresponding to the test instruction (because the test packet data and the target application are in the same process, the views tree can be directly obtained based on the test packet data, and also the native views or X5 views in the views tree can be obtained), traverse the whole views tree by a depth-first traversal algorithm, and then store in a list array, then search whether the operation object contained in the test instruction has the native view or X5 view according to the test instruction and the list array, if so, inject an inquiry code segment based on JavaScript, because the test instruction contains control information (such as xpath information of the control), it is not necessary to traverse the scope of the mobile terminal webpage (i.e. the webpage of the target application) again based on the inquiry code segment, and only need to search the control corresponding to the control information in the test instruction by the inquiry code segment, and obtaining the coordinate information of the control in the webpage, and returning the coordinate information of the control to the instrumentation frame through a callback function provided by evaluateJavascript. In the instrumentation framework, simulation operation is performed on the control at the obtained coordinate information based on the operation behavior in the test instruction, if the operation behavior contained in the test instruction is "click operation on the control a", the simulation click can be performed on the control a at the coordinate information based on the instrumentation framework, so as to obtain an output result corresponding to the simulation operation, when each test instruction in the test script is completed, the automatic test on the target application is completed, and further, the output result corresponding to each test instruction is determined as a test result, so that a tester can compare the test result with an expected result, so as to analyze the performance of the target application.
Because the test packet data is in the process of the target application, the test function provided by the test packet data can directly capture the page content of the native web view or the X5web view in the target application, and therefore, even if the target application uses the customized X5web view (for example, the target application is a small program in WeChat), the test function provided by the test packet data can also directly capture the page content of the web page of the target application, so that the test script can be successfully recorded for the target application, and the target application can also be successfully automatically tested based on the test script. Because the test packet data is in the process of the target application, the test function provided by the test packet data can also directly call the evaluateJavascript method of the original webview or the X5webview in the target application, and the evaluateJavascript method is a system API method, so that the callback method provided by the evaluateJavascript method has higher stability. Therefore, the embodiment of the invention can enable the process of the target application to contain the test packet data through a repacking mechanism, and further realize the grabbing of the control information and the event simulation based on the test packet data, the whole set of scheme can be adapted to the WeChat applet and all the applications of the X5 kernel, and the problem that a test framework in the prior art cannot be adapted to the X5webview is solved.
Further, please refer to fig. 2, and fig. 2 is a schematic interface diagram of a test application according to an embodiment of the present invention. As shown in fig. 2, an interface of the test application is displayed in the display screen of the user terminal 100, and the interface of the test application may include: an application list 200C, a "script recording" button 200a, and a "test" button 200B, wherein the application list 200C may show names of a plurality of applications, such as the names of an application a, an application B, and an application C shown in the application list 200C shown in fig. 2. When the user clicks and selects the application a from the application list 200c, the application a may be determined as the application to be tested, when the user continues to click the "script record" button 200a, the application a may be repackaged, the repackaged application a may be determined as the target application, the application a may be started and displayed, and the recording of the test script on the application a may be implemented through the test packet data in the process of the application a (the specific process of the recording may be referred to as S102 in the corresponding embodiment of fig. 1), after the test script is recorded, the user may continue to click the "test" button 200b, and the test application may start loading the test script and restart and display the application a, the test application sends the test instruction generated by loading the test script to the application a, and the automated test on the application a may be implemented through the test packet data in the process of the application a and the test instruction (the specific process of the automated test may be referred to as fig. 1) S103 in the present embodiment).
Further, please refer to fig. 3, in which fig. 3 is a schematic diagram illustrating a process interaction between a test application and a target application according to an embodiment of the present invention. As shown in fig. 3, the test application is embodied by xtest developed in flight, the target application is embodied by application a in the corresponding embodiment of fig. 2, after initiating xtest, if a user selects application a through the interface shown in fig. 2 to record a test script, the test service (xtest server) corresponding to xtest can repack the test packet data (i.e. class. dex) into the process of application a and launch application a, execute the class of application initialization (i.e. perform katappication initialization) according to the test packet data in the process of application a, initialize method interception (i.e. perform art initialization), start the function of intercepting the attach method, when the application initialization is completed, each process executes the attach method once, create process communication service (i.e. socket) for the process of xtest and the process of application a, wait for xtest to send a request command, i.e. the process of xtest and the process of application a to communicate with socket, and recording the test script of the application A through class. After the test script is recorded, if the user selects an application a for automated testing through the interface shown in fig. 2, xtest may load the test script, send the generated test instruction to a socket server in the application process a through socket communication, further process the test instruction in the application a based on class.
The method comprises the steps of obtaining an application to be tested, and repacking the application to be tested according to test packet data to obtain a target application; the process of the target application comprises test packet data; acquiring a webpage view in the process of the target application according to the operation instruction and the test packet data aiming at the target application, acquiring control information associated with the operation instruction in the webpage view, and generating a test script according to the control information and the operation behavior indicated by the operation instruction; and loading the test script, acquiring a webpage view in the process of the target application according to the test script and the test packet data, searching coordinate information corresponding to the control information in the webpage view, and performing simulation operation on the control positioned at the coordinate information in the target application to generate a test result. Therefore, through a repacking mechanism, a process of a target application can contain test packet data, and further grabbing and event simulation of control information in a native webpage view or a self-defined webpage view (such as X5webview) can be realized based on the test packet data, so that recording and automatic testing of a test script can be realized, the whole set of scheme not only can be adapted to a WeChat applet based on X5webview, but also can be applicable to all applications of an X5 kernel, namely, the embodiment of the invention can carry out automatic testing on the applications based on the native webpage view or the self-defined webpage view.
Referring to fig. 4, it is a schematic flow chart of a test script recording method provided in an embodiment of the present invention, where steps S201 to S206 in the method are specifically described for step S102 in the embodiment corresponding to fig. 2, and the method may include:
s201, reading a view structure tree corresponding to an interface of the target application in the process of the target application according to the test packet data, traversing the view structure tree, and generating a view structure array;
specifically, the process of the target application includes test package data, the test package data is set in the process of the target application in a repackaging manner, and the specific content of the test package data may refer to S101 in the embodiment corresponding to fig. 2 described above. Before the automated test is executed, a test script of the target application needs to be generated, and the test script is used for performing the automated test on the target application subsequently. The method comprises the steps that a recording key used for recording a test script can be displayed in an interface of the test application in a user terminal, when a user clicks the recording key, the user terminal can trigger the test application to send a script recording command according to a clicking instruction, and after the test packet data in the target application monitors the script recording command, the test packet data can start to record all operation behaviors of the user on the target application according to the script recording command. When the test script starts to be recorded, the user terminal may read the view structure tree corresponding to the interface of the target application in the process of the target application according to the test packet data, traverse the view structure tree through a depth-first traversal algorithm, and store a traversal result in a view structure array (i.e., a list array). Since the test package data is in the process of the target application, the test module corresponding to the test package data can directly read the views tree (i.e., the view structure tree) of the interface of the target application in the process of the target application. Since the views tree is read directly in the process of the target application, even if the views tree includes a web view (such as a native view or an X5 view), the entire views tree can be read, i.e., the web view in the views tree can be successfully read.
S202, receiving an operation instruction for the target application, and traversing the page content of the webpage view through a query code segment when the webpage view is found at the operation position indicated by the operation instruction according to the view structure array to obtain a traversal result;
specifically, in the process of recording the test script, whenever an operation instruction (such as an operation instruction generated by a click operation or a slide operation) for a target application is received, whether an operation position indicated by the operation instruction contains a webpage view or not can be detected according to the list array, if the operation position contains the webpage view, a query code segment based on JavaScript is injected, and document in page content of the webpage view can be traversed through the query code segment, that is, a traversal result contains the document.
S203, acquiring coordinate information of an operation position indicated by the operation instruction, and acquiring control information corresponding to the coordinate information from the traversal result;
specifically, the user terminal further obtains coordinate information of the operation position indicated by the operation instruction, where the traversal result may include coordinate information and control information (such as xpath information) corresponding to all controls in the web page, and therefore, the user terminal may obtain the control information corresponding to the coordinate information in the traversal result according to the obtained coordinate information.
S204, returning the control information to the test application according to the callback function in the target application, and converting the control information and the operation behavior indicated by the operation instruction into the test script in the test application;
specifically, because the test packet data is in the process of the target application, the test function provided by the test packet data may also directly call the evaluateJavascript method of the original webview or the X5webview in the target application, and the evaluateJavascript method is a system API method, so that the callback method provided by the evaluateJavascript method has higher stability. And then the user terminal can return the control information to the test application through a callback function provided by the evaluateJavascript, namely, the operation behavior information generated by each operation of the user on the target application and the operated control information can be returned to the test application, and the control information and the operation behavior indicated by the operation instruction are converted into the test script in the test application until the user finishes the operation on the target application, and then the whole script recording process is completed.
Optionally, in the above S202, when the operation instruction for the target application is received and the web page view is found at the operation position indicated by the operation instruction according to the view structure array, the control information of the operation position indicated by the operation instruction may also be obtained from the page content of the web page view through a loadURL, where the loadURL may be a script execution method, and is specifically used to load and execute a script code segment; intercepting the control information acquired by the loadURL, returning the intercepted control information to the test application through a coding language registration channel, and converting the control information and the operation behavior indicated by the operation instruction into the test script in the test application. Although the loadUrl method of the X5webview is called through reflection, the content of the webpage can be captured, but the loadUrl method has no return value, so that in order to return control information to a testing end, the loadUrl method needs to be intercepted by using a hook technology, and then a bridge for communication between Java and Javascript is registered by using an addJavaScript interface, wherein the bridge is a coding language registration channel, and the return of the control information can be realized through the coding language registration channel, so that the purpose of automatic testing is achieved. The addJavaScript interface can be called as a Javascript interface registration method and is used for registering a Javascript calling interface to the system, and after the Javascript calling interface is registered, the Javascript method can be called at a java end by using a loadurl method.
According to the embodiment of the invention, through a repackaging mechanism, the process of the target application can contain the test packet data, and then the capture of the control information in the native webpage view or the self-defined webpage view (such as X5webview) can be realized based on the test packet data, so that the recording of the test script can be realized, and the whole set of scheme not only can be suitable for the recording of the test script of the X5 webview-based WeChat applet, but also can be suitable for all applications of the X5 kernel.
Referring to fig. 5, which is a schematic flow chart of an automated testing method according to an embodiment of the present invention, steps S301 to S305 in the method are specifically described for step S103 in the embodiment corresponding to fig. 2, and the method may include:
s301, loading the test script in the process of the test application, and sending the test instruction in the test script to the process of the target application through the process communication service;
specifically, after the test script is recorded, the user terminal may load the test script through the test application, and the test application may generate one test instruction in a loading process, and send each test instruction one by one to a process communication service of the target application through socket communication, so that the content indicated by each test instruction may be executed one by one in the target application based on the test packet data. The sequence of sending the test instruction is consistent with the sequence of each operation behavior in the process of recording the test script, the content indicated by one test instruction is one operation behavior aiming at a target application in the process of recording the test script, and the test instruction can also contain control information associated with the operation instruction in the process of recording.
S302, reading a view structure tree corresponding to the interface of the target application in the process of the target application according to the test package data and the test instruction, and traversing the view structure tree to generate a view structure array;
specifically, after the target application receives the test instruction, the target application may reflect and read the views tree of the activity corresponding to the test instruction based on the test packet data (since the test packet data and the target application are in the same process, the views tree may be directly obtained based on the test packet data, and also a native view or an X5 view in the views tree may be obtained), where the views tree may be referred to as a view structure tree corresponding to the interface of the target application, and then traverse the entire views tree by using a depth-first traversal algorithm, and then store the traversal result in a list array (i.e., a view structure array).
S303, if a webpage view is found in the object to be operated indicated by the test instruction according to the view structure array, finding a control corresponding to the control information in the test script in the webpage view through an inquiry code segment, and acquiring coordinate information of the control;
specifically, the user terminal can search whether an operation object contained in the test instruction has a webpage view (such as a native webview or an X5webview) according to the test instruction and the list array, and if so, the operation object is injected into a query code segment based on JavaScript.
S304, returning the coordinate information of the control to a system testing frame through a callback function;
specifically, because the test packet data is in the process of the target application, the test module corresponding to the test packet data may also directly call an evaluateJavascript method of an original webview or an X5webview in the target application, so that the test module may return the coordinate information of the control to the system test frame through a callback function provided by the evaluateJavascript, and the system test frame may be an instrumentation frame.
S305, based on the system test framework, performing simulation operation on the control located at the coordinate information in the target application to generate a test result;
specifically, simulation operation is performed on the control at the obtained coordinate information based on the operation behavior in the instrumentation frame and the test instruction, if the operation behavior included in the test instruction is "click operation on the control a", the control a at the coordinate information may be clicked in a simulation manner based on the instrumentation frame, so as to obtain an output result corresponding to the simulation operation, when each test instruction in the test script is completed, the automated test on the target application is completed, so that the output result corresponding to each test instruction is determined as a test result, the test result may be displayed in an interface of the user terminal, and a tester may compare the test result with an expected result to analyze the performance of the target application. Or, the user terminal may also compare the output result corresponding to the test instruction with the expected result, and determine the comparison result as the test result.
According to the embodiment of the invention, through a repacking mechanism, the process of the target application can contain the test packet data, and further, the grabbing and event simulation of the control information in the native webpage view or the self-defined webpage view (such as X5webview) can be realized based on the test packet data, so that the automatic test based on the test script can be realized, the whole set of scheme not only can be adapted to the WeChat applet based on X5webview, but also can be applicable to all applications of the X5 kernel, namely, the embodiment of the invention can carry out the automatic test on the application based on the native webpage view or the self-defined webpage view.
Please refer to fig. 6, which is a flowchart illustrating a page detection method according to an embodiment of the present invention, where the method may be executed after step S102 in the embodiment corresponding to fig. 2, that is, the method may be executed after a test script is generated and during an automated test according to the test script. The method may include:
s401, acquiring a detection instruction, and setting a user-defined webpage callback interface service according to the detection instruction;
specifically, at any time in the process of automatically testing the target application according to the test script, a detection instruction can be initiated through the test script, namely the detection instruction can be packaged in the test script in advance, in the process of loading the test script, the detection instruction in the test script can be sent to a test module corresponding to test packet data in the target application through socket communication, the test module can receive the test instruction in the test script while receiving the detection instruction, namely the test module can simultaneously perform detection operation according to the detection instruction, and perform automatic test operation according to the test instruction. After receiving the detection instruction, the test module may obtain a web view (e.g., a native web view or an X5web view) according to the detection instruction, and detect whether the web view includes a web callback interface service, where the web callback interface service may be a web callback client. If the web page view contains the webviewclient, the test module may rewrite a function in the webviewclient to obtain a customized web page callback interface service, that is, the customized web page callback interface service contains a rewritten function, and the rewritten function may include a first function (onPageStarted), a second function (onPageFinished), a third function (shouldoverurrleadloading), a fourth function (onreceivedreror), and a fifth function (shouldentripetrequest). The onPageStarted is used for detecting the starting time of page loading and is called back when the webpage is started to be loaded; the onPageFinished is used for detecting the time of page loading completion and calling back when the webpage loading is finished; shouldoverladerUrlLoading is used for detecting page jump information by intercepting url jump; the onReceiveError is used for detecting page loading exception information and can be called back when an error occurs in the loaded page; the shouldnterceptrequest is used for counting the loading number of the resource and is called back by the function every time the resource is requested. If the webpage view does not contain the webviewclient, the test module can directly create corresponding customized webpage callback interface services for the webpage view, and the created customized webpage callback interface services also contain onPageStarted, onPageFinishd, shouldOververderLoading, onReceivedError and shouldInterceptRequest.
S402, if the interface of the target application contains the webpage view, triggering the user-defined webpage callback interface service to detect and record webpage detection information in the interface of the target application;
specifically, if it is detected that the interface of the target application includes the web page view, that is, the target application is said to jump to a mobile-end web page (for example, a web page displayed when the WeChat application enters an applet), at this time, the customized web page callback interface service may be triggered to detect the web page in the target application; if the webpage is detected to be in the loading starting state, recording webpage loading starting time information through a first function in the user-defined webpage callback interface service; if the webpage is detected to be in the loading ending state, recording webpage loading ending time information through a second function in the user-defined webpage callback interface service; if the webpage is detected to be in a page jump state, recording page jump information through a third function in the user-defined webpage callback interface service; if the webpage is detected to be in a page loading abnormal state, recording page loading abnormal information through a fourth function in the user-defined webpage callback interface service; and if the webpage is detected to be in the resource request state, counting the resource loading quantity through a fifth function in the user-defined webpage callback interface service. And determining the webpage loading starting time information, the webpage loading ending time information, the page jump information, the page loading abnormal information and the resource loading quantity as the webpage detection information. The page loading time can be calculated by the webpage loading starting time information and the webpage loading ending time information.
And S403, adding the webpage detection information to the test result, and displaying the added test result.
Specifically, the web page detection information is added to the test result, so that the web page detection information and the test result obtained through the automatic test can be displayed on a display screen of the user terminal in a report form.
According to the embodiment of the invention, through a repacking mechanism, a process of a target application can contain test packet data, and further grabbing and event simulation of control information in a native webpage view or a self-defined webpage view (such as X5webview) can be realized based on the test packet data, so that recording and automatic testing of a test script can be realized, the whole set of scheme can be adapted to a WeChat applet based on X5webview, and the method is applicable to all applications of an X5 kernel, namely, the embodiment of the invention can carry out automatic testing on the application based on the native webpage view or the self-defined webpage view; meanwhile, the webpage can be effectively detected, and the page loading time, the page jump information, the page loading abnormal information and the resource loading quantity can be obtained.
Fig. 7 is a schematic structural diagram of an application testing apparatus according to an embodiment of the present invention. The application testing device 1 may include: the device comprises a repacking module 10, an initialization module 20, a script generation module 30, a testing module 40, a setting module 50, a detection module 60 and a display module 70;
the repacking module 10 is used for acquiring an application to be tested and repacking the application to be tested according to the test packet data to obtain a target application; the process of the target application includes the test package data;
an initialization module 20, configured to start the target application, initialize the test packet data in the target application, and create a process communication service for the process of the target application and the process of the test application; the process of the test application is used for loading the test script;
the script generating module 30 is configured to search a web view in a process of the target application according to the operation instruction and the test packet data for the target application, acquire control information associated with the operation instruction in the web view, and generate a test script according to the control information and an operation behavior indicated by the operation instruction;
and the test module 40 is configured to load the test script, search the web view in the process of the target application according to the test script and the test packet data, search the coordinate information corresponding to the control information in the web view, perform simulation operation on the control located at the coordinate information in the target application, and generate a test result.
For specific functional implementation manners of the repackaging module 10, the initializing module 20, the script generating module 30, and the testing module 40, reference may be made to S101 to S103 in the embodiment corresponding to fig. 1, which is not described herein again.
The setting module 50 is used for acquiring a detection instruction and setting a user-defined webpage callback interface service according to the detection instruction;
the detection module 60 is configured to trigger the customized web page callback interface service to detect and record web page detection information in the interface of the target application if it is detected that the interface of the target application includes the web page view;
and the display module 70 is configured to add the web page detection information to the test result, and display the added test result.
For specific functional implementation manners of the setting module 50, the detecting module 60, and the displaying module 70, reference may be made to S401 to S403 in the embodiment corresponding to fig. 6, which is not described herein again.
Further, referring to fig. 7 again, in fig. 7, the script generating module 30 may include: a first array generating unit 301, a page traversing unit 302, a first control obtaining unit 303, a first script converting unit 304, a second array generating unit 305, a second control obtaining unit 306, and a second script converting unit 307;
a first array generating unit 301, configured to read, according to the test packet data, a view structure tree corresponding to an interface of the target application in a process of the target application, and traverse the view structure tree to generate a view structure array;
the page traversing unit 302 is configured to receive an operation instruction for the target application, and traverse the page content of the web view through the query code segment when the web view is found at the operation position indicated by the operation instruction according to the view structure array, so as to obtain a traversal result;
a first control obtaining unit 303, configured to obtain coordinate information of an operation position indicated by the operation instruction, and obtain control information corresponding to the coordinate information from the traversal result;
the first script conversion unit 304 is configured to return the control information to the test application according to a callback function in the target application, and convert the control information and the operation behavior indicated by the operation instruction into the test script in the test application.
A second array generating unit 305, configured to read, according to the test packet data, a view structure tree corresponding to an interface of the target application in a process of the target application, and traverse the view structure tree to generate a view structure array;
a second control obtaining unit 306, configured to receive an operation instruction for the target application, and obtain, according to the view structure array, control information of an operation position indicated by the operation instruction from page content of the web page view through a loadURL when the web page view is found at the operation position indicated by the operation instruction;
a second script conversion unit 307, configured to intercept the control information obtained by the loadURL, return the intercepted control information to the test application through a coding language registration channel, and convert the control information and an operation behavior indicated by the operation instruction into the test script in the test application.
For specific functional implementation manners of the first array generating unit 301, the page traversing unit 302, the first control obtaining unit 303, the first script converting unit 304, the second array generating unit 305, the second control obtaining unit 306, and the second script converting unit 307, reference may be made to S201 to S204 in the embodiment corresponding to fig. 4, which is not described herein again. When the first array generating unit 301, the page traversing unit 302, the first control obtaining unit 303, and the first script converting unit 304 are used for recording scripts, the second array generating unit 305, the second control obtaining unit 306, and the second script converting unit 307 stop operating. When the second array generating unit 305, the second control obtaining unit 306, and the second script converting unit 307 are used for recording scripts, the first array generating unit 301, the page traversing unit 302, the first control obtaining unit 303, and the first script converting unit 304 stop operating. The first array generation unit 301 and the second array generation unit 305 may be combined into the same unit.
Further, referring to fig. 7 again, in fig. 7, the test module 40 may include: an instruction sending unit 401, a third array generating unit 402, a coordinate acquiring unit 403, a coordinate sending unit 404, and a simulation operating unit 405;
an instruction sending unit 401, configured to load the test script in the process of the test application, and send the test instruction in the test script to the process of the target application through the process communication service;
a third array generating unit 402, configured to read, according to the test packet data and the test instruction, a view structure tree corresponding to an interface of the target application in a process of the target application, and traverse the view structure tree to generate a view structure array;
a coordinate obtaining unit 403, configured to, if a web page view is found in the object to be operated indicated by the test instruction according to the view structure array, find a control corresponding to the control information in the test script in the web page view by using an inquiry code segment, and obtain coordinate information of the control;
a coordinate sending unit 404, configured to return the coordinate information of the control to the system test frame through a callback function;
a simulation operation unit 405, configured to perform a simulation operation on the control located at the coordinate information in the target application based on the system test framework, so as to generate a test result.
For specific implementation manners of the instruction sending unit 401, the third array generating unit 402, the coordinate obtaining unit 403, the coordinate sending unit 404, and the simulation operating unit 405, reference may be made to S301 to S305 in the embodiment corresponding to fig. 5, which is not described herein again.
Further, referring to fig. 7 again, the setting module 50 in fig. 7 may include: an instruction acquisition unit 502, a function rewriting unit 501, a creation unit 503;
an instruction obtaining unit 502 configured to obtain a detection instruction;
a function rewriting unit 501, configured to, if the web page view includes a web page callback interface service, obtain the web page callback interface service according to the detection instruction, and rewrite a function in the web page callback interface service to obtain a customized web page callback interface service;
a creating unit 503, configured to create the customized web page callback interface service if the web page view does not include the web page callback interface service.
The specific implementation manners of the instruction obtaining unit 502, the function rewriting unit 501, and the creating unit 503 may refer to S401 in the embodiment corresponding to fig. 6, which is not described herein again.
Further, referring to fig. 7 again, the detecting module 60 in fig. 7 may include: a trigger unit 601, a detection information recording unit 602, and a determination unit 603;
the triggering unit 601 is configured to trigger the customized web callback interface service to detect a web page in the target application if it is detected that the interface of the target application includes the web view;
a detection information recording unit 602, configured to record, if it is detected that the web page is in a loading start state, web page loading start time information through a first function in the customized web page callback interface service;
the detection information recording unit 602 is further configured to record, if it is detected that the web page is in an end-of-loading state, web page loading end time information through a second function in the customized web page callback interface service;
the detection information recording unit 602 is further configured to record page jump information through a third function in the customized web page callback interface service if it is detected that the web page is in a page jump state;
the detection information recording unit 602 is further configured to record page loading abnormal information through a fourth function in the customized web page callback interface service if it is detected that the web page is in a page loading abnormal state;
the detection information recording unit 602 is further configured to count the resource loading amount through a fifth function in the customized web page callback interface service if it is detected that the web page is in the resource request state;
a determining unit 603, configured to determine the web page loading start time information, the web page loading end time information, the page jump information, the page loading exception information, and the resource loading amount as the web page detection information.
For specific implementation manners of the triggering unit 601, the detection information recording unit 602, and the determining unit 603, reference may be made to S402 in the embodiment corresponding to fig. 6, which is not described herein again.
According to the embodiment of the invention, through a repacking mechanism, a process of a target application can contain test packet data, and further grabbing and event simulation of control information in a native webpage view or a self-defined webpage view (such as X5webview) can be realized based on the test packet data, so that recording and automatic testing of a test script can be realized, the whole set of scheme can be adapted to a WeChat applet based on X5webview, and the method is applicable to all applications of an X5 kernel, namely, the embodiment of the invention can carry out automatic testing on the application based on the native webpage view or the self-defined webpage view; meanwhile, the webpage can be effectively detected, and the page loading time, the page jump information, the page loading abnormal information and the resource loading quantity can be obtained.
Fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 8, the terminal device 1000 may include: the processor 1001, the network interface 1004 and the memory 1005, and the terminal device 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., a WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 1004 may optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 8, the memory 1004, which is a type of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the terminal device 1000 shown in fig. 8, the network interface 1004 may provide a network communication function; the user interface 1003 is an interface for providing a user with input; and the processor 1001 may be used to invoke a device control application stored in the memory 1004 to implement:
acquiring an application to be tested, and repacking the application to be tested according to test packet data to obtain a target application; the process of the target application includes the test package data;
searching a webpage view in the process of the target application according to the operation instruction and the test packet data aiming at the target application, acquiring control information associated with the operation instruction in the webpage view, and generating a test script according to the control information and the operation behavior indicated by the operation instruction;
and loading the test script, searching the webpage view in the process of the target application according to the test script and the test package data, searching the coordinate information corresponding to the control information in the webpage view, and performing simulation operation on the control positioned at the coordinate information in the target application to generate a test result.
Specifically, the terminal device 1000 may obtain the application to be tested through the test application, for example, an application list may be displayed in the test application, the application list may include a plurality of application names, and a user may click a certain application name in the application list, so that the terminal device 1000 selects the application corresponding to the application name as the application to be tested according to a click instruction. The test application may refer to an application installed in the terminal apparatus 1000 for testing an application program. The test application can comprise a test service, the test service can provide test packet data and a repacking function, namely after the test application selects the application to be tested, the application to be tested can be repacked through the test packet data, namely the test service can pack the test packet data into the application to be tested, the application to be tested containing the test packet data is called as a target application, and the test packet data can be a dex file. The test package data may include a test module code, and the test module code has a function of acquiring control information in the current page, so that the target application can have the function of acquiring the control information in the current page by running the test module code.
After repacking the application to be tested, the target application can be started, in the starting process, the test package data in the target application can be loaded together, and the test package data is initialized, wherein the initializing process can comprise the following steps: initializing katappication, initializing Art Hook. The kataplication can be called as a self-defined application initialization class, in an Android system, each application start can execute the application initialization class firstly, the kataplication has the effect that communication service and registration interface interception service are established during application initialization, namely, in the initialization process, process communication service can be established for a process of a target application and a process of a test application based on the kataplication, the process communication service can be a socket server, and the socket server can provide socket communication, namely, data communication between two different application processes can be realized through the socket server. The process communication service is located in a process of the target application. The Art Hook can be called method interception, and is used for intercepting a certain method when a system calls the method, so that a specified function is executed before and after the method is executed. Therefore, by initializing the Art Hook, the embodiment of the invention can intercept the application to be tested based on the Art Hook after the application to be tested is started so as to start the socket communication service. The processes of initialization of katappication and initialization of Art Hook are realized in the process of the target application.
Among other things, the web page view may include a native webview or an X5 webview. Before the automated test is executed, a test script of the target application needs to be generated, and the test script is used for performing the automated test on the target application subsequently. A recording key for recording a test script may be displayed in an interface of a test application in the terminal device 1000, when a user clicks the recording key, the terminal device 1000 may trigger the test application to send a script recording command according to a click instruction, the test application may specifically send the script recording command to a target application through socket communication, after a socket server in the target application monitors the script recording command, based on a function provided by the test packet data and the script recording command, start to record all operation behaviors of the user on the target application (including operations such as clicking and sliding on the target application), and may record information of a controlled element in each operation behavior, where the information of the controlled element may include xpath (extensible markup language path language) information of the controlled element. The specific process of recording the information of the operated control in each operation behavior may be as follows: based on that the test packet data in the target application can be reflected and read to the view tree of the current activity (because the test packet data and the target application are in the same process, the view tree can be directly obtained based on the test packet data, and also the native view or X5 view in the view tree can be obtained), then the whole view tree is traversed through a depth-first traversal algorithm, and then stored in a list array, and then according to the list array and the operation instruction (such as the operation instruction generated by clicking and sliding) for the target application in the recording process, whether the coordinate information indicated by the operation instruction has the native view or X5 view is searched, if so, a query code segment based on JavaScript (an transliteration script language, which is a dynamic type, a weak type, a prototype-based language, and a built-in support type) is injected, and through the query code segment, the document of the mobile end page (such as the page in the wechat web), searching a control meeting the condition (namely, a control located in the coordinate information indicated by the operation instruction) in the document through the coordinate information indicated by the operation instruction, obtaining the control information of the control meeting the condition, finally returning the control information and all recorded operation behaviors to the test application through a callback function provided by the evaluateJavascript, and converting the control information and the operation behaviors indicated by the operation instruction into the test script in the test application, namely, converting the operation behavior information and the operated control information generated by each operation of the target application by the user into the test script until the user finishes the operation on the target application, and finishing the whole script recording process. The evaluateJavascript is a method name provided by the Android system, and can also be called as a Javascript code execution function.
After the test script is recorded, terminal device 1000 may load the test script through the test application, and the test application may generate a test instruction in a loading process, and send each test instruction one by one to a process communication service of the target application through socket communication, so that the content indicated by each test instruction may be executed one by one in the target application based on the test packet data. The sequence of sending the test instruction is consistent with the sequence of each operation behavior in the process of recording the test script, the content indicated by one test instruction is one operation behavior aiming at a target application in the process of recording the test script, and the test instruction can also contain control information associated with the operation instruction in the process of recording. After receiving the test command, the target application may read a view tree of activity corresponding to the test command based on the reflection of the test packet data (since the test packet data and the target application are in the same process, the view tree may be directly obtained based on the test packet data, and also a native webview or an X5webview in the view tree may be obtained), traverse the entire view tree through a depth-first traversal algorithm, and then store in a list array, then search, according to the test command and the list array, whether an operation object included in the test command has a native webview or an X5webview, if so, inject a query code segment based on JavaScript, because the test command includes control information (such as xpath information of the control), so that it is not necessary to re-traverse the document code segment of the mobile end webpage (i.e., the webpage of the target application) based on the query code segment, and only need to search the control corresponding to the control information in the test command through the query, and obtaining the coordinate information of the control in the webpage, and returning the coordinate information of the control to the instrumentation frame through a callback function provided by the evaluateJavascript. In the instrumentation framework, simulation operation is performed on the control at the obtained coordinate information based on the operation behavior in the test instruction, if the operation behavior contained in the test instruction is "click operation on the control a", the simulation click can be performed on the control a at the coordinate information based on the instrumentation framework, so as to obtain an output result corresponding to the simulation operation, when each test instruction in the test script is completed, the automatic test on the target application is completed, and further, the output result corresponding to each test instruction is determined as a test result, so that a tester can compare the test result with an expected result, so as to analyze the performance of the target application.
Because the test packet data is in the process of the target application, the test function provided by the test packet data can directly capture the page content of the original webview or the original X5webview in the target application, and therefore, even if the target application uses the customized X5webview (for example, the target application is a small program in WeChat), the test function provided by the test packet data can also directly capture the page content of the webpage of the target application, so that the test script can be successfully recorded for the target application, and the target application can also be successfully subjected to automatic test based on the test script. Because the test packet data is in the process of the target application, the test function provided by the test packet data can also directly call the evaluateJavascript method of the original webview or the X5webview in the target application, and the evaluateJavascript method is a system API method, so that the callback method provided by the evaluateJavascript method has higher stability. Therefore, the embodiment of the invention can enable the process of the target application to contain the test packet data through a repacking mechanism, and further realize the capture of control information and the event simulation based on the test packet data, the whole set of scheme can be adapted to the WeChat applet and can be suitable for all applications of the X5 kernel, and the problem that a test framework cannot be adapted to X5webview in the prior art is solved.
In one embodiment, the processor 1001 may further perform the following steps:
starting the target application, initializing the test packet data in the target application, and establishing process communication service for the process of the target application and the process of the test application; the process of the test application is used to load the test script.
In one embodiment, when the processor 1001 searches a web page view in a process of the target application according to the operation instruction and the test packet data for the target application, acquires control information associated with the operation instruction in the web page view, and generates a test script according to the control information and an operation behavior indicated by the operation instruction, the following steps are specifically performed:
reading a view structure tree corresponding to the interface of the target application in the process of the target application according to the test packet data, and traversing the view structure tree to generate a view structure array;
receiving an operation instruction for the target application, and traversing the page content of the webpage view through a query code segment when the webpage view is found at the operation position indicated by the operation instruction according to the view structure array to obtain a traversal result;
acquiring coordinate information of an operation position indicated by the operation instruction, and acquiring control information corresponding to the coordinate information from the traversal result;
and returning the control information to the test application according to the callback function in the target application, and converting the control information and the operation behavior indicated by the operation instruction into the test script in the test application.
In one embodiment, when the processor 1001 searches a web page view in a process of the target application according to the operation instruction and the test packet data for the target application, acquires control information associated with the operation instruction in the web page view, and generates a test script according to the control information and an operation behavior indicated by the operation instruction, the following steps are specifically performed:
reading a view structure tree corresponding to the interface of the target application in the process of the target application according to the test packet data, and traversing the view structure tree to generate a view structure array;
receiving an operation instruction for the target application, and when the webpage view is found at the operation position indicated by the operation instruction according to the view structure array, acquiring control information of the operation position indicated by the operation instruction from the page content of the webpage view through a loadURL;
intercepting the control information acquired by the loadURL, returning the intercepted control information to the test application through a coding language registration channel, and converting the control information and the operation behavior indicated by the operation instruction into the test script in the test application.
In one embodiment, when the processor 1001 executes and loads the test script, searches for the web page view in the process of the target application according to the test script and the test packet data, searches for coordinate information corresponding to the control information in the web page view, performs simulation operation on the control located at the coordinate information in the target application, and generates a test result, the following steps are specifically executed:
loading the test script in the process of the test application, and sending the test instruction in the test script to the process of the target application through the process communication service;
reading a view structure tree corresponding to the interface of the target application in the process of the target application according to the test package data and the test instruction, and traversing the view structure tree to generate a view structure array;
if the webpage view is found in the object to be operated indicated by the test instruction according to the view structure array, finding a control corresponding to the control information in the test script in the webpage view through an inquiry code segment, and acquiring coordinate information of the control;
returning the coordinate information of the control to a system testing frame through a callback function;
and performing simulation operation on the control positioned at the coordinate information in the target application based on the system test framework to generate a test result.
In one embodiment, the processor 1001 may further perform the following steps:
acquiring a detection instruction, and setting a user-defined webpage callback interface service according to the detection instruction;
if the interface of the target application contains the webpage view, triggering the user-defined webpage callback interface service to detect and record webpage detection information in the interface of the target application;
and adding the webpage detection information to the test result, and displaying the added test result.
In an embodiment, when the processor 1001 executes the detection instruction, and sets the customized web page callback interface service according to the detection instruction, the following steps may be performed:
acquiring a detection instruction;
if the webpage view contains the webpage callback interface service, acquiring the webpage callback interface service according to the detection instruction, and rewriting a function in the webpage callback interface service to obtain a user-defined webpage callback interface service;
and if the webpage view does not contain the webpage callback interface service, creating the user-defined webpage callback interface service.
In an embodiment, when the processor 1001 triggers the customized web page callback interface service to detect and record web page detection information in the interface of the target application if it is detected that the interface of the target application includes the web page view, the following steps may be performed:
if the interface of the target application is detected to contain the webpage view, triggering the user-defined webpage callback interface service to detect the webpage in the target application;
if the webpage is detected to be in the loading starting state, recording webpage loading starting time information through a first function in the user-defined webpage callback interface service;
if the webpage is detected to be in the loading ending state, recording webpage loading ending time information through a second function in the user-defined webpage callback interface service;
if the webpage is detected to be in a page skipping state, recording page skipping information through a third function in the customized webpage callback interface service;
if the webpage is detected to be in a page loading abnormal state, recording page loading abnormal information through a fourth function in the user-defined webpage callback interface service;
if the webpage is detected to be in the resource request state, counting the resource loading quantity through a fifth function in the user-defined webpage callback interface service;
and determining the webpage loading starting time information, the webpage loading ending time information, the page jump information, the page loading abnormal information and the resource loading quantity as the webpage page detection information.
The customized web page callback interface service may include a first function (onPageStarted), a second function (onPageFinished), a third function (shouldoverridenurlloading), a fourth function (onreceivedreror), and a fifth function (shouldntercaptrequest). The onPageStarted is used for detecting the starting time of page loading, and is called back when the webpage is started to be loaded; the onPageFinished is used for detecting the time of page loading completion and calling back when the webpage loading is finished; shouldoverladerUrlLoading is used for detecting page jump information by intercepting url jump; onReceivedError is used for detecting page loading abnormal information and can be called back when a page loading error occurs; the shouldnterceptrequest is used for counting the loading number of the resource and is called back by the function every time the resource is requested.
According to the embodiment of the invention, through a repackaging mechanism, the process of the target application can contain the test packet data, and the capture and event simulation of the control information in the native webpage view or the customized webpage view (such as X5webview) can be realized based on the test packet data, so that the recording and automatic test of the test script can be realized, the whole set of scheme can be adapted to the WeChat applet based on X5webview, and the method is applicable to all applications of X5 kernels, namely, the embodiment of the invention can carry out automatic test on the applications based on the native webpage view or the customized webpage view; meanwhile, the webpage can be effectively detected, and the page loading time, the page jump information, the page loading abnormal information and the resource loading quantity can be obtained.
Further, here, it is to be noted that: an embodiment of the present invention further provides a computer storage medium, where the aforementioned computer program executed by the application testing apparatus 1 is stored in the computer storage medium, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the application testing method in the embodiment corresponding to fig. 1 to fig. 6 can be executed, and therefore, details will not be repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer storage medium to which the present invention relates, reference is made to the description of the method embodiments of the present invention.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (11)

1. An application testing method, comprising:
acquiring an application to be tested, and repacking the application to be tested according to the test packet data to obtain a target application; the process of the target application includes the test package data;
searching a webpage view in the process of the target application according to the operation instruction and the test packet data aiming at the target application, acquiring control information associated with the operation instruction in the webpage view, and generating a test script according to the control information and the operation behavior indicated by the operation instruction; wherein, this step includes: searching whether the coordinate information indicated by the operation instruction has native webview or X5 webview; if yes, injecting a query code segment, searching a control corresponding to the coordinate information based on the query code segment, and acquiring control information of the control; returning the control information and the operation behavior indicated by the operation instruction to a test application through a callback function, and converting the control information and the operation behavior into the test script in the test application;
loading the test script, searching the webpage view in the process of the target application according to the test script and the test package data, searching the coordinate information corresponding to the control information in the webpage view, and performing simulation operation on the control located at the coordinate information in the target application to generate a test result, wherein the step comprises the following steps: generating a plurality of test instructions, wherein each test instruction has an operation behavior corresponding to the test instruction and an operation object for the operation behavior; searching whether an operation object contained in the test instruction has native webview or X5 webview; if yes, injecting a query code segment, and searching a control corresponding to the control information in the test instruction through the query code segment; acquiring coordinate information of the control on a webpage; and performing simulation operation on the control at the coordinate information based on the operation behavior corresponding to the test instruction to generate a test result.
2. The method of claim 1, further comprising:
starting the target application, initializing the test packet data in the target application, and creating process communication service for the process of the target application and the process of the test application; the process of the test application is used to load the test script.
3. The method of claim 2, wherein the searching for a web page view in a process of the target application according to an operation instruction and the test package data for the target application, acquiring control information associated with the operation instruction in the web page view, and generating a test script according to the control information and an operation behavior indicated by the operation instruction comprises:
reading a view structure tree corresponding to an interface of the target application in the process of the target application according to the test packet data, and traversing the view structure tree to generate a view structure array;
receiving an operation instruction for the target application, and traversing the page content of the webpage view through a query code segment when the webpage view is found at an operation position indicated by the operation instruction according to the view structure array to obtain a traversal result;
acquiring coordinate information of an operation position indicated by the operation instruction, and acquiring control information corresponding to the coordinate information from the traversal result;
and returning the control information to the test application according to the callback function in the target application, and converting the control information and the operation behavior indicated by the operation instruction into the test script in the test application.
4. The method of claim 2, wherein the searching a web page view in a process of the target application according to the operation instruction and the test package data for the target application, acquiring control information associated with the operation instruction in the web page view, and generating a test script according to the control information and an operation behavior indicated by the operation instruction comprises:
reading a view structure tree corresponding to the interface of the target application in the process of the target application according to the test packet data, and traversing the view structure tree to generate a view structure array;
receiving an operation instruction for the target application, and when the webpage view is found at the operation position indicated by the operation instruction according to the view structure array, acquiring control information of the operation position indicated by the operation instruction from the page content of the webpage view through a loadURL;
intercepting the control information acquired by the loadURL, returning the intercepted control information to the test application through a coding language registration channel, and converting the control information and the operation behavior indicated by the operation instruction into the test script in the test application.
5. The method of claim 2, wherein the loading the test script, searching the web page view in the process of the target application according to the test script and the test packet data, searching coordinate information corresponding to the control information in the web page view, and performing a simulation operation on a control located at the coordinate information in the target application to generate a test result, comprises:
loading the test script in the process of the test application, and sending the test instruction in the test script to the process of the target application through the process communication service;
reading a view structure tree corresponding to the interface of the target application in the process of the target application according to the test package data and the test instruction, and traversing the view structure tree to generate a view structure array;
if the webpage view is found in the object to be operated indicated by the test instruction according to the view structure array, searching a control corresponding to the control information in the test script in the webpage view through a query code segment, and acquiring coordinate information of the control;
returning the coordinate information of the control to a system testing frame through a callback function;
and performing simulation operation on the control positioned at the coordinate information in the target application based on the system test framework to generate a test result.
6. The method of claim 1, further comprising:
acquiring a detection instruction, and setting a user-defined webpage callback interface service according to the detection instruction;
if the interface of the target application contains the webpage view, triggering the user-defined webpage callback interface service to detect and record webpage detection information in the interface of the target application;
and adding the webpage detection information to the test result, and displaying the added test result.
7. The method of claim 6, wherein said obtaining a detection instruction and setting a custom web page callback interface service according to said detection instruction comprises:
acquiring a detection instruction;
if the webpage view contains the webpage callback interface service, acquiring the webpage callback interface service according to the detection instruction, and rewriting a function in the webpage callback interface service to obtain a user-defined webpage callback interface service;
and if the webpage view does not contain the webpage callback interface service, creating the user-defined webpage callback interface service.
8. The method of claim 6, wherein the triggering the customized web page callback interface service to detect and record web page detection information in the interface of the target application if it is detected that the interface of the target application includes the web page view comprises:
if the interface of the target application contains the webpage view, triggering the user-defined webpage callback interface service to detect the webpage in the target application;
if the webpage is detected to be in the loading starting state, recording webpage loading starting time information through a first function in the user-defined webpage callback interface service;
if the webpage is detected to be in the loading ending state, recording webpage loading ending time information through a second function in the customized webpage callback interface service;
if the webpage is detected to be in a page jump state, recording page jump information through a third function in the user-defined webpage callback interface service;
if the webpage is detected to be in a page loading abnormal state, recording page loading abnormal information through a fourth function in the user-defined webpage callback interface service;
if the webpage is detected to be in the resource request state, counting the resource loading quantity through a fifth function in the user-defined webpage callback interface service;
and determining the webpage loading starting time information, the webpage loading ending time information, the page jump information, the page loading abnormal information and the resource loading quantity as the webpage page detection information.
9. An application testing apparatus, comprising:
the repacking module is used for acquiring an application to be tested and repacking the application to be tested according to the test packet data to obtain a target application; the process of the target application includes the test package data;
the script generation module is used for searching a webpage view in the process of the target application according to the operation instruction and the test packet data aiming at the target application, acquiring control information associated with the operation instruction in the webpage view, and generating a test script according to the control information and the operation behavior indicated by the operation instruction; the script generation module is specifically configured to find whether the coordinate information indicated by the operation instruction has a native webview or an X5 webview; if yes, injecting a query code segment, searching a control corresponding to the coordinate information based on the query code segment, and acquiring control information of the control; returning the control information and the operation behavior indicated by the operation instruction to a test application through a callback function, and converting the control information and the operation behavior into the test script in the test application;
the test module is used for loading the test script, searching the webpage view in the process of the target application according to the test script and the test packet data, searching the coordinate information corresponding to the control information in the webpage view, and performing simulation operation on the control located at the coordinate information in the target application to generate a test result, wherein the test module is specifically used for generating a plurality of test instructions, and each test instruction has an operation behavior corresponding to the test instruction and an operation object for the operation behavior; searching whether an operation object contained in the test instruction has a native webview or an X5 webview; if yes, injecting a query code segment, and searching a control corresponding to the control information in the test instruction through the query code segment; acquiring coordinate information of the control on a webpage; and performing simulation operation on the control at the coordinate information based on the operation behavior corresponding to the test instruction to generate a test result.
10. A terminal device, comprising: a processor and a memory;
the processor is coupled to a memory, wherein the memory is configured to store program code and the processor is configured to invoke the program code to perform the method of any of claims 1-8.
11. A computer storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method according to any one of claims 1-8.
CN201810367819.XA 2018-04-23 2018-04-23 Application testing method and device and computer storage medium Active CN108595329B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810367819.XA CN108595329B (en) 2018-04-23 2018-04-23 Application testing method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810367819.XA CN108595329B (en) 2018-04-23 2018-04-23 Application testing method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN108595329A CN108595329A (en) 2018-09-28
CN108595329B true CN108595329B (en) 2022-08-26

Family

ID=63613960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810367819.XA Active CN108595329B (en) 2018-04-23 2018-04-23 Application testing method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN108595329B (en)

Families Citing this family (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109308263B (en) * 2018-09-29 2021-10-22 北京云测信息技术有限公司 Applet testing method, device and equipment
CN109542440A (en) * 2018-11-29 2019-03-29 金蝶软件(中国)有限公司 To the operating method and device of window, computer installation and readable storage medium storing program for executing
CN109815118A (en) * 2018-12-14 2019-05-28 深圳壹账通智能科技有限公司 Data base management method and device, electronic equipment and computer readable storage medium
CN109976973B (en) * 2019-02-19 2021-05-25 深圳点猫科技有限公司 Online exception monitoring method for small program and electronic equipment
CN110139302B (en) * 2019-05-17 2022-12-06 广州品唯软件有限公司 App business type positioning method and device
CN110457211B (en) * 2019-07-23 2022-05-06 腾讯科技(深圳)有限公司 Script performance test method, device and equipment and computer storage medium
CN110618934A (en) * 2019-08-15 2019-12-27 重庆金融资产交易所有限责任公司 Front-end automatic test debugging method and device and computer readable storage medium
CN110750463B (en) * 2019-10-29 2023-06-23 百度在线网络技术(北京)有限公司 Method, device, system, equipment and medium for testing small program
CN110865799A (en) * 2019-10-31 2020-03-06 爱钱进(北京)信息科技有限公司 Control information display method and device and storage medium
CN113971059B (en) * 2020-07-22 2024-10-29 北京奇虎科技有限公司 Device connection state recovery method, device and storage medium
CN114064447B (en) * 2020-08-05 2024-05-31 腾讯科技(深圳)有限公司 Interface testing method and device, storage medium and terminal
US11042465B1 (en) * 2020-09-02 2021-06-22 Coupang Corp. Systems and methods for analyzing application loading times
CN112269746A (en) * 2020-11-10 2021-01-26 京东数科海益信息科技有限公司 Automated testing method and related equipment
CN114647466A (en) * 2020-12-17 2022-06-21 国信君和(北京)科技有限公司 Page content extraction method, device, equipment and computer readable storage medium
CN112597031A (en) * 2020-12-26 2021-04-02 中国农业银行股份有限公司 Web page test case generation device and method
CN112882933B (en) * 2021-02-09 2024-08-16 京东科技信息技术有限公司 Script recording method, script recording device, script recording equipment and storage medium
CN113032264B (en) * 2021-03-29 2024-09-06 杭州网易数之帆科技有限公司 Page view control detection method and device
CN112988597B (en) * 2021-04-27 2021-08-10 北京全路通信信号研究设计院集团有限公司 Automatic test visualization method and system based on state transition
CN114116450A (en) * 2021-10-25 2022-03-01 北京快乐茄信息技术有限公司 Quality testing method, quality testing device, electronic equipment and storage medium
CN114326677A (en) * 2021-12-30 2022-04-12 上海洛轲智能科技有限公司 Vehicle machine testing method and device
WO2023225801A1 (en) * 2022-05-23 2023-11-30 北京小米移动软件有限公司 Automated testing method and apparatus for application
CN119202420A (en) * 2023-06-25 2024-12-27 华为技术有限公司 Page display method, electronic device and storage medium
CN117421142B (en) * 2023-11-10 2024-11-22 浙江丰沃物联科技有限公司 A method, system, electronic device and storage medium for automatically generating a digital human behavior module execution flow chart
CN118349317B (en) * 2024-05-10 2024-12-27 成都玖锦科技有限公司 SCPI instruction recording method and device of instrument

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8788885B1 (en) * 2011-09-23 2014-07-22 Amazon Technologies, Inc. Intermediary for testing content and applications
CN105740138B (en) * 2014-12-08 2018-12-21 阿里巴巴集团控股有限公司 Test method, test device and the test macro of application
CN104699604B (en) * 2015-02-28 2017-11-07 百度在线网络技术(北京)有限公司 Method and device for testing the Android application that kernel is browsed based on customization
CN106897215A (en) * 2017-01-20 2017-06-27 华南理工大学 A kind of method gathered based on WebView webpages loading performance and user behavior flow data

Also Published As

Publication number Publication date
CN108595329A (en) 2018-09-28

Similar Documents

Publication Publication Date Title
CN108595329B (en) Application testing method and device and computer storage medium
US10824404B2 (en) Methods and systems for uploading a program based on a target network platform
US10417065B2 (en) Method and system for automated agent injection in container environments
Zheng et al. Automated test input generation for android: Towards getting there in an industrial case
US10853232B2 (en) Adaptive system for mobile device testing
CN111026645B (en) User interface automatic test method and device, storage medium and electronic equipment
US9355017B2 (en) Automated error checking system for a software application and method therefor
US9720799B1 (en) Validating applications using object level hierarchy analysis
CN109558320B (en) System testing method, device, system, equipment and computer readable storage medium
US10942837B2 (en) Analyzing time-series data in an automated application testing system
CN110765464B (en) Vulnerability detection method, device, equipment and computer storage medium
CN105335283A (en) Application testing method and device in terminal equipment
CN110457211B (en) Script performance test method, device and equipment and computer storage medium
CN105740144B (en) A kind of automated testing method and system of Android mobile terminal
US20190087310A1 (en) Mobile application program testing method, server, terminal, and storage medium
CN109375921B (en) Page file quick compiling method and device, storage device and computer device
WO2018108041A1 (en) Remote debugging method and device, and computer storage medium
CN113391874B (en) Virtual machine detection countermeasure method and device, electronic equipment and storage medium
CN110879781A (en) Program debugging method and device, electronic equipment and computer readable storage medium
CN106557411B (en) Method and system for testing Hybrid application in Android system
CN111414525B (en) Method, device, computer equipment and storage medium for acquiring data of applet
CN113127329B (en) Script debugging method, device and computer storage medium
US9792202B2 (en) Identifying a configuration element value as a potential cause of a testing operation failure
CN111427770B (en) Resource testing method and related equipment
CN114706767A (en) A code coverage collection method, device and device

Legal Events

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