Is there any way in which I can generate access token to test oauth for logging in with gmail?
I have created a google app, and got the client and secret ids.
If you just want to test out an API with any oauth token as stated in the question title (not necessarily one acquired from a test user login flow), then you could make curl calls using a service account and the oauth2l utility as outlined in GCP docs here:
https://cloud.google.com/service-usage/docs/getting-started
Similarly, you can grant permissions to the service account the same as you would a regular test user.