POSTMAN integration

Ask general questions here.
Punashri M S
Posts: 42
Joined: Tue Jan 30, 2018 12:56 pm

POSTMAN integration

Post by Punashri M S » Mon Jan 27, 2020 11:40 am

Hello All,

Want to do a API testing. So can we integrate POSTMAN with Ranorex?

thanks in advance

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: POSTMAN integration

Post by odklizec » Mon Jan 27, 2020 11:55 am

Hi,

As long as there is a Postman API, it should not be a problem to write Postman-related code in Ranorex? Sorry, there are no code examples at this forum. You will have to use google ;)

Also, it seems that Postman directly allows to export code snippets in various languages, including C#...
https://learning.getpostman.com/docs/po ... -snippets/
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Vega
Posts: 222
Joined: Tue Jan 17, 2023 7:50 pm

Re: POSTMAN integration

Post by Vega » Mon Jan 27, 2020 9:34 pm

REST Sharp is another very common resource for testing REST API in .NET. You should be able to use anything .NET based pretty easily

http://restsharp.org/

hope this helps

Punashri M S
Posts: 42
Joined: Tue Jan 30, 2018 12:56 pm

Re: POSTMAN integration

Post by Punashri M S » Mon Feb 03, 2020 5:31 am

Thanks for the suggestions.

Could you please help us using POSTMAN.
We need to follow below steps for validation.

1) Using Postman generate the C# code for the API
2) Run this generated code using Ranorex
3) Use some assertion statement to validate the API’s

And how to use REST Sharp with Ranorex.

please share if there any reference videos.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: POSTMAN integration

Post by odklizec » Tue Feb 04, 2020 10:05 am

Hi,

I'm afraid, there are no examples of integration you are looking for. You must go through the links we suggested before and try to cook something up yourself. This task is not trivial and completely out of scope of this forum. So you must first try to achieve it by yourself and eventually ask for help with implementation problems you may eventually face. I'm afraid, you cannot expect that anyone here will develop a complete solution for you? ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

semate
Posts: 19
Joined: Tue Jul 03, 2018 7:42 am

Re: POSTMAN integration

Post by semate » Fri Feb 07, 2020 11:12 am

Use Project -> Manage Packages ... . Search for RestSharp
RestSharp should show up in your References.

And then it depends on your Rest call. Below a example for Post with Basic Authentication.
Add error handling as you like.
See the RestSharp page for more infos.

Code: Select all

using RestSharp;
using RestSharp.Authenticators;

public static void Post(string uri, string user, string pw)
{
	var client = new RestClient(uri);
	client.Authenticator = new HttpBasicAuthenticator(user,pw);
	var request = new RestRequest(Method.POST);		
	request.AddHeader("accept", "*/*");
	IRestResponse resp = client.Execute(request);
}