17

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

Martin of Hessle
  • 394
  • 3
  • 12
Laucien
  • 511
  • 2
  • 5
  • 17

2 Answers2

30

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. Importing Swagger
  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.

After the import of swagger definition is successful

Rao
  • 20,781
  • 11
  • 57
  • 77
  • SoapUI only imports Swagger files in json format, not Yaml. I used swagger-editor to import YAML and download JSON. – intotecho Jul 28 '17 at 02:51
  • @intotecho Are you sure? I've successfully imported YAML file (SoapUI 5.3.0), just needed to specify a path to file and a correct mime type ("application/yaml"). – naXa stands with Ukraine Sep 29 '17 at 08:27
  • It works if the swagger file extension is .yaml, but fails with .yml, which is sometimes the file extension you get when downloading swagger definition files – lweingart Apr 18 '18 at 12:32
  • What if the URL requires basic authentication? I can't seem to find a way to provide the credential to the "import swagger" option – Rohan Nov 06 '18 at 06:40
  • Hmm. Not sure if SmartBear has this case consider. Do you want alternative? Or you know already? – Rao Nov 06 '18 at 18:27
  • It doesn't work with latest 5.5, soapUI import methods and HTTP codes, but no body request parameters for PUT, POST methods – user311174 Jan 23 '20 at 11:45
  • 2
    @user311174, Ok things might have changed over the years in the tools with emerging needs. you may consider adding new question. By the way, free version does not support OAI 3.0. Hope you are using swagger 3.0, the tool does not support. – Rao Jan 23 '20 at 12:47
  • Thanks, the same problem arises in ReadyApi, i was in a hurry and finally used the https://editor.swagger.io/ editor, and pasted the content for sample requests – user311174 Jan 23 '20 at 14:45
  • @user311174, no worries. thanks for getting back by checking. I believe it is time for the tool to support swagger 3.0. Raise a support request with `SmartBear`. – Rao Jan 23 '20 at 16:44
8

I had the same problem.

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

Windows SoapUI option installation

You need to reinstall the application with this option.

naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259
Roberto Ramos
  • 553
  • 6
  • 16
  • Additionally: If you install it with a different user than the user you are using SoapUI with, you need to copy the plugin from that user to your directory: C:\Users\\.soapuios\plugins to C:\Users\\.soapuios\plugins – guerda Mar 07 '18 at 12:10
  • weird thing is that the option to import swagger files just shows up when starting SoapUI as root... didn't install any plugin yet, so not sure why this might be happening.... – silveiralexf Sep 28 '18 at 10:14