CN116257458B - Automatic testing method and system for mobile API (application program interface) in hybrid development mode - Google Patents

Automatic testing method and system for mobile API (application program interface) in hybrid development mode Download PDF

Info

Publication number
CN116257458B
CN116257458B CN202310545081.2A CN202310545081A CN116257458B CN 116257458 B CN116257458 B CN 116257458B CN 202310545081 A CN202310545081 A CN 202310545081A CN 116257458 B CN116257458 B CN 116257458B
Authority
CN
China
Prior art keywords
api
app
ium
test
application
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
CN202310545081.2A
Other languages
Chinese (zh)
Other versions
CN116257458A (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.)
State Grid Information and Telecommunication Co Ltd
Original Assignee
State Grid Information and Telecommunication 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 State Grid Information and Telecommunication Co Ltd filed Critical State Grid Information and Telecommunication Co Ltd
Priority to CN202310545081.2A priority Critical patent/CN116257458B/en
Publication of CN116257458A publication Critical patent/CN116257458A/en
Application granted granted Critical
Publication of CN116257458B publication Critical patent/CN116257458B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 invention relates to an automatic testing method and system of mobile API in a hybrid development mode, belonging to the technical field of mobile application interface testing, wherein the method comprises the following steps: s1, developing an API test application based on an H5 framework, and publishing the API test application to a mobile application platform; s2, building an app ium test project based on an app ium framework, integrating an automatic execution script, and generating an app ium client; and S3, connecting the app ium client with the app ium server through an automatic execution script, starting an API test application, and automatically testing the API interfaces of the mobile application platform one by one. According to the invention, the automatic test of the API interface of the mobile application is realized by combining the API test application and the app technology, the test script is automatically executed, the exchange operation is automatically executed, the test report is automatically generated, and the repeated operation of a tester is reduced.

Description

