当前位置:网站首页>Latest interface automation interview questions
Latest interface automation interview questions
2022-07-01 03:04:00 【Software testing Lao Mo】
Catalog
1、get and post The difference between ?
2、post What are the four parameter forms of the request ?
3、http Status code 302, 403, 503 What do they stand for ?
5、 How to deal with association in interface automation ?
6、 How does automated testing verify the results ?
8、 How to apply automation in this project , Your analysis of automation results
9、 What is the key to a good test plan ?
1、get and post The difference between ?
l http Is the upper layer request agreement , It mainly defines the interaction specifications between server and client , The bottom is tcp/ip agreement
l Get Will attach parameters to url after , use ? Division ,& Connect different parameters ,Get Access to resources ,post Will put the parameters in http Request body ,Post Send request data
l Get Produce a tcp Data packets ,post Produce two tcp Data packets
l Get request , The browser will http header and data Send together , Server return 200 Response code
l Psot request , Browser sends first header, Server response 100(continue), And then send data, Server return 200 Response code
l Post The safety ratio of get high , If the browser caches , Will be able to get Parameters remain in the cache , The user can see the parameter information
2、post Four parameters of the request What is the form ?
Application/x-www-form-urlencoded: Send parameters as a set of key pair values
Multipart/form-data: Support single group and multi group file upload
Application/json: Support data types according to the definition of back-end interfaces
Text/xml
3、http Status code 302, 403, 503 What do they stand for ?
302: Temporarily redirect to a page , For example, you can only enter the page after logging in , He will first temporarily redirect to the login interface
403: Not enough permissions The server understands the customer service request , But the request was rejected
503: The server is currently unavailable , Overload or maintenance
500: Server exception
404: request was aborted , The resource expected by the request was not found on the server
401: Request authentication
1XX series : Specify some actions that the client should take , The representative's request has been accepted , Need to continue processing
2XX series : The delegate request has been successfully received by the server 、 understand 、 And accept . The most common in this series are 200、201 Status code .
3XX series : Represents that the client needs to take further action to complete the request , These status codes are used to redirect , Subsequent request address ( Redirect to ) In this response Location The domain indicates . The most common in this series are 301、302 Status code .
4XX series : Indicates a request error . Represents that the client may have an error , Hinders server processing . There are common :401、404 Status code .
5xx series : Represents that the server has an error or abnormal state in the process of processing the request , It is also possible that the server realizes that it cannot complete the processing of the request with the current hardware and software resources . There are common 500、503 Status code .
4、 Companies use third-party services , Something went wrong. , Call a third party , Third party does not recognize , At this time, the log shows no errors , What to do with ?
1/ Call the third-party service separately , View the... Returned by the three-party interface status,code,msg, See if it can support normal service
2/ In their own applications mock Third party service , To call your own interface , See if it works properly , Feed back the results to a third party
3/ Configure the log level at debug When level , Add a log of the third-party request process , Check the input parameters , Respond to track the problem
5、 How to deal with association in interface automation ?
Pass the result returned by the previous request to the parameters of the next request , Reflect the result of the request to a class property ( Use setattr() function ), The next request is to call the class property
6、 How does automated testing verify the results ?
Assertion , The expected results are compared with the actual results
Database verification , According to the test scenario, query the data in the database and compare it with the data before the request
7、 What is the testing framework used for Automation ? The design of automation framework is briefly described 、 maintain
1/ The test framework :python+unittest+requests+ddt+openpyxl+pymysql+logging
The test framework :
python: Easy entry , Grammatical simplicity
unittest : Define a test case class , Specific methods to maintain the life cycle of test cases , Test scenario behavior , The test case Front scene , Behavior , Expected results , The actual result , assert methods ,Setup teardown Method
requests: Interface call , Support http Requested Library ,API concise , Offer different http Request method , Support session,cookies,
ddt : Data driven ,ddt Class decorator ,data Test method decorator unpack Unpack iteratable data types
Ordinary users , database , The configuration file ---( Basic data )
openpyxl: Data management excel Management data , Use openpyxl Module to do excel Reading and writing data (excle,csv, json, yaml, txt Can manage test data )
pymysql: Database interaction , data verification
eval,json: Data format conversion Eval take python Convert the supported formats to the corresponding formats
logging: Log processing , Unified log output format , channel , Level , Record of execution results , Easy to locate the problem
jenkins: Continuous integration
2/ Frame design ideas : Data driven + Structural layering ( Readability , Maintainability , Extensibility )
Data driven : Separate maintenance data from code , Interface call behavior is consistent , Different test scenarios are driven by different parameter combinations , Reduce code redundancy
Structural layering : The data layer + Use case layer + Logic layer
The data layer : Test data support data.xls
Use case layer : Execution of use cases test_register.py test_recharge.py
Logic layer : Encapsulation and extraction of common methods doexcle.py do_mysql.py http_requests.py logger.py Equal module
3/ Frame design steps :
Prepare test data : EXCEL Table preparation test case ---excel Data reading --- Replacement of parameter values
Initiate request : Request method (get/post Method to encapsulate ---URL The joining together of ( Different --- Parameters are converted to dictionaries
Get the return value of the request : Parse the return value code,status,msg Information
Assertion
benefits :
1、 The perfect combination of automated test cases and manual test cases , Reduce repetitive work
2、 Flexible configuration , You can switch test environment independently , Execute test case
3、 Common functions are encapsulated , Clear logic , Easy to maintain
4、 Unified execution portal , Manage test suite :
run.py The module selects the test case to be executed through fuzzy search
5、 Continuous integration , Time to build , Quick feedback
8、 How to apply automation in this project , Your analysis of automation results
After completing the design and implementation of all the automated testing frameworks , Conduct interface test , Then integrate into jenkins, Configure scheduled execution , Generate html report form , Check the test pass rate , Check the function of the interface
Every time it's published , Do regression testing , New function development before testing
9、 What is the key to a good test plan ?
Clarify the purpose of the test , Enhance the usability of the test plan , Ensure the practicality and coverage of test cases , Complete requirements documents and specifications , Strictly define the test cycle , Test rounds , Test coverage modules, etc
20200617 The beginning of Tianyu Software :
1.post,get Differences in requests
2. Key points of interface test cases
3. How to do the association between interfaces
4.cookies How to store
5. Concurrent ,cookies,token How to deal with it
6. When the three party interface fails , How to deal with it
7. How to carry out interface automation , Did you build the framework yourself ?
Jiuzhou tongchu noodles
1、 The difference between interface test and function test
2、 Key points in interface testing
3、 How to carry out interface automation testing --- How the framework is designed
4、 The reason for leaving
5、 Career orientation : Interface , performance , function , The technical content of the bottom layer is higher ?

边栏推荐
- 最新接口自动化面试题
- 第03章_用戶與權限管理
- Dell server restart Idrac method
- Dart training and sphygmomanometer inflation pump power control DPC
- Poj-3486-computers[dynamic planning]
- 【小程序项目开发-- 京东商城】uni-app之首页商品楼层
- Druid monitoring statistics source
- Introduction to webrtc concept -- an article on understanding source, track, sink and mediastream
- [linear DP] shortest editing distance
- How to buy Hong Kong shares in China? What platform is safer?
猜你喜欢

Example of Huawei operator level router configuration | example of configuring optionc mode cross domain LDP VPLS

Network address translation (NAT) technology

第03章_用户与权限管理

Mysql知识点

安装VCenter6.7【VCSA6.7(vCenter Server Appliance 6.7) 】

Introduction to kubernetes resource objects and common commands (II)

【小程序项目开发 -- 京东商城】uni-app 商品分类页面(下)

Contrastive learning of Class-agnostic Activation Map for Weakly Supervised Object Localization and

Here comes the share creators budding talent training program!

POI exports excel and displays hierarchically according to parent-child nodes
随机推荐
Error accessing URL 404
Codeforces Round #416 (Div. 2) C. Vladik and Memorable Trip
Lenovo x86 server restart management controller (xclarity controller) or TSM method
Completely solve the lost connection to MySQL server at 'reading initial communication packet
Magnetic manometer and measurement of foreign coins
[PR # 5 A] two way running (state pressure DP)
STM32 - DS18B20 temperature sampling of first-line protocol
Restcloud ETL WebService data synchronization to local
XXL job User Guide
安装VCenter6.7【VCSA6.7(vCenter Server Appliance 6.7) 】
MySQL knowledge points
Redis efficient like and cancel function
鼠标悬停效果四
Prototype and prototype chain in JS
IEDA 右键源码文件菜单简介
Restcloud ETL practice to realize incremental data synchronization without identification bit
If a parent class defines a parameterless constructor, is it necessary to call super ()?
如何校验两个文件内容是否相同
SSH configuration password free login error: /usr/bin/ssh copy ID: error: no identities found solution
Druid监控统计数据源