Getting 422 error using k6 browser extension

Using the latest k6 browser extension

k6 v0.42.0 ((devel), go1.19.5, linux/amd64)
Extensions:
  github.com/grafana/xk6-browser v0.8.0, k6/x/browser [js]

I am getting the following error:

ERRO[0002] Failed to load resource: the server responded with a status of 422 ()  browser_source=network line_number=0 source=browser stacktrace="<nil>" url="https://xxxx/oauth/access_token"
INFO[0005] "Token status: credentials do not exist"      source=browser-console-api

How to resolve it?

Hi @kli,

Welcome to the forum.

I can help you more effectively if you could share your whole script.

From the error message, it seems like the error comes from the website or the API maybe the website is requesting.

Thanks.

Thanks for looking into this.

The scripts require the user to login and contain some sensitive information. Is there a way to share the script securely?

Hi @kli,

It seems from the error ("Token status: credentials do not exist") there is an issue on the website and it might expect you to set credentials. Since I can’t see the website or your script, I can’t tell you more at the moment :frowning:

Thanks.

Real browser works fine. again, if you can point me a secure location, I can upload my script with detail there to investigate

Hi @kli,

To expedite the resolution process, may I request for your assistance in providing a way for us to reproduce the problem? It would be helpful if you could create a sample HTML page and reproduce the problem locally, then share it with us. You can use our test site if it would be helpful. This will not only aid in resolving the problem but can also benefit other users who might be encountering similar issues.

Thank you!

Testing another site is not ideal. If you can share me your work email. I will message the login part to our site privately.

it’s really simple to repro this problem by using xk6brower extension - go to url and login

Like I said, I can send you the creds privately if you can share me your email to reach.

Thanks

Kang