Page 1 of 1

Need to Test REST webservice using Ranorex

Posted: Fri Sep 23, 2016 7:46 pm
by vivek.guvva
Hi All,

I have a requirement to test REST webservice in Ranorex and Compare the Data in Response JSON with the Hadoop query result.

Below is the flow:
1) Submit the REST request with some parameters and Get the Response in JSON format
2) Execute Hadoop query and Convert the output the JSON format
2) Compare the 2 JSON files.

Please let us know if there is any way we can do this with Ranorex. Sharing any code is appreciated and will be very useful.

Thanks and Regards
Vivek

Re: Need to Test REST webservice using Ranorex

Posted: Fri Sep 23, 2016 9:13 pm
by krstcs
Ranorex is a Functional UI Test Automation tool. It is not designed, out-of-the-box, to be used for service testing, and there is no way to do it without getting into .NET code.

However, it is a .NET-base system and you can do pretty much anything you need with it in the framework of .NET.

If you want code examples, there are plenty of examples on the web concerning how to interact with a restful API in .NET and how to parse JSON (hint: use the Newtonsoft.Json library!). You will have to decide what the best way to do this is for your situation.

For example:

Code: Select all

using (HttpClient client = new HttpClient()) {
    HttpResponseMessage response = client.GetAsync(serviceUri).Result;
}
But, then you need to convert the response into something usable like a memory stream using a serializer.

My code library that does this for me, but it is rather large and contains proprietary code that I can't release.

Re: Need to Test REST webservice using Ranorex

Posted: Thu Dec 22, 2016 9:14 pm
by jmchughsmart
Hi

We also have the need to test REST webservice. We are using Ranorex 6.2.0.
Are there any plans to be able to add REST references to your Solution.

Re: Need to Test REST webservice using Ranorex

Posted: Fri Dec 23, 2016 8:36 am
by RobinHood42
Hi jmchughsmart,

This already can be done like with any other .net based project. Do you face a any issues?

Cheers,
Robin

Re: Need to Test REST webservice using Ranorex

Posted: Fri Dec 23, 2016 2:46 pm
by jmchughsmart
Hi RobinHood42,

Yes, looking for 'How to' information: "done like with any other .net based project"

Possibly, some one has a Ranorex Solution that can be reviewed.

Re: Need to Test REST webservice using Ranorex

Posted: Fri Dec 23, 2016 3:07 pm
by odklizec
Hi, the best place to search for a Ranorex-related examples is this forum ;) We already discussed sending web service requests couple of times. Please examine for example this post...
http://www.ranorex.com/forum/restful-we ... t8413.html
Hope this helps?