Import swagger definition to SoapUI community edit

2019-04-04 13:33发布

问题:

I'm playing around with SoapUI (the free/open source edition) to see if it could be useful at work for the kind of extensive API testing we often do because right now we do most of our testing right on the swagger-ui page in each server/app and some of the features like automating some test cases could be really handy (among many others).

The problem I have is that I can't figure out how to import all the endpoints into SoapUI without having to manually create them one by one. I see there's an option to import from swagger but I can't seem to get it to work and googling around hasn't helped me so far.

  1. Is it possible to do that using the free version? I know REST discovery is a pro feature but it isn't what I'm looking for.
  2. Could anyone tell me what the steps would be? I tried pointing it to the swagger-ui page but that didn't do anything. I have access to the application source code (written in java+spring) would the swagger definition I need to import be located somewhere there? Poked around but I'm probably not looking in the right place.

I know I'm stuck in something that's probably ridiculously easy but I would appreciate any help with this.

Edit: This is using SoapUI Version 5.2.1

回答1:

Here are the steps you can follow in order to import the swagger definition into SoapUI, and make sure swagger definition is in hand or its url(basically a json ).

Pre-condition is that, swagger plugin is installed for SoapUI as shown here

  1. Create an empty project using File -> Create Empty Project menu options.
  2. Right click on the project created in above step.
  3. You should be able to see an option like Import Swagger as shown below.
  4. It will show a dialog where you can provide the swagger definition url.

You are done. All the resources and its methods should appear in your project.

If you are not able to see the Import Swagger option in the right click context, then plugin is not installed. Am sure it is installed if you have installed SoapUI-5.2.1

Update

Adding some public swagger definition, so that it would be handy for someone wish to try one.

Here is the pet store swagger definition v2.0 by SwaggerUI

You would see something like below once swagger definition is imported.



回答2:

I had the same problem.

In my case I installed the SoapUI without the option "Source".

You need to reinstall the application with this option.