Automatic testing method and system for mobile API (application program interface) in hybrid development mode
Technical Field
The invention belongs to the technical field of mobile application interface testing, and particularly relates to an automatic testing method and system for a mobile API in a hybrid development mode.
Background
H5 refers to HTML5. Is a language description mode application for constructing Web content. The light application developed based on H5 has shorter starting time and faster networking speed than the local APP, does not need to occupy storage space in a downloading way, and is particularly suitable for mobile media such as mobile phones.
js is a script language, is not required to be compiled, is also part of a browser, is often used in a web client script language, and is mainly used for adding dynamic functions to html.
The enterprise-level mobile application platform usually adopts a mixed development mode of a native technology and an H5 technology, a set of complete native interfaces are provided for mobile H5 application by the mobile application platform and can be called in js mode, the native interfaces provide native capabilities of mobile phone systems such as voice, video, pictures, networks and Bluetooth for the H5 application, but the native capabilities are usually limited by factors such as systems, hardware and browsers of the mobile phone, so that a certain compatibility problem exists in an API (application program interface), and therefore, the mobile application platform often needs to carry out full-scale compatibility test on the interfaces before release.
The traditional test method has the advantages that interface function verification is carried out by manually writing interface calling functions through developers, parameters are input one by one or clicking interaction is carried out, the coverage rate of test cases is low, boundary and abnormal conditions are often judged by the same interface, test scenes are easy to lack, test efficiency is low, test results are not easy to store and are inconvenient to count, moreover, operations such as camera opening and the like requiring user interaction are faced, repeated manual operations are multiple, operation is complex, and great barriers are brought to quick release of a mobile application platform, so that the traditional test method cannot realize efficient release of the mobile application platform.
This is a deficiency of the prior art, and therefore, it is necessary to provide an automated testing method and system for mobile APIs in hybrid development mode, which addresses the above-mentioned deficiencies of the prior art.
Disclosure of Invention
Aiming at the defects that the test efficiency is low, the test result is not easy to store and is inconvenient to count, and the operations such as opening a camera and the like which need user interaction are more in manual repeated operation and complex in operation, and the quick release of a mobile application platform is greatly hindered and the efficient release of the mobile application platform cannot be realized in the prior art, the invention provides an automatic test method and an automatic test system for a mobile API in a hybrid development mode, and aims to solve the technical problems.
In a first aspect, the present invention provides an automated testing method for mobile APIs in a hybrid development mode, including the steps of:
s1, developing an API test application based on an H5 framework, and publishing the API test application to a mobile application platform;
s2, building an app ium test project based on an app ium framework, integrating an automatic execution script, and generating an app ium client;
and S3, connecting the app ium client with the app ium server through an automatic execution script, starting an API test application, and automatically testing the API interfaces of the mobile application platform one by one.
Further, the specific steps of step S1 are as follows:
s11, acquiring operation scenes of a js API (application program interface) called by a mobile application platform, and simulating all the operation scenes of the API based on an H5 framework to generate an API test application;
s12, releasing the API test application of the H5 framework to a mobile application platform of the mobile portal.
Further, the specific steps of step S2 are as follows:
s21, building an app ium test project based on an app ium framework;
s22, integrating an automatic execution script in an app ium test project, wherein the automatic execution script comprises a configuration script, a sliding script, an image script, an abnormal script and an opening process;
s23, starting an app ium test project, reading configuration information according to version information of the mobile application platform through a configuration script, creating an app imu client according to the configuration information, and establishing connection between the app ium client and an automatic execution script.
Further, the specific steps of step S3 are as follows:
s31, the app ium client connects with the app ium server through an automatic execution script to issue instructions to the mobile terminal;
s32, the app ium client starts a mobile portal through the app ium server, inputs the obtained user name account and password, and completes automatic login of the mobile application platform;
s33, the app ium client starts an API test application in the mobile application platform through the app ium server, and automatically fills interface global environment parameter information;
s34, the app ium client issues an instruction to the mobile terminal through the app ium server to execute the API test application, and automatically tests the API interfaces of the mobile application platform one by one;
s35, the API test application judges whether an API interface test of the mobile application platform is abnormal, detects the running state of the mobile portal when the abnormality exists, and records abnormal state data when the mobile portal crashes and the number of times of crashes exceeds the limit;
s36, the API test application reads the execution result, records the state data and generates a test report.
Further, the specific steps of step S34 are as follows:
s341, positioning an API interface by an API test application;
s342, the API test application judges whether the positioning API interface needs to input parameter information according to the configuration information;
if yes, go to step S343;
if not, go to step S344;
s343, the API test application uses the instruction to locate a parameter input box of the mobile application and input parameters;
s344, the API testing application uses an instruction to locate an execution button of the API interface to start a test;
s345, the API test application judges whether the positioning of the API interface is finished;
if yes, go to step S35;
if not, the next API interface is located, and the process returns to step S342.
Further, the specific steps of step S343 are as follows:
s3431. The API test application uses the instruction to locate a parameter input box of the mobile application;
s3432. The API test application judges whether the parameter input box is positioned successfully or not;
if yes, go to step S3433;
if not, the API test application uses the instruction sliding page to return to the step S3431;
and S343, testing application input parameters by the API.
Further, the specific steps of step S344 are as follows:
s3441.API test application uses instructions to locate an execution button of the API interface;
s3442. The API test application judges whether the positioning of the API interface execution button is successful or not;
if yes, go to step S3443;
if not, the API test application uses the instruction sliding page to return to the step S3441;
s3443. the API test application clicks the API interface execution button.
Further, the specific steps of step S35 are as follows:
s351, the API testing application judges whether an API interface test of the mobile application platform is abnormal or not;
if yes, go to step S352;
if not, go to step S36;
s352. The API test application detects the running state of the mobile portal and judges whether breakdown occurs or not;
if yes, go to step S353;
if not, returning to the step S32;
s353, the API test application judges whether the number of crashes exceeds the limit;
if yes, recording abnormal state data, and proceeding to step S36;
if not, return to step S32.
Further, the specific steps of step S36 are as follows:
s361, simulating interactive operation on the API interface to be interacted by the API test application, and reading an execution result of the API interface through an instruction;
s362, the API test application classifies the record of the execution result to finish the state data record;
and S363. After all API interface calling tests are completed, the API test application generates a test report and outputs success interface information, failure interface information and environment information.
In a second aspect, the present invention provides an automated testing system for mobile APIs in a hybrid development mode, comprising:
the API test application issuing module is used for developing an API test application based on the H5 framework and issuing the API test application to the mobile application platform;
the system comprises an app ium testing tool and a client generating module, wherein the app ium testing tool and the client generating module are used for building an app ium testing project based on an app ium framework, integrating an automatic execution script and generating an app ium client;
and the API interface automatic test module is used for connecting the app ium client with the app ium server through an automatic execution script, starting an API test application and automatically testing the API interfaces of the mobile application platform one by one.
Further, the API test application publishing module includes:
the API test application generating unit is used for acquiring the js API interface operation scenes called by the mobile application platform and simulating all the API interface operation scenes based on the H5 framework to generate an API test application;
and the test application release unit is used for releasing the API test application of the H5 framework to the mobile application platform of the mobile portal.
Further, the app test tool and the client generation module include:
an app ium test project building unit for building an app ium test project based on an app ium framework;
the script integration unit is used for integrating an automatic execution script in the app ium test engineering and comprises a configuration script, a sliding script, an image script, an abnormal script and an opening process;
the system comprises an app ium client creation unit, an app ium test engineering and an automation execution script, wherein the app ium client creation unit is used for starting the app ium test engineering, reading configuration information according to version information of a mobile application platform through a configuration script, creating an app ium client according to the configuration information, and establishing connection between the app ium client and the automation execution script.
Further, the API interface automatic test module includes:
the instruction issuing unit is used for connecting the app ium server side to the mobile terminal through an automatic execution script at the app ium client side to issue instructions;
the mobile application platform login unit is used for starting a mobile portal at the app ium client through the app ium server, inputting the obtained user name account number and password, and completing automatic login of the mobile application platform;
the test application starting unit is used for starting an API test application in the mobile application platform through the app ium server side at the app ium client side and automatically filling interface global environment parameter information;
the test application execution unit is used for issuing an instruction to execute the API test application to the mobile terminal through the app ium server at the app ium client, and automatically testing the API interfaces of the mobile application platform one by one;
the test abnormality judging unit is used for judging whether an API interface test of the mobile application platform is abnormal or not through the API test application, detecting the running state of the mobile portal when the abnormality exists, and recording abnormal state data when the mobile portal is crashed and the number of times of crashing is over-limited;
and the execution result reading and test report generating unit is used for reading the execution result through the API test application, recording the state data and generating a test report.
The invention has the beneficial effects that:
the automatic testing method and system for the mobile API in the hybrid development mode provided by the invention realize the active starting of the mobile portal, the logging of the mobile portal system and the automatic filling of the testing parameters, simulate the user interaction, treat the system abnormality and generate detailed testing report contents. The invention reduces repeated operation of testers, automatically completes flow control of interfaces in interaction of interfaces and automation, can automatically generate report content, and has simple deployment. According to the method and the device, through the API test application, the writing of an app ium automatic test script is simplified, and the app ium is mainly responsible for starting the API test application and executing the test cases written on the application; according to the invention, the API test application is adopted, the actual scene of the API call is simulated, and the test case can be flexibly expanded along with the updating of the mobile application platform API.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
It can be seen that the present invention has outstanding substantial features and significant advances over the prior art, as well as the benefits of its implementation.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flow chart of an embodiment 1 of an automated testing method for mobile APIs in a hybrid development mode of the present invention.
FIG. 2 is a flow chart of an embodiment 2 of an automated testing method for mobile APIs in a hybrid development mode of the present invention.
FIG. 3 is a schematic diagram of an automated test flow for starting an API test application, one by one, of an API interface of a mobile application platform in accordance with the present invention.
FIG. 4 is a schematic diagram of an automated test system for mobile APIs in a hybrid development mode of the present invention.
Detailed Description
In order to make the technical solution of the present invention better understood by those skilled in the art, the technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
The app is one of the mainstream automated test tools on current mobile platforms.
Example 1:
as shown in fig. 1, the present invention provides an automated testing method for mobile APIs in a hybrid development mode, comprising the following steps:
s1, developing an API test application based on an H5 framework, and publishing the API test application to a mobile application platform;
s2, building an app ium test project based on an app ium framework, integrating an automatic execution script, and generating an app ium client;
and S3, connecting the app ium client with the app ium server through an automatic execution script, starting an API test application, and automatically testing the API interfaces of the mobile application platform one by one. The app is one of the mainstream automated test tools on current mobile platforms.
Example 2:
as shown in fig. 2, the present invention provides an automated testing method for mobile APIs in a hybrid development mode, comprising the following steps:
s1, developing an API test application based on an H5 framework, and publishing the API test application to a mobile application platform; the specific steps of the step S1 are as follows:
s11, acquiring operation scenes of a js API (application program interface) called by a mobile application platform, and simulating all the operation scenes of the API based on an H5 framework to generate an API test application;
s12, releasing the API test application of the H5 framework to a mobile application platform of a mobile portal;
s2, building an app ium test project based on an app ium framework, integrating an automatic execution script, and generating an app ium client; the specific steps of the step S2 are as follows:
s21, building an app ium test project based on an app ium framework;
s22, integrating an automatic execution script in an app ium test project, wherein the automatic execution script comprises a configuration script, a sliding script, an image script, an abnormal script and an opening process;
s23, starting an app ium test project, reading configuration information according to version information of the mobile application platform through a configuration script, creating an app imu client according to the configuration information, and establishing connection between the app ium client and an automatic execution script; the configuration information comprises attribute information required for creating an app ium client, account information for logging in a mobile application platform, interface environment of a test API used as an h5 application, related configuration information of the mobile application platform, and the like; the app ium client is used for connecting with the app ium server and sending operation commands to the app ium server, and all subsequent operation commands are sent to the app ium server by the client;
s3, connecting the app ium client with the app ium server through an automatic execution script, starting an API test application, and automatically testing the API interfaces of the mobile application platform one by one; the specific steps of the step S3 are as follows:
s31, the app ium client connects with the app ium server through an automatic execution script to issue instructions to the mobile terminal;
s32, the app ium client starts a mobile portal through the app ium server, inputs the obtained user name account and password, and completes automatic login of the mobile application platform;
s33, the app ium client starts an API test application in the mobile application platform through the app ium server, and automatically fills interface global environment parameter information; automatically filling interface global environment parameter information, and preparing for subsequent interface call;
s34, the app ium client issues an instruction to the mobile terminal through the app ium server to execute the API test application, and automatically tests the API interfaces of the mobile application platform one by one; as shown in fig. 3, the specific steps of step S34 are as follows:
s341, positioning an API interface by an API test application;
s342, the API tests the application and judges whether the positioning API interface needs to input parameter information according to the configuration information;
if yes, go to step S343;
if not, go to step S344;
s343, the API test application uses the instruction to locate a parameter input box of the mobile application and input parameters;
s344, the API testing application uses an instruction to locate an execution button of the API interface to start a test;
s345, the API test application judges whether the positioning of the API interface is finished;
if yes, go to step S35;
if not, positioning the next API interface, and returning to the step S342;
s35, the API test application judges whether an API interface test of the mobile application platform is abnormal, detects the running state of the mobile portal when the abnormality exists, and records abnormal state data when the mobile portal crashes and the number of times of crashes exceeds the limit; serious errors of the interface can cause the collapse of the mobile portal application, so that the abnormality needs to be detected; the specific steps of step S35 are as follows:
s351, the API testing application judges whether an API interface test of the mobile application platform is abnormal or not;
if yes, go to step S352;
if not, go to step S36;
s352. The API test application detects the running state of the mobile portal and judges whether breakdown occurs or not;
if yes, go to step S353;
if not, returning to the step S32;
s353, the API test application judges whether the number of crashes exceeds the limit;
if yes, recording abnormal state data, and proceeding to step S36;
if not, returning to the step S32;
s36, the API test application reads the execution result, records the state data and generates a test report; the specific steps of step S36 are as follows:
s361, simulating interactive operation on the API interface to be interacted by the API test application, and reading an execution result of the API interface through an instruction; for part of interfaces to be interacted, simulating the interactions, such as album selection, address book selection and the like, through instructions, and reading the interactive execution results of the interfaces through the instructions;
s362, the API test application classifies the record of the execution result to finish the state data record;
and S363. After all API interface calling tests are completed, the API test application generates a test report in an excel format and outputs success interface information, failure interface information and environment information.
In some embodiments, step S343 is specifically performed as follows:
s3431. The API test application uses the instruction to locate a parameter input box of the mobile application;
s3432. The API test application judges whether the parameter input box is positioned successfully or not;
if yes, go to step S3433;
if not, the API test application uses the instruction sliding page to return to the step S3431;
s343, API test application input parameters;
the specific steps of step S344 are as follows:
s3441.API test application uses instructions to locate an execution button of the API interface;
s3442. The API test application judges whether the positioning of the API interface execution button is successful or not;
if yes, go to step S3443;
if not, the API test application uses the instruction sliding page to return to the step S3441;
s3443. the API test application clicks the API interface execution button.
The invention is divided into three parts of an app ium test project, an app ium server and a mobile terminal, wherein the app ium test project generates a test script and a report according to the app ium specification; the app ium server is responsible for receiving the test script and issuing the test script to a mobile phone serving as a mobile terminal for execution; the mobile terminal is responsible for executing an app ium automation test script, automatically executing test cases on an independent API test application which is used as an H5 application and runs on a mobile application platform through the script, wherein the API test application is responsible for manually verifying input parameters of interfaces one by one, and semi-automatization of interface test is realized by using Promise, proxy and other technology improvements. The invention can automatically input corresponding parameters and start interface verification through the automatic testing technology of the app ium, and finally generates a detailed test report according to factors such as hardware, an operating system and the like of a mobile phone serving as a mobile terminal.
According to the invention, the interface is automatically tested through the script instruction, the centralized API test application is combined, the user interaction operation is automatically simulated, the operation result and the exception handling are automatically read, and the full-automatic test without the participation of personnel is realized.
Example 3:
as shown in fig. 4, the present invention provides an automated testing system for mobile APIs in hybrid development mode, comprising:
the API test application issuing module is used for developing an API test application based on the H5 framework and issuing the API test application to the mobile application platform; the API test application publishing module comprises:
the API test application generating unit is used for acquiring the js API interface operation scenes called by the mobile application platform and simulating all the API interface operation scenes based on the H5 framework to generate an API test application;
the test application issuing unit is used for issuing the API test application of the H5 framework to the mobile application platform of the mobile portal;
the system comprises an app ium testing tool and a client generating module, wherein the app ium testing tool and the client generating module are used for building an app ium testing project based on an app ium framework, integrating an automatic execution script and generating an app ium client; the app ium test tool and the client generation module include:
an app ium test project building unit for building an app ium test project based on an app ium framework;
the script integration unit is used for integrating an automatic execution script in the app ium test engineering and comprises a configuration script, a sliding script, an image script, an abnormal script and an opening process;
the system comprises an app ium client creation unit, an app ium test engineering unit and an automatic execution script unit, wherein the app ium client creation unit is used for starting the app ium test engineering, reading configuration information according to version information of a mobile application platform through a configuration script, creating an app ium client according to the configuration information, and establishing connection between the app ium client and the automatic execution script;
the API interface automatic test module is used for connecting the app ium client with the app ium server through an automatic execution script, starting an API test application and automatically testing the API interfaces of the mobile application platform one by one; the API interface automatic test module comprises:
the instruction issuing unit is used for connecting the app ium server side to the mobile terminal through an automatic execution script at the app ium client side to issue instructions;
the mobile application platform login unit is used for starting a mobile portal at the app ium client through the app ium server, inputting the obtained user name account number and password, and completing automatic login of the mobile application platform;
the test application starting unit is used for starting an API test application in the mobile application platform through the app ium server side at the app ium client side and automatically filling interface global environment parameter information;
the test application execution unit is used for issuing an instruction to execute the API test application to the mobile terminal through the app ium server at the app ium client, and automatically testing the API interfaces of the mobile application platform one by one;
the test abnormality judging unit is used for judging whether an API interface test of the mobile application platform is abnormal or not through the API test application, detecting the running state of the mobile portal when the abnormality exists, and recording abnormal state data when the mobile portal is crashed and the number of times of crashing is over-limited;
and the execution result reading and test report generating unit is used for reading the execution result through the API test application, recording the state data and generating a test report.
Although the present invention has been described in detail by way of preferred embodiments with reference to the accompanying drawings, the present invention is not limited thereto. Various equivalent modifications and substitutions may be made in the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and it is intended that all such modifications and substitutions be within the scope of the present invention/be within the scope of the present invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (5)

