Is JBehave a good choice for Web Service Automated Testing? - web-services

We have a requirement at my workplace to automate the webservice testing. We have been using QTP scripts to do so.
We as a team, Kind of leaning towards Jbehave as a choice. Is JBehave a good choice for web service functional testing automation?
We do use Soap UI to test manually. But we are planning to automate the functional and regression testing to reduce the release cycle time.
Suggestions welcome.

It may not be possible easy to implement load (performance) tests. Can't see any reason why writing functional and regression tests would be a problem.

Related

What is regression testing and its automation in web-development?

Let's suppose we're talking about a microservices-based web-application developed by Scrum teams.
What is regression testing in web-development? How does it relate to manual testing? Does it test usability, UI, localization or what? Which automation frameworks are used? How much time does it take? Why is it particulary important to automate regression testing?

ecommerce application web tier/presentation layer unit testing

We have had some success using selenium and web driver along with Jbehave. just wanted to know what others are using for unit testing the web tier of any web application?
the reason i am asking is , writing web driver test cases along with jbehave makes the unit testing very complicated and in more cases, it is taking more time then writing an actual JSP page.
A few ideas for unit testing a web tier:
Use MVC for doing web development. It is pretty easy to unit test controllers assuming you extract all your dependencies.
Make liberal use of interfaces to extract dependencies in your JSP pages. For example, does your JSP make a database call? Consider making an Repository interface and then have implementations like MySQLRepositoryImpl.java that implement the interface. This way, you can also "mock" the interface and create a fake database that will run fast in your unit tests.
For very difficult problems where you absolutely need to use a dependency, you can get embedded versions of things like web servers (Grizzly, Jetty) or even databases (H2, SQLite).
Make sure you write your code such that each function does one thing and one thing only. This will take some refactoring, but it makes testing so much easier.

Best way to write JUnit tests for SOAP service

What are the best Junit tests for soap services.
Would connecting to the web service fall under a unit test or an integration test?
I need to pick useful unit tests and was looking for ideas on tests that would be automatable and repeatable.
Thanks.
For unit tests, you should test an isolated behavior of a single class, and therefore use mocks/stubs/test doubles as much as possible. If you do not mock, then you are not testing an isolated part of your code. Hence isolating the error becomes more difficult and the test might also not be repeatable (e.g. strange network behavior might occur unrepeatably).
You should also try to automate your integration tests, where you replace your mocked objects with the real implementations.
At this infoq site you can find a short introduction about mocking web services, and several links to tutorials/tools/whitepapers.

how do you use TDD for developing webservices using Oracle Service Bus

Does anyone have any opinions on how TDD and UNIT testing would would when developing web services using Oracle Service Bus? All I can think of is stubbing out the back ends then running tests through the service bus, but that's really just integration testing. How would I apply TDD principles in this instance?
Is your question actually how best to conduct unit tests on Oracle Service Bus components? I have the same issue but have come to the view that now your unit of code is not a Java method or a class but a whole proxy.
It does however limit you to being only able, at best, to conduct component integration testing as you have described: Stubbing out the other systems and running what you'd traditionally call Integration tests through the Service Bus.
Scale up your unit of work.
If there is a better way to automate and test these code artifacts then I want to hear about it.

Selenium vs old-school POST/GET based tests

We have a considerable code base with relatively high test coverage for pages/forms, all via vanilla POST/GET.
Now, we are find ourselves moving more into the 'ajaxy' space, and it's not quite possible to test with GET/POST complete scenarios like user registration, or an item creation, as they involve lots of JavaScript/Ajax calls.
While things like that are the most likely candidates for testing with Selenium, I wonder should we adopt the Selenium testing across the board, leaving the old-school POST/GET tests altogether?
Advantages of Selenium adoption seems to be too good - ability to run pretty much same GET/POST tests but across the range of browsers.
Or am I missing something in my pursuit of cool and trendy stuff and ditching the old proven POST/GET tests?
There's advantages and disadvantages of both approaches, so my recommendation would be to use both.
Selenium launches an actual browser and simulates a user interacting with your web application, which can be great if you're testing Ajax features. It can verify that elements are visible and interact with them just as a user would. Another killer feature is the ability to take screenshots through Selenium, which can be incredibly useful when investigating failures.
Unfortunately launching a browser and navigating to a specific page/state in your application can be slow, and you'd need a lot of hardware if you wanted to test concurrent users (load testing) with Selenium.
If you just want to test that your server responds with a HTTP 200 for certain actions, or load test your applications, or that the response contains certain values then basic POST/GET would be more suitable.
If you do decide to go with a pure Selenium approach to testing I would recommend looking into using Selenium Grid or a cloud based service, as running lots of tests through Selenium can be quite time consuming.
I think you should definitely use Selenium and POST/GET (Unit) tests altogether, because the aim of your unit test is to test functionality of a specific section of code but Selenium is is doing integration testing on your web-app.