Copy and Paste SoapUI Headers

2.5k views Asked by At

I have a large project with multiple test suites each of which contain multiple test cases. Many of the test cases contain endpoints that require similar headers (about 15 headers that require lots of manual typing to enter).

I see there is a button to import headers (highlighted in red), but I don't see any export options.

Is there a feature where you can copy and paste the headers rather than needing to re-type the headers each time?

headers section

2

There are 2 answers

0
Marecz On

I bypass it by doing the Parent Resource and Child Resource. But it can be also done on Method<>Request relation Level.

Short explanation.

In Parent Resource you set just part of URL then set in Resource Parameters the Header Parameters and put every header parameter as "Sets if parameter is required". From now every New Child Resource (under Parent) will have this parameters and values.

Long explanation with Example.

Let's set that we have URL that return all types of monkeys

\localhost\animal\monkey

  1. Create Empty Project (Animals)

  2. RMB on Project folder and click "New Rest Service from URL", from know you should see structure:

    Animals (Project)
    -\\localhost #Endpoint
    --monkey [\animal\monkey] #Resource
    ---monkey #Method
    ----Request 1
    
  3. Delete Method "monkey".

  4. Rename Resource "monkey" to "animal", from know i have structure

     Animals (Project)
     -\\localhost #Endpoint
     --animal [\animal\monkey] #Resource
     ---monkey #Method
     ----Request 1
    
  5. Open Resource "animal"

  6. Change Resource Path from \animal\monkey to \animal

  7. Creating Parameters with style Headers and set for every "Sets if parameter is required".

  8. Close Resource Window

  9. RMB on "animal" Resource and New Child Resource where i put path \monkey

From now all Child Resources will have same headers + if something go bug (with header) removing a parameter with from Child Resource will get this Parameter from Parent Resource (with same Value).

    Animals (Project)
    -\\localhost #Endpoint
    --animal [\animal] #Parent Resource
    ---monkey [\monkey] #Child Resource
    ----Method 1 #Method
    -----Request 1
0
Ashwin On

Select (click) the header name in another request and use Ctrl+C, this should copy the header from another request. To paste the header use the button paste from clipboard.