1. An automated testing method for mobile APIs in a hybrid development mode is characterized by comprising the following steps:
s1, developing an API test application based on an H5 framework, and publishing the API test application to a mobile application platform;
s2, building an app ium test project based on an app ium framework, integrating an automatic execution script, and generating an app ium client; the specific steps of the step S2 are as follows:
s21, building an app ium test project based on an app ium framework;
s22, integrating an automatic execution script in an app ium test project, wherein the automatic execution script comprises a configuration script, a sliding script, an image script, an abnormal script and an opening process;
s23, starting an app ium test project, reading configuration information according to version information of the mobile application platform through a configuration script, creating an app imu client according to the configuration information, and establishing connection between the app ium client and an automatic execution script;
s3, connecting the app ium client with the app ium server through an automatic execution script, starting an API test application, and automatically testing the API interfaces of the mobile application platform one by one; the specific steps of the step S3 are as follows:
s31, the app ium client connects with the app ium server through an automatic execution script to issue instructions to the mobile terminal;
s32, the app ium client starts a mobile portal through the app ium server, inputs the obtained user name account and password, and completes automatic login of the mobile application platform;
s33, the app ium client starts an API test application in the mobile application platform through the app ium server, and automatically fills interface global environment parameter information;
s34, the app ium client issues an instruction to the mobile terminal through the app ium server to execute the API test application, and automatically tests the API interfaces of the mobile application platform one by one; the specific steps of step S34 are as follows:
s341, positioning an API interface by an API test application;
s342, the API test application judges whether the positioning API interface needs to input parameter information according to the configuration information;
if yes, go to step S343;
if not, go to step S344;
s343, the API test application uses the instruction to locate a parameter input box of the mobile application and input parameters;
s344, the API testing application uses an instruction to locate an execution button of the API interface to start a test;
s345, the API test application judges whether the positioning of the API interface is finished;
if yes, go to step S35;
if not, positioning the next API interface, and returning to the step S342;
s35, the API test application judges whether an API interface test of the mobile application platform is abnormal, detects the running state of the mobile portal when the abnormality exists, and records abnormal state data when the mobile portal crashes and the number of times of crashes exceeds the limit; the specific steps of step S35 are as follows:
s351, the API testing application judges whether an API interface test of the mobile application platform is abnormal or not;
if yes, go to step S352;
if not, go to step S36;
s352. The API test application detects the running state of the mobile portal and judges whether breakdown occurs or not;
if yes, go to step S353;
if not, returning to the step S32;
s353, the API test application judges whether the number of crashes exceeds the limit;
if yes, recording abnormal state data, and proceeding to step S36;
if not, returning to the step S32;
s36, the API test application reads an execution result, records state data and generates a test report; the specific steps of step S36 are as follows:
s361, simulating interactive operation on the API interface to be interacted by the API test application, and reading an execution result of the API interface through an instruction;
s362, the API test application classifies the record of the execution result to finish the state data record;
and S363. After all API interface calling tests are completed, the API test application generates a test report and outputs success interface information, failure interface information and environment information.
2. The automated testing method of mobile APIs in hybrid development mode of claim 1, wherein step S1 comprises the specific steps of:
s11, acquiring operation scenes of a js API (application program interface) called by a mobile application platform, and simulating all the operation scenes of the API based on an H5 framework to generate an API test application;
s12, releasing the API test application of the H5 framework to a mobile application platform of the mobile portal.
3. The automated testing method of mobile APIs in hybrid development mode of claim 1, wherein step S343 comprises the specific steps of:
s3431. The API test application uses the instruction to locate a parameter input box of the mobile application;
s3432. The API test application judges whether the parameter input box is positioned successfully or not;
if yes, go to step S3433;
if not, the API test application uses the instruction sliding page to return to the step S3431;
and S343, testing application input parameters by the API.
4. The automated testing method of mobile APIs in hybrid development mode of claim 1, wherein step S344 comprises the specific steps of:
s3441.API test application uses instructions to locate an execution button of the API interface;
s3442. The API test application judges whether the positioning of the API interface execution button is successful or not;
if yes, go to step S3443;
if not, the API test application uses the instruction sliding page to return to the step S3441;
s3443. the API test application clicks the API interface execution button.
5. An automated testing system for mobile APIs in a hybrid development mode, comprising:
the API test application issuing module is used for developing an API test application based on the H5 framework and issuing the API test application to the mobile application platform;
the system comprises an app ium testing tool and a client generating module, wherein the app ium testing tool and the client generating module are used for building an app ium testing project based on an app ium framework, integrating an automatic execution script and generating an app ium client; the execution process of the app ium test tool and the client generation module is specifically as follows:
s21, building an app ium test project based on an app ium framework;
s22, integrating an automatic execution script in an app ium test project, wherein the automatic execution script comprises a configuration script, a sliding script, an image script, an abnormal script and an opening process;
s23, starting an app ium test project, reading configuration information according to version information of the mobile application platform through a configuration script, creating an app imu client according to the configuration information, and establishing connection between the app ium client and an automatic execution script;
the API interface automatic test module is used for connecting the app ium client with the app ium server through an automatic execution script, starting an API test application and automatically testing the API interfaces of the mobile application platform one by one; the specific execution process of the API interface automatic test module is as follows:
s31, the app ium client connects with the app ium server through an automatic execution script to issue instructions to the mobile terminal;
s32, the app ium client starts a mobile portal through the app ium server, inputs the obtained user name account and password, and completes automatic login of the mobile application platform;
s33, the app ium client starts an API test application in the mobile application platform through the app ium server, and automatically fills interface global environment parameter information;
s34, the app ium client issues an instruction to the mobile terminal through the app ium server to execute the API test application, and automatically tests the API interfaces of the mobile application platform one by one; the specific steps of step S34 are as follows:
s341, positioning an API interface by an API test application;
s342, the API test application judges whether the positioning API interface needs to input parameter information according to the configuration information;
if yes, go to step S343;
if not, go to step S344;
s343, the API test application uses the instruction to locate a parameter input box of the mobile application and input parameters;
s344, the API testing application uses an instruction to locate an execution button of the API interface to start a test;
s345, the API test application judges whether the positioning of the API interface is finished;
if yes, go to step S35;
if not, positioning the next API interface, and returning to the step S342;
s35, the API test application judges whether an API interface test of the mobile application platform is abnormal, detects the running state of the mobile portal when the abnormality exists, and records abnormal state data when the mobile portal crashes and the number of times of crashes exceeds the limit; the specific steps of step S35 are as follows:
s351, the API testing application judges whether an API interface test of the mobile application platform is abnormal or not;
if yes, go to step S352;
if not, go to step S36;
s352. The API test application detects the running state of the mobile portal and judges whether breakdown occurs or not;
if yes, go to step S353;
if not, returning to the step S32;
s353, the API test application judges whether the number of crashes exceeds the limit;
if yes, recording abnormal state data, and proceeding to step S36;
if not, returning to the step S32;
s36, the API test application reads an execution result, records state data and generates a test report; the specific steps of step S36 are as follows:
s361, simulating interactive operation on the API interface to be interacted by the API test application, and reading an execution result of the API interface through an instruction;
s362, the API test application classifies the record of the execution result to finish the state data record;
and S363. After all API interface calling tests are completed, the API test application generates a test report and outputs success interface information, failure interface information and environment information.
CN202310545081.2A 2023-05-16 2023-05-16 Automatic testing method and system for mobile API (application program interface) in hybrid development mode Active CN116257458B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310545081.2A CN116257458B (en) 2023-05-16 2023-05-16 Automatic testing method and system for mobile API (application program interface) in hybrid development mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310545081.2A CN116257458B (en) 2023-05-16 2023-05-16 Automatic testing method and system for mobile API (application program interface) in hybrid development mode

