The script specified in a field will run when the page is open in the browser. You can find an example of this script in the OAuth Automation Example topic.
|Note:||During the authorization process, the pages are called in the specified order. ReadyAPI neither recognizes the called pages nor does it interact with them. To ensure that you are on a proper page, use scripts.|
The Automated Token editor becomes available on the Automation Scripts tab after you select an OAuth 2.0 profile in the Auth Repository:
In requests, you can access the Automated Token editor from the Auth inspector:
Select an OAuth 2.0 Profile.
Click Get Token.
By default, ReadyAPI does not check if a token has expired even if automated retrieval is enabled. You can use Groovy scripts to check if a token is up-to-date and retrieve a new token, if necessary. For this purpose, call the
requestAccessToken method and specify the
consoleMode parameter as described in the Automating Token Retrieval Example topic.
Additionally, on headless machines where the browser window is inaccessible, you can use this approach to retrieve a token.