Hi everyone, I want to create postman collection through Java program .There is any API which I use ? How do I create dynamically collection and some get and post request through Java code . not from postman interface ? Thank you
Hey @supply-operator-2643, you can find the list of API on the below link which will help you create collection.
Cheers
thank you sahuvikram but still I canβt figure out how to create program who hit the api and create it dynamically with passing fields,
for example I pass 2 fileds
1 id
2 name
and request method is post
so it will generate http://localhost:8080/create
Hi @supply-operator-2643 did you able to get a way around, I am looking for something similar, let me know in case you got any reference. Thanks
Iβve got to ask. Why do you want to do this?
If you are coding this in any programming language, surely you would just call the API directly.
Hi @michaelderekjones currently we are copying headers , body to postman for testing instead we are looking for a solution in java testcase
that will create a postman collection and we can just import it and test.
I sort of get that if your main UI testing is Java, but the amount of code you would need to write to do this including the error handling would be extreme. Which is sort of why you use Postman in the first place.
I donβt think youβll find any examples apart from the link supplied previously as I donβt think it something that anyone has really tried. The only chance you have is if someone has done this before. You are basically creating a JSON structure, so perhaps that is what you need to Google. The collection and environment files are just JSON files at the end of the day.
API testing should come before UI testing, and they should be separate tests\libraries. Just in case you are mixing the two.
Hi @sahuvikramp,
Could you please highlight which collection of the mentioned link is useful for creating a Postman collection through java Code.
Hi,
I started as project to handle this last year, but had to stop for a while, i am restarting it and would appreciate any feedback or contributions to the code.
See github - > GitHub - cleopatra27/chocotea: A library that generates postman collection and integration tests from java code