Publications (2)

Publication Number Publication Date
CN116257458A CN116257458A (en) 2023-06-13
CN116257458B true CN116257458B (en) 2023-10-17

Family

ID=86682912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310545081.2A Active CN116257458B (en) 2023-05-16 2023-05-16 Automatic testing method and system for mobile API (application program interface) in hybrid development mode

Country Status (1)

Country Link
CN (1) CN116257458B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108089844A (en) * 2016-11-14 2018-05-29 深圳联友科技有限公司 A kind of high in the clouds is packaged APP method and devices
CN109857374A (en) * 2018-12-24 2019-06-07 航天信息软件技术有限公司 The development approach and device of mobile application
CN111176971A (en) * 2018-11-11 2020-05-19 无锡雅座在线科技股份有限公司 Code quality testing system and method based on UI automation
CN114661623A (en) * 2022-05-26 2022-06-24 中建电子商务有限责任公司 UI automatic testing method for testing real Native application

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7543275B2 (en) * 2004-01-29 2009-06-02 Sun Microsystems, Inc. Mechanism for executing test suites written for different harnesses under one test execution harness
US10467127B2 (en) * 2018-03-23 2019-11-05 Lendingclub Corporation Unified UI/UX and API testing of web applications

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108089844A (en) * 2016-11-14 2018-05-29 深圳联友科技有限公司 A kind of high in the clouds is packaged APP method and devices
CN111176971A (en) * 2018-11-11 2020-05-19 无锡雅座在线科技股份有限公司 Code quality testing system and method based on UI automation
CN109857374A (en) * 2018-12-24 2019-06-07 航天信息软件技术有限公司 The development approach and device of mobile application
CN114661623A (en) * 2022-05-26 2022-06-24 中建电子商务有限责任公司 UI automatic testing method for testing real Native application

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Android应用并行自动化测试技术研究与实现;陈学亮;武娟;庞涛;钱锋;刘晓军;;广东通信技术(第11期);2-5 *

