CN109344052B - Interface automation test method and device and electronic equipment - Google Patents

Interface automation test method and device and electronic equipment Download PDF

Info

Publication number
CN109344052B
CN109344052B CN201811009140.XA CN201811009140A CN109344052B CN 109344052 B CN109344052 B CN 109344052B CN 201811009140 A CN201811009140 A CN 201811009140A CN 109344052 B CN109344052 B CN 109344052B
Authority
CN
China
Prior art keywords
interface
user
identification information
user authority
request
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
CN201811009140.XA
Other languages
Chinese (zh)
Other versions
CN109344052A (en
Inventor
赵倩倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201811009140.XA priority Critical patent/CN109344052B/en
Publication of CN109344052A publication Critical patent/CN109344052A/en
Application granted granted Critical
Publication of CN109344052B publication Critical patent/CN109344052B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication

Landscapes

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

Abstract

The embodiment of the invention discloses an interface automatic testing method, an interface automatic testing device and electronic equipment, relates to the technical field of computer networks, and can solve the problems of complex work and low efficiency of the existing interface testing. The automatic interface testing method is used for a testing end and comprises the following steps: sending an authority verification interface request to a server; receiving permission verification response information returned by the server side; extracting user authority identification information from the authority verification response information; and sending an interface request comprising the user authority identification information to any interface of a server. The embodiment of the invention is suitable for testing various interfaces.

Description

Interface automation test method and device and electronic equipment
Technical Field
The invention relates to the technical field of computer networks, in particular to an interface automatic testing method and device and electronic equipment.
Background
In network connection, when a client exchanges data with a server, there is usually an authority authentication (login) process, the server stores authentication information in session, and the client records user authentication information usually by using cookie or token. Generally, data is transmitted by using a stateless HTTP protocol when the network is connected, which means that the client and the server are disconnected after the data transmission is completed. Now we need a mechanism to keep the session connected all the time. The cookie fully takes this role before session occurs. A cookie is a small text file stored by the Web server on the user's browser (client) that records identity information about the user, such as a unique identification.
Interface testing is a test of the interface between components of a test system. The interface test is mainly used for detecting interaction points between external systems and between internal subsystems. The existing interface testing technology generally requires that a server carries a unique identifier of a client in a response when authority verification (login) is carried out on the server, and all subsequent interfaces carry the unique identifier of the client to carry out testing. The existing interface testing method mainly depends on a browser, and after manual login through the browser is completed, the same browser is used for accessing other interfaces to perform data testing by using a working mechanism of the browser. However, data exchange of browser page class generally uses cookie, and when a project has a large number of data interfaces, each time the project is updated iteratively, the interfaces need to be tested to determine whether the interfaces are affected by new code. The large number of repeated interface tests makes the interface test work complicated and inefficient.
Disclosure of Invention
In view of this, embodiments of the present invention provide an interface automated testing method and apparatus, and an electronic device, so that a testing process is simpler and testing efficiency is higher.
In a first aspect, an embodiment of the present invention provides an interface automation test method, used for a test end, including:
sending an authority verification interface request to a server;
receiving permission verification response information returned by the server side;
extracting user authority identification information from the authority verification response information;
and sending an interface request comprising the user authority identification information to any interface of a server.
With reference to the first aspect, in a first implementation manner of the first aspect, before sending the permission check interface request to the server, the method further includes:
acquiring the authority level of a user to be tested;
judging whether a corresponding relation set of a preset user permission level and user permission identification information can be matched with the user permission level to be tested or not;
if the corresponding relation set of the user permission levels and the user permission identification information can be matched with the user permission levels to be tested, acquiring the user permission identification information corresponding to the user permission levels to be tested from the corresponding relation set of the user permission levels and the user permission identification information;
and if the corresponding relation set of the user permission level and the user permission identification information cannot be matched with the user permission level to be tested, executing the step of sending a permission verification interface request to the server side.
With reference to the first implementation manner of the first aspect, in a second implementation manner of the first aspect, after extracting the user right identification information from the right check response information, the method further includes:
and correspondingly storing the obtained user authority level to be tested and the user authority identification information into a corresponding relation set of the user authority level and the user authority identification information.
With reference to the first or second implementation manner of the first aspect, in a third implementation manner of the first aspect, the sending an authorization check interface request to a server includes:
and the simulated browser sends an authority verification interface request in the form of HTTP to the server.
With reference to the first aspect, in a fourth implementation manner of the first aspect, the user right identification information is cookie information;
wherein the extracting the user authority identification information from the authority verification response information includes:
extracting cookie information from a response header of the permission verification response information;
the sending of the interface request including the user authority identification information to any interface of the server includes:
the cookie information extracted this time is placed in a request header of an interface request;
and sending the interface request to any interface of the server.
In a second aspect, an embodiment of the present invention provides an interface automation test apparatus, configured to a test end, including:
the first request module is used for sending a permission verification interface request to the server;
the receiving module is used for receiving the authority verification response information returned by the server side;
the extraction module is used for extracting user authority identification information from the authority verification response information;
and the second request module is used for sending an interface request comprising the user authority identification information to any interface of the server.
With reference to the second aspect, in a first implementation manner of the second aspect, the interface automation test apparatus further includes:
the first acquisition module is used for acquiring the authority level of a user to be tested;
the judging module is used for judging whether a preset corresponding relation set of the user permission level and the user permission identification information can be matched with the user permission level to be tested or not;
the second obtaining module is used for obtaining the user authority identification information corresponding to the user authority level to be tested from the corresponding relation between the user authority level and the user authority identification information in a centralized manner when the judgment result of the judging module is yes;
the first request module is specifically configured to send an authority check interface request to the server if the determination result of the determination module is negative.
With reference to the first implementation manner of the second aspect, in a second implementation manner of the second aspect, the interface automation test apparatus further includes:
and the storage module is used for correspondingly storing the user permission level to be tested acquired by the first acquisition module and the user permission identification information acquired by the extraction module into a corresponding relation set of the user permission level and the user permission identification information.
With reference to the first or second implementation manner of the second aspect, in a third implementation manner of the second aspect, the first request module is specifically configured to simulate a browser to send an HTTP-form permission check interface request to the server.
With reference to the second aspect, in a fourth implementation manner of the second aspect, the user right identification information is cookie information;
the extraction module is specifically configured to extract cookie information from a response header of the permission verification response information;
the request module comprises:
setting submodule for setting the cookie information extracted this time in the request head of the interface request;
and the sending submodule is used for sending the interface request obtained by the setting submodule to any interface of the server.
In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the client; the memory is used for storing executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, and is used for executing the interface automatic test method according to any one of the foregoing embodiments.
According to the interface automatic testing method, the device and the electronic equipment provided by the embodiment of the invention, the user permission identification information is put in the interface request, and the interface request for carrying out the interface test can be directly sent to any interface of the server, so that the user permission identification information can be transmitted by using a code simulation browser principle to carry out permission verification, the interface test can be realized without the help of a browser, and the testing process is simpler; in addition, the user authority identification information is placed in the interface request, so that interface test coding is convenient to realize, all interfaces can be tested by using automatic test codes when iterative updating is carried out every time, manual operation testing is not needed, and the testing efficiency is high.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flowchart of a first embodiment of a method for automated interface testing according to the present invention;
FIG. 2 is a flowchart of a second embodiment of the method for automatically testing an interface of the present invention;
FIG. 3 is a flowchart of a third embodiment of the method for automatically testing an interface of the present invention;
FIG. 4 is a schematic structural diagram of a first exemplary embodiment of an interface automatic test apparatus according to the present invention;
FIG. 5 is a schematic structural diagram of a second exemplary embodiment of an interface automatic test apparatus according to the present invention;
FIG. 6 is a schematic structural diagram of a third exemplary embodiment of an interface automatic test apparatus according to the present invention;
FIG. 7 is a schematic structural diagram of a fourth exemplary embodiment of an interface automatic test apparatus according to the present invention;
fig. 8 is a schematic structural diagram of an embodiment of an electronic device of the present invention.
Detailed Description
An interface automation test method and device according to an embodiment of the present invention are described in detail below with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a first embodiment of an interface automation test method according to the present invention, as shown in fig. 1, the method of this embodiment may include:
step 101, sending a permission verification interface request to a server.
And 102, receiving the permission verification response information returned by the server.
In this embodiment, the simulated browser sends an authority verification interface request to the server, and the server returns authority verification response information including the user authority identification information.
And 103, extracting user authority identification information from the authority verification response information.
And step 104, sending an interface request including the user authority identification information to any interface of a server.
In this step, the user right identifier information may be placed in the request parameter or header information or database of the interface request, and the interface request for performing the interface test may be directly sent to any interface of the server to test the interface.
In the embodiment, the user permission identification information is placed in the interface request, and the interface request for interface test can be directly sent to any interface of the server, so that the user permission identification information can be transmitted by using a code simulation browser principle to carry out permission verification, the interface test can be realized without the help of a browser, and the test process is simpler; in addition, the user authority identification information is placed in the interface request, so that interface test coding is convenient to realize, all interfaces can be tested by using automatic test codes when iterative updating is carried out every time, manual operation testing is not needed, and the testing efficiency is high.
Fig. 2 is a flowchart of a second embodiment of the interface automation test method of the present invention, and as shown in fig. 2, the method of the present embodiment may include:
step 201, obtaining the authority level of the user to be tested.
Step 202, judging whether a preset corresponding relation set of user authority levels and user authority identification information can be matched with the user authority levels to be tested; if so, go to step 203, otherwise go to step 204.
The corresponding relation between the user authority level and the user authority identification information is stored in the corresponding relation set. In the step, the user authority level (the current to-be-tested user authority level) obtained at this time is subjected to user authority level matching in a centralized manner according to the corresponding relation between the user authority level and the user authority identification information.
Step 203, obtaining the user authority identification information corresponding to the user authority level to be tested from the corresponding relation set of the user authority level and the user authority identification information, and then executing step 207.
In this embodiment, if the user permission level obtained this time is matched in the set of correspondence between the user permission level and the user permission identification information, the user permission identification information corresponding to the user permission level is directly obtained in the set of correspondence between the user permission level and the user permission identification information.
For example: if the corresponding relationship between the user authority level and the user authority identification information collectively stores the user authority identification information of an account a with the user authority level of 1 and the user authority identification information of an account B with the user authority level of 2, and the user authority level of the current account C to be tested is 1, the user authority identification information of the account a with the same level as the current account a to be tested can be acquired and used as the user authority identification information of the current account C to be tested.
And step 204, sending an authority check interface request to the server.
And step 205, receiving the permission verification response information returned by the server.
And step 206, extracting the user authority identification information from the authority verification response information.
Step 207, sending an interface request including the user authority identification information to any interface of the server.
In this embodiment, the implementation of step 207 is similar to that of step 104, and is not described herein again.
In this embodiment, a corresponding relationship set of the user permission level and the user permission identification information is preset, so that in each test, whether the user permission identification information corresponding to the current user permission level to be tested can be obtained in the corresponding relationship set of the user permission level and the user permission identification information can be judged, if the user permission identification information can be obtained, the recorded user permission identification information corresponding to the same user permission level is preferentially used, and if the user permission identification information cannot be matched, a permission check interface request is sent to the server side and the user permission identification information is obtained. Therefore, the number of requests from the test client to the server can be reduced, and the method is particularly suitable for testing a large number of repeated interfaces.
In an alternative embodiment, after step 206, the method further comprises the steps of: and correspondingly storing the obtained user authority level to be tested and the user authority identification information into a corresponding relation set of the user authority level and the user authority identification information. In the embodiment, the corresponding relation between the user permission level and the user permission identification information which are acquired each time and are not recorded is supplemented into the corresponding relation set between the user permission level and the user permission identification information, so that the user permission identification information can be preferentially acquired from the corresponding relation between the user permission level and the user permission identification information in the next interface test, the step of requesting interface permission verification to a server is omitted, and the interface test efficiency is improved.
Obviously, in another optional embodiment, the user right level and the corresponding relationship set of the user right identification information may also be updated periodically, and the updating method includes: for each user permission level in the corresponding relationship set of the user permission level and the user permission identification information, taking a user at the same permission level as a test user, sending a permission verification interface request to the server by adopting the method shown in step 101-103 to acquire the user permission identification information corresponding to the user permission level, and replacing the user permission identification information corresponding to the corresponding user permission level in the corresponding relationship set of the user permission level and the user permission identification information with the currently acquired user permission identification information so as to ensure that the user permission identification information recorded in the corresponding relationship set of the user permission level and the user permission identification information is in a latest information state.
The following describes the embodiment of the interface automation test according to the present invention in detail by using a specific example.
Fig. 3 is a flowchart of a third embodiment of the interface automation test method of the present invention, as shown in fig. 3, the method of this embodiment may include:
301, acquiring the authority level of the user to be tested.
Step 302, judging whether a preset corresponding relation set of user permission levels and cookie information can be matched with the user permission level to be tested; if so, go to step 303, otherwise, go to step 304.
Step 303, obtaining cookie information corresponding to the authority level of the user to be tested, and continuing to execute step 307.
In this embodiment, the implementation method of steps 301-303 is similar to that of steps 201-203, and is not described herein again.
And step 304, the simulated browser sends an HTTP-form authority verification interface request to the server.
In this embodiment, an HTTP request is sent to the server by using a code simulation browser principle, that is: the step is not realized by a browser, but the principle that the browser sends a request to the server is realized by a program code, and when an interface is tested, the program code is directly called and operated to send the permission verification interface request to the server.
And 305, receiving the permission verification response information returned by the server.
And the permission verification response information returned by the server side comprises cookie information for identifying the user permission.
Step 306, extracting cookie information from the response header of the permission check response information.
And 307, placing the acquired cookie information in a request header of the interface request.
And 308, sending an interface request comprising the cookie information acquired at this time to any interface of the server.
In the embodiment, the cookie corresponding to the current user permission level is directly and intensively obtained from the preset corresponding relation between the user permission level and the cookie information, or the permission verification interface request in the HTTP form is sent to the server through the code simulation browser to obtain the cookie information, then the obtained cookie information is placed in the request head of the interface request to request any interface of the server, the automatic simulation browser can be realized to obtain the cookie information without manually operating the browser, and the obtained cookie information is added into the interface request to request any interface of the server, so that the automatic test of the interface can be realized, the test is simple, and the labor is saved.
Corresponding to the interface automatic testing method provided by the embodiment of the invention, the embodiment of the invention also provides an interface automatic testing device. Fig. 4 is a schematic structural diagram of a first embodiment of an interface automation test apparatus according to the present invention, as shown in fig. 4, the apparatus of the present embodiment may include: a first request module 11, a receiving module 12, an extracting module 13 and a second request module 14; the first request module 11 is configured to send an authority verification interface request to a server; a receiving module 12, configured to receive permission check response information returned by the server; an extraction module 13, configured to extract user permission identification information from the permission verification response information; and a second request module 14, configured to send an interface request including the user right identification information to any interface of the server.
The apparatus of this embodiment may be configured to implement the technical solution of the method embodiment shown in fig. 1, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 5 is a schematic structural diagram of a second embodiment of the interface automation test apparatus of the present invention, as shown in fig. 5, the apparatus of this embodiment is based on the apparatus structure shown in fig. 4, and further, the apparatus may further include: a first obtaining module 15, a judging module 16 and a second obtaining module 17; the first obtaining module 15 is configured to obtain a user permission level to be tested; the judging module 16 is configured to judge whether a preset corresponding relationship set between the user permission level and the user permission identification information can be matched with the user permission level to be tested; a second obtaining module 17, configured to, when the determination result of the determining module 16 is yes, obtain, from the corresponding relationship between the user permission level and the user permission identification information, user permission identification information corresponding to the user permission level to be tested in a centralized manner; the first request module 11 is specifically configured to send an authorization check interface request to the server if the determination result of the determining module 16 is negative.
The apparatus of this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 2, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of a third embodiment of an interface automation test apparatus according to the present invention, as shown in fig. 6, the apparatus of the present embodiment is based on the apparatus structure shown in fig. 5, and further, the apparatus may further include: the storage module 18 is configured to correspondingly store the user permission level to be tested acquired by the first acquiring module 15 and the user permission identification information acquired by the extracting module 13 into a corresponding relationship set between the user permission level and the user permission identification information.
Fig. 7 is a schematic structural diagram of a fourth embodiment of the interface automation test apparatus according to the present invention, as shown in fig. 7, the apparatus of this embodiment is based on the apparatus structure shown in fig. 6, and further, the second request module 14 may include a setting sub-module 141 and a sending sub-module 142. In this embodiment, the user permission identification information is cookie information; the first request module 11 is specifically configured to simulate a browser to send an HTTP-style permission verification interface request to the server; an extracting module 13, configured to extract cookie information from a response header of the permission verification response information; a setting sub-module 141, configured to place the currently extracted cookie information (including cookie information extracted by the extraction module 13 from a response header of the right check response information or cookie information directly extracted by the second obtaining module 17 from a corresponding set of the user right level and the cookie information) in a request header of the interface request; the sending submodule 142 is configured to send the interface request obtained by the setting submodule 141 to any interface of the server.
The apparatus of this embodiment may be used to implement the technical solution of the method embodiment shown in fig. 3, and the implementation principle and the technical effect are similar, which are not described herein again.
Corresponding to the method for automatically testing an interface provided in the embodiment of the present invention, an embodiment of the present invention further provides an electronic device, fig. 8 is a schematic structural diagram of an embodiment of the electronic device of the present invention, and a flow of the embodiment shown in fig. 1 of the present invention may be implemented, and as shown in fig. 8, the electronic device may include: the device comprises a shell 21, a processor 22, a memory 23, a circuit board 24 and a power circuit 25, wherein the circuit board 24 is arranged in a space enclosed by the shell 21, and the processor 22 and the memory 23 are arranged on the circuit board 24; a power supply circuit 25 for supplying power to each circuit or device of the electronic apparatus; the memory 23 is used for storing executable program codes; the processor 22 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 23, so as to execute the interface automatic test method according to any one of the foregoing embodiments.
The electronic devices described above exist in a variety of forms, including but not limited to:
(1) a mobile communication device: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) Ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as ipads.
(3) A portable entertainment device: such devices may display and play multimedia content. This kind of equipment includes: audio, video playing modules (e.g., ipods), handheld game consoles, electronic books, and smart toys and portable car navigation devices.
(4) A server: the device for providing the computing service comprises a processor, a hard disk, a memory, a system bus and the like, and the server is similar to a general computer architecture, but has higher requirements on processing capacity, stability, reliability, safety, expandability, manageability and the like because high-reliability service needs to be provided.
(5) And other electronic equipment with data interaction function.
The present invention further provides a computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, is adapted to implement the steps of the interface automation testing method of any of the preceding embodiments.
The embodiment of the invention also provides an application program for executing the interface automation test method in any one of the above embodiments.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by a computer program, which may be stored in a computer readable storage medium and executed by a computer to implement the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. An automated interface testing method, which is used for a testing end, comprises the following steps:
acquiring the authority level of a user to be tested;
judging whether a preset corresponding relation set of user authority levels and user authority identification information can be matched with the user authority levels to be tested or not;
if the user authority level to be tested can be matched in the corresponding relation set of the user authority level and the user authority identification information, obtaining the user authority identification information corresponding to the user authority level to be tested from the corresponding relation set of the user authority level and the user authority identification information;
if the corresponding relation set of the user authority level and the user authority identification information can not be matched with the user authority level to be tested, sending an authority verification interface request to a server side;
receiving permission verification response information returned by the server side;
extracting user authority identification information from the authority verification response information;
and sending an interface request comprising the user authority identification information to any interface of the server so as to test the interface.
2. The method for automatically testing an interface according to claim 1, further comprising, after extracting user right identification information from the right check response information:
and correspondingly storing the obtained user authority level to be tested and the user authority identification information into a corresponding relation set of the user authority level and the user authority identification information.
3. The automated interface testing method according to claim 1 or 2, wherein the sending of the permission check interface request to the server includes:
and the simulated browser sends an authority verification interface request in the form of HTTP to the server.
4. The interface automation test method of claim 1 wherein the user authority identification information is cookie information;
wherein the extracting the user authority identification information from the authority verification response information includes:
extracting cookie information from a response header of the permission verification response information;
the sending of the interface request including the user authority identification information to any interface of the server includes:
the cookie information extracted this time is placed in a request header of an interface request;
and sending the interface request to any interface of the server.
5. An interface automatic testing device, which is used for a testing end, comprises:
the first acquisition module is used for acquiring the authority level of a user to be tested;
the judging module is used for judging whether a preset corresponding relation set of the user permission level and the user permission identification information can be matched with the user permission level to be tested or not;
the second obtaining module is used for obtaining the user authority identification information corresponding to the user authority level to be tested from the corresponding relation between the user authority level and the user authority identification information in a centralized manner when the judgment result of the judging module is yes;
the first request module is used for sending an authority check interface request to the server side when the judgment result of the judgment module is negative;
the receiving module is used for receiving the permission verification response information returned by the server;
the extraction module is used for extracting user authority identification information from the authority verification response information;
and the second request module is used for sending an interface request comprising the user authority identification information to any interface of the server so as to test the interface.
6. The interface automation test device of claim 5 further comprising:
and the storage module is used for correspondingly storing the user permission level to be tested acquired by the first acquisition module and the user permission identification information acquired by the extraction module into a corresponding relation set of the user permission level and the user permission identification information.
7. The device according to claim 5 or 6, wherein the first request module is specifically configured to simulate a browser to send an HTTP-format permission check interface request to the server.
8. The interface automation test device of claim 5 wherein the user authority identification information is cookie information;
the extraction module is specifically configured to extract cookie information from a response header of the permission verification response information;
the second request module includes:
setting submodule for setting the cookie information extracted this time in the request head of the interface request;
and the sending submodule is used for sending the interface request obtained by the setting submodule to any interface of the server.
9. An electronic device, characterized in that the electronic device comprises: the device comprises a shell, a processor, a memory, a circuit board and a power circuit, wherein the circuit board is arranged in a space enclosed by the shell, and the processor and the memory are arranged on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the client; the memory is used for storing executable program codes; the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the interface automated testing method of any one of the preceding claims 1 to 4.
CN201811009140.XA 2018-08-30 2018-08-30 Interface automation test method and device and electronic equipment Active CN109344052B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811009140.XA CN109344052B (en) 2018-08-30 2018-08-30 Interface automation test method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811009140.XA CN109344052B (en) 2018-08-30 2018-08-30 Interface automation test method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109344052A CN109344052A (en) 2019-02-15
CN109344052B true CN109344052B (en) 2022-07-26

