Interface Automation face questions

(1) we tested interfaces which category?

      Usually B / S architecture, the client calls, or analog interface to a client invocation request server, the processing by the server to complete the process and return a response.

      Http webservice interfaces such as hessian Interface Interface Interface jms

The most common (2) HTTP interface to transfer data mode?

      get and post the most commonly used.

      get is to obtain data from the server application scenarios: doing a search interface Interface product information

      post is applicable to the transmission of data on the server scenario: Adding doing when data can be used to modify or delete when uploading pictures, etc.

(3) Type HTTP interface test?

      ① get request has no parameters ② get request parameter ③ post request with parameters

(4) is usually measured how the interface?

      Parameter combination, security interfaces (distal bypass authentication, authorization bypass identity, whether the parameters are encrypted, the password security rules), abnormal authentication (pass will pass non-essential, parameter types, the reference length)

      Performance Testing

      Measuring tool with a postman, followed by jmeter test

How (5) webservice interface to test?

      Soapui tool with test

(6) Interface step of the test?

      The general process is: ① read API interface documentation ② ③ write test cases for manual testing in accordance with API test case (API development tools, testing tools)

How to (7) do not documented interface testing?

      Communication and development, then come up with interface documentation, you can try for yourself to get caught looking interface request parameters, then do not understand to communicate with developers.

(8) The next parameter is dependent on the interface a request to return data interface?

      Different interface package to a different function or method, return the required data out to a receiving intermediate variable a. A transmission interface behind it.

(9) in a manual or automated interface test interface testing process, the downstream interface on how the data dependent processing?

      To process the data with a global variable dependent

How the interface (10) interfaces tests rely logged under test?

      Essence is: every time you need to send a request to bring the session or cookie sent successfully, add the necessary session or cookie when building the post request

How (11) depends on the login interface processing?

      Login interface dependence token after the first log, to keep a token or json yaml ini configuration file or which

      All subsequent requests get this data can be used globally

      If cookies are the parameters, it can be automatically associated with the session

(12) How dependent on third-party interface processing?

      This needs its own to build a mock service, analog interface returns data

      mock framework is an open source, on github can be downloaded to.

      mock unit can be used in the testing process, there is a purpose, the front-end development time in the development of the page, you need to provide server-side API interface, then the server has not developed, or that did not set up a test environment, this time the front-end development will own a mock api server, provide for ourselves call returns data interface.

(13) How the interface data generated garbage clean-up?

      Data cleaning made data required python database connection, do CRUD operations

      Pre-test, setUp do data preparation

      Post operation, tearDown do data cleansing

(14) Where did you put the test data?

      Test data for very many, do not speak and write in code, because the data is not written in the code of the dead.

      .Py file into the beginning of the test data, for the small number of fixed data is possible.

      Test data is stored Summary:

             ① For some of the time consumption data, such as registration, each registration number is not the same, may be generated by a random function

             ② an interface for multiple sets of test parameters can be parameterized data put yaml, text, json, execl so can

             ③ data for repeated use, such as various status of the order situation needs to build data can be placed in a database, each data initialization, and then run out to clean up

             ④ For some mailbox configuration parameters, you can use the configuration file ini

             ⑤ separate interfaces for all project, you can use data-driven way, with the interface data execl / csv management test

             ⑥ for account password, global parameters such tubes, can use the command-line arguments, to separate out, arranged in the unloading i (e.g. INI)

             ⑦ For small amounts of static data, such as test data interface, also 2-3 group, can be written at the beginning of python scripts, eight or ten years will not change.

(15) the difference between json and dictionaries?

     json is a lightweight data-interchange format. Json the nature or character string, but by key: format string value of this key-value pairs.

     Such as: a = { 'a': 1, 'b': 2} This is the dictionary

           a = '{' a ': 1,' b ': 2}' What is json

(16) an irreversible action, how to deal with, such as deleting an order to test how such an interface?

     Test data made mainly by hand, directly changes the state field in the database. Automation is the same, the data can be made with the python connected to the database, do CRUD operations

     Pre-test, setUp do data preparation

     Post operation, tearDown do data cleansing

Several states (17) an order of how all measured. Such as: untreated, treatment, treatment failure, treatment success?

     Is the same, the data made by the python connected to the database, modifying the status data

(18) How to connect to the database operations python?

     PyMYSQL for a database connection mysql server version in python3.x

     mysqldb is in use in python2

      - first import module (mounted in advance pip) import pymysql or import mysqldb

      - Open Database Connectivity db = pymysql.connect ( "localhost", "username", "psw", "db_name")

      - Create a cursor object cursor = db.cursor ()

      - sql query sql = "select * from emp"

      - Execute sql statement cursor.execute (sql)

      - Get a list of all the records cursor.fetchall () and then loop through for

      - close the connection db.Close ()

(19) do interface testing process discovered what bug?

      For example: test reflects the amount of submission, one day database inserts a mention of the amount of negative cash, you want to develop reproducible, how did you test an error on the page, it is front-end have been restricted. Can bypass the front end, directly with an interface to directly request interface tool, or with fiddler grab bag, the interface Kou caught modified negative amount.

(20) when an interface appears abnormal, how do you analyze abnormal?

      Packet capture tool with fiddler or press F12 on the browser debugging. Fiddler the app to use the proxy settings, see the request message and a return message.

      Check the back-end log, xshell even on the server, view the log.

(21) How to simulate a weak network settings?

      charles fiddler and can simulate, simulate packet loss usually say, it is a weak analog network testing.

      By setting the delay charles, different analog network: charles Once configured, the normal network, select low throttle settings provided network environment

          thtottle preset network selection weak environmental goals: 2G or 3G; upload and download may be selected value (kbps) in the Bandwidth

      By fiddler weak analog network: Open fiddler -> rules -> customer rules -> there will be a fiddler script editor window,

           Using ctrl + F key combination to bring up the Search dialog box, type m_Simulate search, find the following block of code:

        

           upload representatives upload speed, download speed download representatives. After you customize modify, save and exit.

           Continue to find rules- on fiddler interface> perfomance-> Click Simulate Modem Speeds, complete weak net open analog functions.

(22) how bug analysis front-end or back-end?

      First look at request packet capture, facing interface documentation, see the request packets have no problem, there is a problem that made the front end of the data is wrong.

      Request packet no problem, then look at the return packet, the returned data is wrong, and that is the back-end development issues.

(23) What http interface and a web service interface to test the difference between that?

      Traditional web service: a complete set of protocol standards, including soap protocol that is used for information transmission.

            soap request is a specialized version of HTTP POST, following a special message format xml Content-type to: text / xml xml can be of any data.

            The benefits of the web service is: do not worry about cases

                                                 Do not worry about Chinese issues urlencode

                                                 Repeatedly stated the code without authentication (username, password) parameters

                                                  Parameters can be passed as an array, object, etc.

             Since the web service to be xml parsing, speed may be reduced.

      Now you can replace HTTP web service.

Guess you like

Origin www.cnblogs.com/peipei-Study/p/12028385.html