Forum Discussion

Lokesh777's avatar
Lokesh777
Occasional Contributor
5 years ago
Solved

Retrieve authorization method in Auth Manager using Java Script assertion in Ready API

I need to retrieve the authorization method created in Auth Manager using Java Script Assertion in Ready API . Is there any solution ?
  • NBorovykh's avatar
    NBorovykh
    5 years ago

    Hi Lokesh777,

     

    This JavaScript code retrieves the auth method set for your project in the current environment and posts its name to the log:

    var auth = context.testCase.testSuite.project.getAuthProfileHolder().getAuthProfile();
    log.info(auth);

    A video showing how it works for me is attached. 

     

    I hope this is what you were looking for.