Forum Discussion

vikititor's avatar
4 years ago

OAuth token value in AuthManager update form test (groovy)

Hello all,  I am using AuthManager in my project. But unfortunetally we implemented new dynamic part of the token. So I must refresh it after each new deployment. So for CI/CD is problem. In my Aut...
  • vikititor's avatar
    4 years ago

    def authContainer = testRunner.testCase.testSuite.project.OAuth2ProfileContainer
    def authProfile = authContainer.getProfileByName("admin_default")
    def oldToken = authProfile.getAccessToken(); oldToken;
    // updated
    authProfile.setAccessToken("some"); authProfile.getAccessToken();


    Can anybody tell me, why the helper dont know the setAccessToken method? When I am typing the code in groovy step?

    I just found it by my sugesstion.. But IT MUST be somewhere descripted.. Like in object mode.. but I did not found it there..

    It works.. but is stranght, that this was done by gessing...