Family

ID=65292123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811009140.XA Active CN109344052B (en) 2018-08-30 2018-08-30 Interface automation test method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109344052B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111831530A (en) * 2019-04-15 2020-10-27 北京字节跳动网络技术有限公司 Test method and device
CN113704080A (en) * 2020-05-22 2021-11-26 北京沃东天骏信息技术有限公司 Automatic testing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626379A (en) * 2009-08-11 2010-01-13 深圳市融创天下科技发展有限公司 Access management method and access management device for classifying access rights in embedded system
CN105335293A (en) * 2015-11-30 2016-02-17 努比亚技术有限公司 Automatic testing system and method based on parallel ports

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105450581B (en) * 2014-06-20 2019-12-03 北京新媒传信科技有限公司 The method and apparatus of permission control
CN107832163A (en) * 2017-11-29 2018-03-23 努比亚技术有限公司 A kind of buffering updating method, server and computer-readable recording medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626379A (en) * 2009-08-11 2010-01-13 深圳市融创天下科技发展有限公司 Access management method and access management device for classifying access rights in embedded system
CN105335293A (en) * 2015-11-30 2016-02-17 努比亚技术有限公司 Automatic testing system and method based on parallel ports

Also Published As

Publication number Publication date
CN109344052A (en) 2019-02-15

