belajar postman test runner
TRANSCRIPT
Postman Runner
by @FachrulCH
API Testing• Who is your target audience? Who is your API consumer?• What environment/s should the API typically be used?• What aspects are you testing?• What problems are we testing for?• What are your priorities to test?• What is supposed to happen in normal circumstances?• What could potentially happen in abnormal circumstances?• What is defined as a Pass or a Fail? What data is the desired output? What is the chain
of events?• What other APIs could this API interact with?• Who on your team is in charge of testing what?
Kinds of API testing
• Functionality testing — the API technically works.• Usability testing — the API is easy to work with.• Reliability testing — the API can be consistently connected to and lead to consistent results.• Load testing — the API can handle a large amount of calls.• Creativity testing — the API can handle being used in different ways.• Security testing — the API has defined security requirements including authentication,
permissions and access controls. See some API security tips for protectiving vital data.• Proficiency testing — the API increases what developers are able to do.• API documentation testing — also called discovery testing, the API documentation easily
guides the user.
postman?
Case 1
What to test?1. Response status 2002. Response time (optional)3. Response is equal to string (optional)4. Total > 05. Content type json6. Contain 'Indonesia'
What the test look like?
Story: We want to get list of country in the system
Case 2
What to test?1. Response status 2002. Response time (optional)3. Contain 1 data4. Content type json5. Contain Selected country name
What the test look like?
Story: We want to get detail info of one country
prepare• Select one country (add following code in case 1 sample)
Generate dummy data http://www.generatedata.com/
Advance trick
Prepared variable
Prepared variable
Used Here
Assertion test
Generate dummy data http://www.generatedata.com/
Download dummy data in .json format
Running a collection
Test result
kelar!thanks :D
@fachrulch