Also Published As

Publication number Publication date
CN116257458A (en) 2023-06-13

Similar Documents

Publication Publication Date Title
CN111159049B (en) Automatic interface testing method and system
WO2020155777A1 (en) Ui automated function testing method, testing device, testing apparatus, and storage medium
CN106844204B (en) Method and system for generating defect report by using mobile terminal
CN109542463A (en) Compiling file packet transmission method, device, computer equipment and storage medium
CN102855142A (en) Client architecture based on RIA (rich internet applications) and implementation method thereof
CN102866944A (en) Pressure testing system and method
CN114003451B (en) Interface testing method, device, system and medium
CN113505082B (en) Application program testing method and device
KR20080052341A (en) Automatic-testing system and method for embedded system software and test scenario composing method
WO2007061241A1 (en) Error test method for mobile communication terminals
CN112882930B (en) Automatic test method and device, storage medium and electronic equipment
CN115658529A (en) Automatic testing method for user page and related equipment
CN112732576A (en) Automatic testing method, device and equipment based on user interface
CN111506311A (en) Internet rapid iterative development, integration and release method and middlebox enabling engine
CN110532182A (en) A kind of automated testing method and device of virtual platform
CN116257458B (en) Automatic testing method and system for mobile API (application program interface) in hybrid development mode
CN113064816A (en) Testing device and testing method for programmable logic device software
CN117130941A (en) Interface automation method, system, equipment and medium based on browser plug-in
CN115470152B (en) Test code generation method, test code generation device, and storage medium
KR100585577B1 (en) Test method for mobile communication terminals based on auto-making of test scenario file
CN116860322A (en) Front-end data source processing method, device, equipment and storage medium
RU2729210C1 (en) Electronic devices software testing system
CN105446867A (en) Method and apparatus for generating test data
CN114356763A (en) H5 page local debugging method suitable for hybrid App
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium

Legal Events

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