Similar Documents

Publication Publication Date Title
CN110636131B (en) Internet of things testing system based on cloud technology
CN108632213B (en) Equipment information processing method and device
CN103259795A (en) Method for executing automatic register and login, mobile terminal and server
CN104995626A (en) Identification delegation for devices
CN110691085B (en) Login method, login device, password management system and computer readable medium
CN102932775A (en) Method and device for carrying out terminal identification by combining IMEI and UA
CN113268336B (en) Service acquisition method, device, equipment and readable medium
CN105992204A (en) Access authentication method of applications of mobile intelligent terminal and device
CN109344052B (en) Interface automation test method and device and electronic equipment
CN109462601A (en) Multi-platform access method and device based on eSIM
CN108989359A (en) Method for verifying login and system, the readable storage medium storing program for executing and terminal of server cluster
CN114139135B (en) Equipment login management method, device and storage medium
CN103001934B (en) The method and system that terminal applies logs in
CN105337739B (en) Safe login method, device, server and terminal
CN112511739B (en) Interactive information generation method and equipment
CN110688319B (en) Application keep-alive capability test method and related device
CN110022327B (en) Short message authentication test method and device
CN112433935A (en) Test method, test device, electronic equipment and storage medium
CN105743879B (en) Smart television personal identification method and system
CN108647139B (en) System test method, device, storage medium and electronic device
CN105704705A (en) Method for switching terminals with shared eSIM information, terminal and server
CN107357562B (en) Information filling method, device and client
CN110225097B (en) Information processing method, device and storage medium
CN109656535B (en) Voice skill off-line development method based on browser
CN111782291A (en) Test page starting method and device

Legal Events

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