2

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

Rao
  • 20,781
  • 11
  • 57
  • 77
Fueled By Coffee
  • 2,467
  • 7
  • 29
  • 43
  • Is that a `soap request test step` headers? Because, I could not find such buttons? Are you using free version? It is also possible to do the same using `groovy script`. – Rao Jan 05 '17 at 00:42
  • No sorry, it's a REST request test step. I am using the pro version, and yeah I'm aware groovy could do it but I'm just meaning for like cloning test cases. When theyre cloned, the headers don't copy over – Fueled By Coffee Jan 05 '17 at 00:52
  • Ok thank you for clarifications. Do not aware that `headers` were not cloned, you may report the issue with SmartBear support if you wish. Even then, just adding the headers of one step to other steps can be done using groovy if you want to proceed. Are you open to that? – Rao Jan 05 '17 at 01:00
  • Yeah I'll look into that writing a universal Groovy script for that in the mean time. Thanks – Fueled By Coffee Jan 05 '17 at 01:02

2 Answers2

0

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.

Ashwin
  • 41
  • 1
  • 5
0

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
Marecz
  • 11
  • 1
  • 4