-1

I need assistance on following:

Using the HP's UFT or SoAPUI

  • Go to website (GET)
  • Sign in with authorization code and username/pwd (POST)
  • system generates a bearer token
  • Now go ahead and to other activities with this token (involves PUT) here.

Regards

nobody
  • 19,814
  • 17
  • 56
  • 77
kneupane
  • 3
  • 2

1 Answers1

0

In case you were asking how to insert the HTTP header 'Authorization' into your request:

For UFT:

1 - select your resquest 2 - Properties / Event / BeforeApplyProtocolSettings / New Handler 3 - public void StServiceCallActivity4_OnBeforeApplyProtocolSettings(object sender, HP.ST.Ext.WebServicesActivities.Models.StChannelsBindingStack args) { this.StServiceCallActivity4.HttpRequestHeaders.Add("Authorization","Basic d29tZXVzZXI6c29tZXBhc3M="); }

// Warning StServiceCallActivity4 have to match the Service activity call you are modifying with this event. 4 - Reproduce for each request (I did not find a better solution for this unfortunatly)

Bonus: From there you can always get the user / password from input parameter and encode the String in the method.

For Soap UI:

1 - Open your request 2 - On the bottom tab called 'Header': Add a Header called 'Authorization' with the value 'Basic d29tZXVzZXI6c29tZXBhc3M='

Hope it's what you need

  • That works for SOAP WebServices. I am not seeing BeforeApplyProtocolSettings for REST – kneupane Oct 30 '14 at 13:14
  • Hum, here is something that could help you: http://www.sqaforums.com/forums/hp-unified-functional-testing-uft-mercury-quicktest-pro-qtp/148817-web-services-cant-quite-get-there.html – François Gautier Nov 06 '14 at 13:13