cancel
Showing results for 
Search instead for 
Did you mean: 

How to run test case without clicking Get Access Token button in the oauth2 authorization profile?

RB17
New Contributor

How to run test case without clicking Get Access Token button in the oauth2 authorization profile?

I created oauth2.0 code authorization grant profile to get access token from server for a REST request. But when I run test case without clicking "Get Access Token", test request throws error "Authentication failed". How can I automate test case with access token automatically

3 REPLIES 3
NBorovykh
Moderator

Re: How to run test case without clicking Get Access Token button in the oauth2 authorization profil

The process of automating token retrieval is described in this article: http://readyapi.smartbear.com/features/auth/types/oauth2/automate/start

Natalie
Customer Care Team

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
RB17
New Contributor

Re: How to run test case without clicking Get Access Token button in the oauth2 authorization profil

Hi Natalie,

 

The automation for entering browser credentials is already done. My question is I could not run the test case successfully without clicking on "Get access token" as shown in the screenshot

 

rlong98
Contributor

Re: How to run test case without clicking Get Access Token button in the oauth2 authorization profil

Agreed there is no solution that I have seen to automate the OAuth2 for Salesforce.  I tried all the so-called scripts and tricks that people have posted, even SmartBear solution of "Automation" in the OAuth2

 

WHAT HAPPENS:

1.  We have to click on "Auth" tab

2.  Click on "Get Access Token"

3.  Click on "Get Access Token" again

4.  Wait for SoapUI Browser to open to manually enter in the data and click "Login to Sandbox"

From there we now can run all the Requests

 

WHAT WE WANT:

a.  A solution for the Automation section in the "Get Access Token" section > Automation... Button where you can put a page 1 or page 2 script.  (none of the online examples worked for Salesforce)

or

b.  A Groovy way to do the above

or

c.  To Generalize - we don't want to have to manually do the above 1-4 steps

 

Thank you,

Rob Long

 

Anyone who finds this solution will be a hero!  No one has gotten this to work that I have searched.

New Here?
Join us and watch the welcome video:
Top Kudoed Authors