Need to Test REST webservice using Ranorex

Class library usage, coding and language questions.
vivek.guvva
Posts: 31
Joined: Mon Feb 22, 2016 7:21 pm

Need to Test REST webservice using Ranorex

Post by vivek.guvva » Fri Sep 23, 2016 7:46 pm

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

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Need to Test REST webservice using Ranorex

Post by krstcs » Fri Sep 23, 2016 9:13 pm

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.
Shortcuts usually aren't...

jmchughsmart
Posts: 28
Joined: Wed Aug 12, 2015 6:44 pm

Re: Need to Test REST webservice using Ranorex

Post by jmchughsmart » Thu Dec 22, 2016 9:14 pm

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.

User avatar
RobinHood42
Posts: 324
Joined: Fri Jan 09, 2015 3:24 pm

Re: Need to Test REST webservice using Ranorex

Post by RobinHood42 » Fri Dec 23, 2016 8:36 am

Hi jmchughsmart,

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

Cheers,
Robin

jmchughsmart
Posts: 28
Joined: Wed Aug 12, 2015 6:44 pm

Re: Need to Test REST webservice using Ranorex

Post by jmchughsmart » Fri Dec 23, 2016 2:46 pm

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.

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

Re: Need to Test REST webservice using Ranorex

Post by odklizec » Fri Dec 23, 2016 3:07 pm

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?
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