CN110825622A - Software testing method, device, equipment and computer readable medium - Google Patents
Software testing method, device, equipment and computer readable medium Download PDFInfo
- Publication number
- CN110825622A CN110825622A CN201910984934.6A CN201910984934A CN110825622A CN 110825622 A CN110825622 A CN 110825622A CN 201910984934 A CN201910984934 A CN 201910984934A CN 110825622 A CN110825622 A CN 110825622A
- Authority
- CN
- China
- Prior art keywords
- current page
- page
- source code
- code file
- xml source
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/986—Document structures and storage, e.g. HTML extensions
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a software testing method, a software testing device, software testing equipment and a computer readable medium, and relates to the technical field of computers. One embodiment of the method comprises: acquiring an XML source code file of a current page; if the XML source code file of the current page comprises all the special controls of the APP home page, determining that the current page is the APP home page; and if the XML source code file of the current page does not comprise all the special controls of the APP home page, determining that the current page is a non-home page, and operating the current page based on the return times of the current page. This embodiment can improve the test efficiency.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a software testing method, apparatus, device, and computer readable medium.
Background
In the background of the mobile internet era, mobile Applications (APP) have become the main channel for connecting users. When the APP version quickly and iteratively preempts market first opportunity, the APP quality needs to be strictly ensured.
The APP automatic test is that automatic scripts are compiled according to business requirements, batch scheduling and execution are performed on the terminal through a test framework, and the APP test is automatically completed.
The automated testing has the following advantages:
1. the execution efficiency is high.
The test task can be started at any time, and the unattended execution speed is high. And in the execution process, system logs and screenshots can be synchronously acquired, and a test report can be automatically generated.
2. And test resources are saved.
On one hand, the labor cost of repeated labor is reduced, and on the other hand, the hardware investment is reduced through time division multiplexing of the test terminal.
3. The defects of manual testing are overcome.
The test can be carried out in a large scale and for a long time, the consistency of each test execution is strictly ensured, and artificial relaxation and errors are avoided.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: after the automatic test case is executed, the automatic test case stays in the transaction success page, and if the next case needs to be executed, the initial page of the APP needs to be returned. Whether the homepage is returned based on the script or the APP is restarted, the problem of low execution efficiency exists.
Disclosure of Invention
In view of this, embodiments of the present invention provide a software testing method, apparatus, device and computer readable medium, which can improve testing efficiency.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a software testing method including:
acquiring an XML source code file of a current page;
if the XML source code file of the current page comprises all the special controls of the APP home page, determining that the current page is the APP home page;
and if the XML source code file of the current page does not comprise all the special controls of the APP home page, determining that the current page is a non-home page, and operating the current page based on the return times of the current page.
The operating the current page based on the number of times of return of the current page includes:
if the return times of the current page are more than or equal to the maximum times, restarting the APP to return to the APP home page;
and if the return times of the current page are less than the maximum times, returning to the previous level of interface operation, and acquiring the XML source code file of the current page again.
The acquiring of the XML source code file of the current page includes:
the current page is a native page, and an XML source code file of the current page is generated based on the service provided by an operating system;
the current page is an H5 page, and an XML source code file of the current page is obtained by adopting a browser.
The acquiring of the XML source code file of the current page includes:
the current page is a mixed page, and an XML source code file of the current page is generated based on the service provided by an operating system;
and acquiring the XML source code file of the current page by adopting a browser after the XML source code file of the current page does not comprise all special controls of the APP home page.
Before the obtaining of the XML source code file of the current page, the method further includes:
and determining the type of the current page based on a control with the type being webkit.
According to a second aspect of the embodiments of the present invention, there is provided a software testing apparatus including:
the acquisition module is used for acquiring an XML source code file of the current page;
the determining module is used for determining that the current page is the APP home page if the XML source code file of the current page comprises all the special controls of the APP home page;
and the operation module is used for determining that the current page is a non-home page if the XML source code file of the current page does not comprise all the special controls of the APP home page, and operating the current page based on the return times of the current page.
The operation module is specifically used for restarting the APP to return to the APP home page if the return times of the current page are more than or equal to the maximum times;
and if the return times of the current page are less than the maximum times, returning to the previous level of interface operation, and acquiring the XML source code file of the current page again.
The obtaining module is specifically configured to generate an XML source code file of the current page based on a service provided by an operating system, where the current page is a native page;
the current page is an H5 page, and an XML source code file of the current page is obtained by adopting a browser.
According to a third aspect of embodiments of the present invention, there is provided a software testing electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method as described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the method as described above.
One embodiment of the above invention has the following advantages or benefits: because the XML source code file of the current page is obtained; if the XML source code file of the current page comprises all the special controls of the APP home page, determining that the current page is the APP home page; and if the XML source code file of the current page does not comprise all the special controls of the APP home page, determining that the current page is a non-home page, and operating the current page based on the return times of the current page. Whether the current page is the APP home page or not is judged according to whether the XML source code file of the current page comprises all the special controls of the APP home page or not, and then the testing efficiency can be improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a software testing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a process for determining a current page type according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the main structure of a software test apparatus according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the automatic APP test process, after the automatic test case is executed, the automatic test case stays in a transaction success page, and if the next test case needs to be executed, the APP home page needs to be returned. Several approaches may be used.
The first method is as follows:
and gradually returning the APP home page from the current page, recording the number of times of returning operation in the returning process, and recording a script. And returning to the APP home page and starting to execute the next automatic test case.
Since scripts returning to the APP home page need to be recorded from the end page in order to be decoupled from the next automated test case. The recording rollback operation times of each script are uncertain, so that the scripts cannot be used universally. Therefore, it is a heavy burden for test script writers.
Meanwhile, due to the fact that the script operation fails caused by the problems of transaction data failure, environmental abnormality and the like, an error popup window which is not in expectation can be popped up, the script which returns to the APP home page can not return to the APP home page according to expectation, and further all subsequent automatic test cases can not be executed. Therefore, the execution efficiency is low.
The second method comprises the following steps:
and restarting the APP, and initiating the next automatic test case from the APP home page.
By adopting the second mode, the problem of coupling between test cases can be solved, but the APP needs to be restarted between each automatic case. In the presence of hundreds of automatic test cases, repeated restarting of the APP will consume a large amount of time, and the efficiency of executing the automatic test is low.
The third method comprises the following steps:
and comparing whether the structural hierarchy tree of the current page is consistent with that of the APP home page or not to judge whether the APP home page is returned or not.
Each comparison requires recording, storing and traversing each father node and each child node of the structure level tree, and the implementation cost is high. In addition, if the structural hierarchy tree of the APP home page changes, synchronous updating is needed to ensure accurate positioning. As can be seen, automated testing is less efficient to execute.
In order to solve the technical problem of low execution efficiency of the automated test, the following technical scheme in the embodiment of the invention can be adopted.
Referring to fig. 1, fig. 1 is a schematic diagram of a main flow of a software testing method according to an embodiment of the present invention, and whether a current page is an APP home page is determined by whether an XML source code file of the current page includes all unique controls of the APP home page. As shown in fig. 1, the method specifically comprises the following steps:
it can be understood that the test scenario applicable to the embodiment of the present invention may be APP automated test.
And establishing debugging mode connection with the terminal through an adb connection tool, and realizing simulation operation and control on the terminal through an open source tool Apium. The terminal can be an electronic device such as a mobile phone and a tablet computer with an Android or iOS operating system.
The specific process is as follows: the upper computer is as follows: and the PC terminal builds an APP Server, collects and packages instructions of the user control APP, and the instructions comprise various parameters. Such as: a series of parameters such as the package file name (appPackage) of the APP start and the entry file name (appActivity) of the APP start are provided.
And communicating with the proxy end installed on the terminal through a standard Webdriver JSONWireProtocol protocol. And the Android agent terminal is Bootstrap. Jar of the terminal converts the received command into a command of the UIAutomator, interacts with an Android system, calls a designated APP and controls the designated APP, and returns a return result of the command to an Apigum Server of the upper computer.
S101, obtaining an XML source code file of the current page.
Extensible markup language (XML), a subset of standard generalized markup languages, is a markup language for markup electronic documents to be structured.
In the Android or iOS APP, each layout, control and screen operation event on a page is recorded in a page source code described based on an XML language, and can be displayed on a screen for a user to view and operate.
After the execution of the automatic test case is finished, the XML source code file of the current page can be obtained.
The APP page types include the following three, native page, H5 page, and hybrid page. Wherein the mixed page includes a native page and an H5 page.
The native page has different control types, properties and styles from those of a common webpage. The control trees of the Android system and the iOS system are different, and the control trees are embodied as different APP operation interface styles, different color matching and different key events. Native pages cannot be resolved by the browser kernel and must be rendered by the operating system.
The control tree of the H5 page is similar to that of a common webpage, the browser kernel is adopted for analyzing and rendering, and the APP can perform compatibility adaptation according to the size of a terminal screen.
For different page types, the XML source code file can be obtained in different modes.
In one embodiment of the invention, the type of the current page is judged based on whether only the control of which the type is webkit.
Referring to fig. 2, fig. 2 is a schematic flowchart of a process for determining a current page type according to an embodiment of the present invention, which specifically includes:
s201, whether a control of webkit.
If the control of the type webkit. webview exists in the current page, S202 is further executed. And if the control of which the type is webkit.
S202, a control of which the type is only webkit.
And if the control of which the type is only webkit.
The current page is judged to be a mixed page if the types of the current page include not only controls of webkit.
In the above embodiment, the current page type is determined based on whether there is a control of which the presence type is webkit.
In one embodiment of the invention, the current page is a native page, and the XML source code file of the current page may be generated based on services provided by the operating system.
As an example, a source code file containing all control tree structures of a current page is generated based on an accessibility service provided by an Android system. The specific implementation way is to use ADB command: and adb sheluiautomator dump, storing the Android system return file as an XML document, namely generating a source code file of the current page.
In one embodiment of the invention, the current page is an H5 page, and the XML source code file of the current page can be obtained by using a browser.
As an example, for H5 page, using Chrome-based debug protocol CDP, the page source code is captured after page load using JS injection. Specifically, a chrome browser process is started at the terminal, an API (application programming interface) provided by a Page field in a CDP (continuous data protocol) protocol is adopted, html source codes after browser kernels finish rendering a current Page are read from the browser process, and the html source codes are converted into XML source code files.
In one embodiment of the invention, some APP page body framework structures are considered to be developed with native pages because of the fast response speed. And when the page for handling certain service jumps, the H5 page is adopted, so that the H5 server can be directly updated by updating some small pages without updating the client.
Therefore, for the processing of the mixed page, the XML source code file is obtained according to the native page, and if the specified control is found, the XML source code file of the current page is generated, and then the processing is finished. And if the specified control is not found, acquiring the XML source code file according to the H5 page.
That is, for the mixed page, firstly, according to the service provided by the operating system, generating an XML source code file; and if the XML source code file of the current page does not comprise all the special controls of the APP home page, acquiring the XML source code file of the current page by adopting the browser.
If the XML source code file is obtained according to the H5 page mode. Because the CDP-based protocol is adopted, only the page source code of the H5 part can be resolved, and the page source code of the native page cannot be resolved. Therefore, it is only possible to process the page as original and then as H5.
Thus, in the embodiment of the present invention, the XML source code file can be obtained for the native page, the H5 page and the mixed page.
S102, if the XML source code file of the current page comprises all the special controls of the APP home page, the current page is determined to be the APP home page.
After the XML source code file of the current page is obtained, whether the current page is the APP home page or not can be judged.
The control has a plurality of controls on the APP home page, and compared with other pages, the control has uniqueness, namely the APP home page specific control. As one example, the unique controls may include, but are not limited to: a home title bar, a portrait picture, a search box, etc.
It will be appreciated that whether the current page is an APP home page may be determined by whether the current page includes APP home page specific controls.
It is considered that sometimes a non-APP home page specific control will be used as an APP home page specific control because of insufficient experience of the tester. Such as: the APP bottom title bar may exist in multiple pages, and the APP bottom title bar does not belong to the specific control of the APP home page. Alternatively, the APP developer multiplexes page code, resulting in the code of one control being consistent across multiple pages.
In order to avoid that it is difficult to determine whether the current page is the APP home page under the above circumstances, whether the current page is the APP home page may be determined according to all the specific controls of the APP home page.
It can be understood that if the current page does not include all the specific controls of the APP home page, it is determined that the current page is not the APP home page; only under the condition that the current page comprises all the special controls of the APP home page, the current page can be judged to be the APP home page.
As an example, APP home page specific controls are specifically: control 1, control 2, and control 3. The page A comprises a control 1 and a control 2; page B includes control 1, control 2, and control 3.
Since page a does not include control 3, page a is not the APP home page; and the page B comprises all special controls of the APP home page, and the page B is the APP home page.
XPath (XML Path language) is a Path language for recording various elements of an XML page, which can be used to determine the specific position of a part in an XML document and also can be used to position a control. In the embodiment of the present invention, the unique control XPath of the APP home page may be utilized to locate in the current page, so as to determine that the XML source code file of the current page includes all the unique controls of the APP home page.
That is to say, if all unique controls XPath of the APP home page exist in the XML source code file of the current page, it is determined that all unique controls of the APP home page are included in the XML source code file of the current page.
In the above determining process, under the condition that the number of the specific controls of the APP home page is greater than one, it needs to be determined one by one, and whether the specific controls XPath of the APP home page exists in the XML source code file of the current page.
As one example, APP home page specific controls include control 1, control 2, and control 3. In the XML source code file of the current page, whether the control 1XPath is stored or not is judged, whether the control 2XPath is stored or not is judged, and whether the control 3XPath is stored or not is judged finally. Wherein, the judging sequence of the special control is not fixed. And when judging that the specific control XPath is not included, determining that all the specific controls of the APP home page are not included in the XML source code file of the current page.
S103, if the XML source code file of the current page does not include all the special controls of the APP home page, the current page is determined to be a non-home page, and the current page is operated based on the return times of the current page.
And if the XML source code file of the current page does not comprise all the special controls of the APP home page, determining that the current page is a non-home page, and then operating the current page based on the return times of the current page.
In one embodiment of the invention, the number of times of returning of a page refers to the number of times of returning from an original page to a current page. The specific operation may be further determined by the number of returns of the current page.
To prevent encountering special boxes that cannot respond to a return operation. Namely, the phenomenon that the current page does not respond to the return key, so that the return APP home page enters a dead loop is avoided.
And under the condition that the APP home page is invalid after being returned for multiple times, namely the return times of the current page are more than or equal to the maximum times, restarting the APP to return to the APP home page. Wherein the maximum number of times may be preset. For example, an apsum may be called to perform an operation of restarting APP.
And under the condition that the return times of the current page are less than the maximum times, the current page can also return to the previous level of interface operation, the XML source code file of the current page is obtained again, and whether the XML source code file of the current page comprises all the special controls of the APP home page is judged again.
Illustratively, execution returns to the previous level of interface operations. An ADB command "ADB shell inputkeyvent 66" may be transmitted to the terminal; or, the method driver method "driver. navigator (). back ()" of the APPIUM is called.
In the embodiment of the present invention, whether the current page is the APP home page is determined by whether the XML source code file of the current page includes all the specific controls of the APP home page.
Compared with the method of separately recording the returned APP home page script, a large amount of manual recording workload is saved. Compared with the method that the decoupling between cases is realized by restarting the APP every time, a large amount of starting and loading time is saved, and the execution efficiency is greatly improved.
In addition, the APP is restarted under the condition that the APP home page is returned for multiple times and is invalid, so that case decoupling is guaranteed, and execution efficiency is further improved.
Referring to fig. 3, fig. 3 is a schematic diagram of a main structure of a software testing apparatus according to an embodiment of the present invention, where the software testing apparatus may implement a software testing method, as shown in fig. 3, the software testing apparatus specifically includes:
the obtaining module 301 is configured to obtain an XML source code file of a current page.
The determining module 302 is configured to determine that the current page is the APP home page if the XML source code file for the current page includes all the specific controls of the APP home page.
The operation module 303 is configured to determine that the current page is a non-home page if the XML source code file of the current page does not include all the specific controls of the APP home page, and operate the current page based on the number of times of returning the current page.
In an embodiment of the present invention, the operation module 303, specifically, if the number of times of returning to the current page is greater than or equal to the maximum number of times, restarts the APP to return to the APP home page;
and if the return times of the current page are less than the maximum times, returning to the previous level of interface operation, and acquiring the XML source code file of the current page again.
In an embodiment of the present invention, the obtaining module 301 is specifically configured to generate an XML source code file of a current page based on a service provided by an operating system, where the current page is a native page;
the current page is an H5 page, and the XML source code file of the current page is obtained by adopting a browser.
In an embodiment of the present invention, the obtaining module 301 is specifically configured to generate an XML source code file of a current page, where the current page is a mixed page, based on a service provided by an operating system;
and acquiring the XML source code file of the current page by adopting a browser after the XML source code file of the current page does not comprise all the special controls of the APP home page.
In an embodiment of the present invention, the obtaining module 301 is further configured to determine the type of the current page based on a control of which the type is webkit.
Fig. 4 shows an exemplary system architecture 400 to which the software testing method or the software testing apparatus of the embodiments of the present invention can be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 401, 402, 403. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the software testing method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the software testing apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a transmitting unit, an obtaining unit, a determining unit, and a first processing unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the sending unit may also be described as a "unit sending a picture acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
acquiring an XML source code file of a current page;
if the XML source code file of the current page comprises all the special controls of the APP home page, determining that the current page is the APP home page;
and if the XML source code file of the current page does not comprise all the special controls of the APP home page, determining that the current page is a non-home page, and operating the current page based on the return times of the current page.
According to the technical scheme of the embodiment of the invention, the XML source code file of the current page is obtained; if the XML source code file of the current page comprises all the special controls of the APP home page, determining that the current page is the APP home page; and if the XML source code file of the current page does not comprise all the special controls of the APP home page, determining that the current page is a non-home page, and operating the current page based on the return times of the current page. Whether the current page is the APP home page or not is judged according to whether the XML source code file of the current page comprises all the special controls of the APP home page or not, and then the testing efficiency can be improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A software testing method, comprising:
acquiring an XML source code file of a current page;
if the XML source code file of the current page comprises all the special controls of the APP home page, determining that the current page is the APP home page;
and if the XML source code file of the current page does not comprise all the special controls of the APP home page, determining that the current page is a non-home page, and operating the current page based on the return times of the current page.
2. The software testing method of claim 1, wherein said operating the current page based on the number of times the current page is returned comprises:
if the return times of the current page are more than or equal to the maximum times, restarting the APP to return to the APP home page;
and if the return times of the current page are less than the maximum times, returning to the previous level of interface operation, and acquiring the XML source code file of the current page again.
3. The software testing method of claim 1, wherein the obtaining the XML source code file of the current page comprises:
the current page is a native page, and an XML source code file of the current page is generated based on the service provided by an operating system;
the current page is an H5 page, and an XML source code file of the current page is obtained by adopting a browser.
4. The software testing method of claim 1, wherein the obtaining the XML source code file of the current page comprises:
the current page is a mixed page, and an XML source code file of the current page is generated based on the service provided by an operating system;
and acquiring the XML source code file of the current page by adopting a browser after the XML source code file of the current page does not comprise all special controls of the APP home page.
5. The software testing method according to claim 3 or 4, wherein before obtaining the XML source code file of the current page, the method further comprises:
and determining the type of the current page based on a control with the type being webkit.
6. A software testing apparatus, comprising:
the acquisition module is used for acquiring an XML source code file of the current page;
the determining module is used for determining that the current page is the APP home page if the XML source code file of the current page comprises all the special controls of the APP home page;
and the operation module is used for determining that the current page is a non-home page if the XML source code file of the current page does not comprise all the special controls of the APP home page, and operating the current page based on the return times of the current page.
7. The software testing device of claim 1, wherein the operation module is specifically configured to restart the APP to return to the APP home page if the return time of the current page is greater than or equal to the maximum time;
and if the return times of the current page are less than the maximum times, returning to the previous level of interface operation, and acquiring the XML source code file of the current page again.
8. The software testing apparatus according to claim 1, wherein the obtaining module is specifically configured to generate, based on a service provided by an operating system, an XML source code file of the current page, where the current page is a native page;
the current page is an H5 page, and an XML source code file of the current page is obtained by adopting a browser.
9. A software testing electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910984934.6A CN110825622A (en) | 2019-10-16 | 2019-10-16 | Software testing method, device, equipment and computer readable medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910984934.6A CN110825622A (en) | 2019-10-16 | 2019-10-16 | Software testing method, device, equipment and computer readable medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN110825622A true CN110825622A (en) | 2020-02-21 |
Family
ID=69549383
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910984934.6A Pending CN110825622A (en) | 2019-10-16 | 2019-10-16 | Software testing method, device, equipment and computer readable medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110825622A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111625451A (en) * | 2020-05-19 | 2020-09-04 | 北京百度网讯科技有限公司 | Initialization method, device, equipment and medium for automatic test environment |
| CN112817864A (en) * | 2021-02-23 | 2021-05-18 | 北京字节跳动网络技术有限公司 | Test file generation method, device, equipment and medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105320542A (en) * | 2015-11-04 | 2016-02-10 | 上海聚力传媒技术有限公司 | Method and apparatus for enabling mobile terminal to exit abnormal interface |
| CN106649103A (en) * | 2016-11-25 | 2017-05-10 | 深圳大学 | Android application program automatically black box testing method and system |
| CN108572913A (en) * | 2018-02-26 | 2018-09-25 | 挖财网络技术有限公司 | Method, apparatus and the application of App homepages are positioned in Android client UI automation processes |
| CN109857636A (en) * | 2018-12-25 | 2019-06-07 | 杭州茂财网络技术有限公司 | A kind of methods and applications positioning App homepage in Android client UI automation process |
-
2019
- 2019-10-16 CN CN201910984934.6A patent/CN110825622A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105320542A (en) * | 2015-11-04 | 2016-02-10 | 上海聚力传媒技术有限公司 | Method and apparatus for enabling mobile terminal to exit abnormal interface |
| CN106649103A (en) * | 2016-11-25 | 2017-05-10 | 深圳大学 | Android application program automatically black box testing method and system |
| CN108572913A (en) * | 2018-02-26 | 2018-09-25 | 挖财网络技术有限公司 | Method, apparatus and the application of App homepages are positioned in Android client UI automation processes |
| CN109857636A (en) * | 2018-12-25 | 2019-06-07 | 杭州茂财网络技术有限公司 | A kind of methods and applications positioning App homepage in Android client UI automation process |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111625451A (en) * | 2020-05-19 | 2020-09-04 | 北京百度网讯科技有限公司 | Initialization method, device, equipment and medium for automatic test environment |
| CN112817864A (en) * | 2021-02-23 | 2021-05-18 | 北京字节跳动网络技术有限公司 | Test file generation method, device, equipment and medium |
| CN112817864B (en) * | 2021-02-23 | 2024-04-16 | 北京字节跳动网络技术有限公司 | Method, device, equipment and medium for generating test file |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10325009B2 (en) | Method and apparatus for using custom component parsing engine to parse tag of custom component | |
| CN110457038B (en) | Card display method, device and equipment of auxiliary application terminal and storage medium | |
| CN113760729A (en) | A code detection method and device | |
| CN112015384B (en) | Interface mapping method and device | |
| CN110888794B (en) | Interface testing method and device | |
| CN110895471A (en) | Installation package generation method, device, medium and electronic equipment | |
| CN113138757A (en) | Method, device, server, system and medium for automatically generating front-end code | |
| CN111026634A (en) | Interface automation test system, method, device and storage medium | |
| CN110806967B (en) | Unit testing method and unit testing device | |
| CN113448578A (en) | Page data processing method, processing system, electronic device and readable storage medium | |
| CN114237651A (en) | Installation method and device of cloud native application, electronic equipment and medium | |
| CN110221840B (en) | Function implementation method and device of application program, equipment and storage medium | |
| CN113806229B (en) | Test script multiplexing method, device, equipment, medium and product for interface change | |
| CN113127361B (en) | Application development method and device, electronic equipment and storage medium | |
| CN112491940A (en) | Request forwarding method and device of proxy server, storage medium and electronic equipment | |
| CN112214250A (en) | Method and device for loading application components | |
| CN113326079A (en) | Service version switching method, switching device, electronic equipment and storage medium | |
| CN110825622A (en) | Software testing method, device, equipment and computer readable medium | |
| CN115794637A (en) | Method, device, equipment and computer readable medium for automatic test | |
| CN112395194B (en) | Method and device for accessing test platform | |
| CN114676063A (en) | Micro-front-end-based page debugging method and device, storage medium, and electronic device | |
| CN112783903B (en) | Method and device for generating update log | |
| CN113360232A (en) | Task processing method and device, electronic equipment and storage medium | |
| CN113505036B (en) | Application monitoring method, client and server | |
| CN118394659A (en) | Multi-database scene automatic test method, device, equipment, medium and product |
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 | ||
| TA01 | Transfer of patent application right |
Effective date of registration: 20220921 Address after: 25 Financial Street, Xicheng District, Beijing 100033 Applicant after: CHINA CONSTRUCTION BANK Corp. Address before: 25 Financial Street, Xicheng District, Beijing 100033 Applicant before: CHINA CONSTRUCTION BANK Corp. Applicant before: Jianxin Financial Science and Technology Co.,Ltd. |
|
| TA01 | Transfer of patent application right | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200221 |
|
| RJ01 | Rejection of invention patent application after publication |