day01- Python interface test basis

    Interface tests for the front and back of the connector. The test involves the URL, request method, request parameters, return parameters. Get request is a normal request mode and post requests. request can get directly in the browser to test. post request into parameters may be key-value pairs, json, documents and the like. Wherein the get request and the request is a difference between the maximum post, get request body there is a request, the request is not requested post body.

    In the tests the interface, if the cookie in the cookie request header is added in Headers. session cookie and server, respectively.

    Interface Test use Postman, add the URL, request method, request parameters. Set of IP parameters: settings globals added value and a corresponding IP. Setting the parameters of the test data: Click runner, add the number of cycles and data files. May be added at the same time check: In the tests added in Response body: Contains string (content data included in the response), Get a variable (variable add), data variables may be added to the data file, the parameters of verification.

     

    When python configuration environment variable to configure the installation directory to install python and python scripts directory. 

    About some simple settings pycharm of the font, colors file-setting, configure create a project using python's version.

    The python conditional if condition: Condition elif Content: Content else: content. While using the loop counter define a variable count = 0 while <3: loop count + = 1, (5) for loop for i in range: looping content. And back in for a while loop can be followed else, it represents the end of a normal cycle, the code else is executed. Loop, the encounter break, stop the cycle, the end of the cycle. Continue encountered in the implementation of the following statements is not, the next cycle start again. (Input [Input] type (s) [see] int type variable s (s) into the integer variable type [STR] (s) [] variable type to string)   

    python string formatting, generally with placeholders% s or {}. str = '% s,% s'% (u, p) or str = '{u}, {p}'. format (u = u1 , p = p1). {} placeholder may be empty. (Introduction time of day import datetime ty = datetime.tatetime.today (); introducing random number import random s = random.randint (1,100))

   Common method python string, s = 'abc' s.strip () before and after removing the string s spaces or line breaks. s.lower () becomes lower case s.upper () variable capital import random random.choice (s) select a random element len ​​(s) count the number of string elements

Guess you like

Origin www.cnblogs.com/11-pythong/p/11474676.html