Basic information for Ready API (SoapUI): API Testing

文章转载自https://neelbhatt.com/2017/07/21/basic-information-for-ready-api-soapui/

Basic information for Ready API (SoapUI): API Testing

What is SoapUI?

SoapUI is an open-source web service testing application for service-oriented architectures (SOA) and representational state transfers (REST). Its functionality covers web service inspection, invoking, development, simulation and mocking, functional testing, load and compliance testing.

Basic kick off with SoapUI:

Once you get SoapUI installed, it will have the dashboard as shown below:

Basic information for Ready API (SoapUI): API Testing

To add sample test, we need to select between SOAP or REST:

Basic information for Ready API (SoapUI): API Testing

We will select URL as we want to test REST API. Once URL is selected, we need to provide the URL we need to test. For example I am using StackOverflow public API to get the users:

Basic information for Ready API (SoapUI): API Testing

Once we click on Next, it will create one new project and in that project it will create a TestSuite where all your test will reside:

Basic information for Ready API (SoapUI): API Testing

Once we run the test, it will show green or Red color whether the test is passed or failed:

Basic information for Ready API (SoapUI): API Testing

If the test is passed, it will show the response in JSON which we have got with REST GET request:

Basic information for Ready API (SoapUI): API Testing

Now as it is mentioned in very first image, if we perform some security tests then it will ask about the things we need to add in security test as shown below:

Basic information for Ready API (SoapUI): API Testing

Once we click on Finish, it will show the result as below:

Basic information for Ready API (SoapUI): API Testing

We can get detailed report as well:

Basic information for Ready API (SoapUI): API Testing

I created one sample Web API on my machine which returns 2 values and I published the API project. When I gave localhost URL in ReadyAPI, It created one new project in ReadyApi and it gave the result as shown below:

Basic information for Ready API (SoapUI): API Testing

So if the API would be installed on IIS then also APIs can be tested using Ready Api.

As it works with GET, it can work with POST/PUT/DELETE as well:

Basic information for Ready API (SoapUI): API Testing

Virtual service:

SoapUI provides a feature called Virt in which we can create a virtual service, so if testers want to mock the service without calling the actual REST API, it is possible with SoapUI. We need to create a new Virt as below:

Basic information for Ready API (SoapUI): API Testing

This Virt can behave as GET/POST etc as per your need and Once the Virt is created, we can even host that Virt on localhost by applying some settings.

To conclude this, if we want to test the scenario of a user account creation, we will create one project and in that there would be a test suite named “Test account creation” and in that suite we can add different test cases as shown below:

Basic information for Ready API (SoapUI): API Testing

Try it out.

 

Advertisements

寒雨博客,一个正式而不失优雅的博客
寒雨博客 » Basic information for Ready API (SoapUI): API Testing