2

• In case of .NET 2.0 ASMX you can post HTTP requests for the web service using HttpWebRequest and HttpWebResponse

• Is this approach possible for java based web service as well, referring to requests from java clients ? Posting as HTTP requests in java, Any example pointers would be helpful

• For Developing UI automation we rely on Page object pattern or factory pattern (General Automation Guidance)

• What is the guidance / widely adopted approach for java based web services test automation ?

I am not looking at using SOAP UI. I am looking at developing a Test Automation framework for Java based web services testing using TestNG.

Any pointers / example posts would he helpful.

Thanks, Siva

3

Is this approach possible for java based web service as well, referring to requests from java clients ? Posting as HTTP requests in java, Any example pointers would be helpful

Java (and any other programming language/environment that can communicate over TCP/IP) can issue HTTP requests and receive HTTP responses. See for example HttpClient.

What is the guidance / widely adopted approach for java based web services test automation ?

Java, as an object-oriented language, is an appropriate vehicle for modeling pages with Page Objects. See for example this article. Whether you use Page Objects is orthogonal to whether you use TestNG. You could just as easily use Page Objects with JUnit, a test framework of your own design, or no test framework at all.

0

SOAPUI is used to test SOAP requests. The UI part of SOAPUI is basically it provides a user interface which looks like a form to enter parameters into an XML envelop.

If you want to create a test automation framework that can test SOAP webservices there are two routes:

  1. Use a Java Library which can send HTTP requests, specify HTTP headers, and send XML strings. You will have to read and interpret your wsdl contract in order to do this. In order to get sample payloads, you can intercept valid posts using a proxy server.
  2. Use a library such as JAX-WS to generate a Java Client from a wsdl. You can use the client methods to create the SOAP messages you need to send.

Both of these options are a thousand times more complicated than using SOAPUI.

If you are not testing SOAP webservices, and testing browser UI, then you don't really need to do any of that. The canonical web browser automation framework is Selenium. There is plenty of documentation regarding the page object design pattern for automated UI tests.

If you are looking to test REST webservices, you can look at here.

I would also consider using a framework such as cucumber on top of testNG because testNG is really designed more for unit tests. You may want more granularity to know which part of your application the test broke at.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.