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 200
2. Response time (optional)
3. Response is equal to string (optional)
4. Total > 0
5. Content type json
6. 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 200
2. Response time (optional)
3. Contain 1 data
4. Content type json
5. 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

Belajar Postman test runner

  • 1.
  • 2.
    API Testing • Whois 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?
  • 3.
    Kinds of APItesting • 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.
  • 4.
  • 6.
    Case 1 What totest? 1. Response status 200 2. Response time (optional) 3. Response is equal to string (optional) 4. Total > 0 5. Content type json 6. Contain 'Indonesia' What the test look like? Story: We want to get list of country in the system
  • 8.
    Case 2 What totest? 1. Response status 200 2. Response time (optional) 3. Contain 1 data 4. Content type json 5. Contain Selected country name What the test look like? Story: We want to get detail info of one country
  • 9.
    prepare • Select onecountry (add following code in case 1 sample)
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.