Web services testing

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
User avatar
daa
Posts: 22
Joined: Tue May 19, 2009 2:01 pm
Location: York, UK
Contact:

Web services testing

Post by daa » Wed Sep 30, 2009 3:10 pm

We're already using Ranorex to test out native windows and web applications, but what support is there for webservice testing, please? We provide a number of webservice links via a .asmx page, and we'd like to automate some tests for them.
David Allsopp,
Test Automation Engineer, Mitrefinch Ltd.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Web services testing

Post by Support Team » Thu Oct 01, 2009 4:46 pm

Because Ranorex is a GUI test framework, there is no testing support for webservices per se.
However, Ranorex Studio supports adding web references (Project->References->Add web reference)
which allows direct access to web services in your test scripts. This can be used, for example,
to make web service calls within User Code actions in Recorder.

Michael
Ranorex Team
.
Image

User avatar
daa
Posts: 22
Joined: Tue May 19, 2009 2:01 pm
Location: York, UK
Contact:

Re: Web services testing

Post by daa » Fri Oct 02, 2009 8:36 am

OK, I've had a search through the help and around the Ranorex site, and I can't find anything...

So, let's assume I know nothing about web references in Ranorex (this is a very good assumption). How do I go about calling the service? Does it appear as some kind of function call? I can do the 'Add web reference' thing, and the 'Available web services' tab shows the services I expect to see. If I want to use, say, the 'WebServerTime' service to ask the time, what sort of code is it, please? And do you have any examples or stubs to get me started?

I have added this service, and I now get a 'Web References' item in the 'References' tree in Studio, showing a .map, a .disco, and a .wsdl file.

Thanks in advance.
David Allsopp,
Test Automation Engineer, Mitrefinch Ltd.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Web services testing

Post by Support Team » Fri Oct 02, 2009 1:10 pm

There is no documentation for web services in Ranorex because they are standard functionality of the .NET framework and not part of Ranorex. (But they can be used in Ranorex Studio like everything else in the .NET framework)

So if you have your "WebServerTime" web service, add a web reference by using the web service URL of your web service.
When adding, it is probably best to set the namespace to the same namespace as your test script.

(the name of the webservice class itself is determined by the WSDL, not the reference name)

Then you can just call methods on the web service in your test script (or recorder user code actions), e.g.
WebServerTime timeService = new WebServerTime();
// assuming there is a "GetTime" method in your webservice
DateTime myTime = timeService.GetTime();
Hope this helps,
Michael
Ranorex Team
.
Image

User avatar
daa
Posts: 22
Joined: Tue May 19, 2009 2:01 pm
Location: York, UK
Contact:

Re: Web services testing

Post by daa » Fri Oct 02, 2009 1:41 pm

OK, good, that's beginning to make sense now. A further look at the Web Reference shows a generated .cs file that seems to contain class definitions for an interface. I'm sure I can get the webservice developers to give me a quick tutorial on the rest.

Thanks
David Allsopp,
Test Automation Engineer, Mitrefinch Ltd.

surya
Posts: 2
Joined: Thu Feb 23, 2012 12:25 pm

Re: Web services testing

Post by surya » Wed Mar 14, 2012 8:50 am

Hi,
I am in the process of evaluating Ranorex using the latest free trail download version(3.2.1). As part of evaluation test suite, I wanted to carry webservice testing. As per this forum, But I couldn't see 'References > Add web reference’ under 'Project' menu in my Ranorex Studio, instead I could see only 'Project > Add Reference'.

Please help me my studio didn't show this option. Appreciate your help on this.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Web services testing

Post by Support Team » Wed Mar 14, 2012 2:23 pm

surya wrote:But I couldn't see 'References > Add web reference’ under 'Project' menu in my Ranorex Studio, instead I could see only 'Project > Add Reference'.
If you right click on the references folder of your project, a context menu with "Add Ref. and Add Web Ref." should appear.

Regards,
Peter
Ranorex Team
.
Image

surya
Posts: 2
Joined: Thu Feb 23, 2012 12:25 pm

Re: Web services testing

Post by surya » Fri Mar 16, 2012 12:38 pm

Thanks much for your quick support. Now I can add my web reference.