Skip to content

codeofthrone/go-postman-collection-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-postman-collection-runner

This package provides a quick way to write a Postman collection runner in Go. It is based on the go-postman-collection package.

Features

  • Parse Postman collections
  • Find requests by name in a Postman collection
  • Replace Postman variables in text with their actual values within test script setup
  • Send HTTP requests
  • Retrieve data from a response based on a given query

Usage

Please replace "path/to/collection.json" and "requestName" with your actual collection file path and request name.

First, create a new Postman instance:

variables := map[string]string{"var1": "value1", "var2": "value2"}
httpClient := &http.Client{}
postman, err := NewPostman("path/to/collection.json", variables, httpClient)
if err != nil {
    log.Fatal(err)
}

Find request by name

item, err := postman.FindRequestByName("requestName")
if err != nil {
    log.Fatal(err)
}

Dependencies [github.com/rbretecher/go-postman-collection]github.com/rbretecher/go-postman-collection

About

base on go-postman-collection create quick way to write collection runner

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages