Forum Discussion

mohan1's avatar
mohan1
Occasional Contributor
9 years ago

OAuth 2 Automation

Hi ! I have written the Automation scripts for OAuth 2.0 and when I click on run script , I am able to retrive token.

But my question is when I run a TestSuite the automatic retrieval of token is not happening. Is there a way to retrieve token when I run my testsuite from soapui ng pro.

3 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3

    Can you please add more details?
    1. What steps you followed to retrieve token succesfully?
    2. Do you have the same steps while running the testsuite as well? And not able retrieve?

    • mohan1's avatar
      mohan1
      Occasional Contributor

      Hi nmrao

       

      I have created a testsuite, and added test cases to it. For  particular requests I have created a common Ouath2 profile and have written the javascript code to automatically enter the google username and password. When I manually run the request , I need to get the access token by clicking " get access token " and run the script in automation. I get a access token retrived from server. Now what is question is when I launch TEST CASE RUNNER for the testsuite( after the token gets expired) it doesnt automatically retrive ( or access get token feature) and returning authorization required.

       

      Hope I am clear in explaining my problem. Thanks in advance for the help.

       

      Regards

      Mohan

      • mohan1's avatar
        mohan1
        Occasional Contributor

        when manually running testcase, is it every time we need to click on get access token ,even if we had written the automation part of getting access token?