Skip to content

Getting error when trying to use "WaitForURL" inside describe function in browser based script #5507

@indhuhm-star

Description

@indhuhm-star

Brief summary

We are observing error when we are trying to use WaitForURL inside the describe function in one of the browser based script.

k6 version

1.4.0

OS

Windows10

Docker version and image (if applicable)

No response

Steps to reproduce the problem

We have recorded a simple flow from one of our application.Since,application is very slow ,login is taking a lot of time and it will be keep spinning and then loads the page.

So we have used page.waitForURL('our_url',{ timeout:180000}); inside describe function after clicking on SignIn button.

code snippet:

describe('SignIn Button' , async () => {
page.getByRole("button",{name: "SignIn",exact.true }).click();
page.waitForURL('our_url',{ timeout:180000});
});

Reason for using describe function is to get the action(Transaction) name in Grafana dashboard.

But we are getting below error when we tried executing the script

ERRO[0033] error on evaluating window.k6SpanId: evaluating JS in global context: context canceled category="FrameSession:onFrameNavigated" elapsed="0 ms" source=browser
ERRO[0033] Uncaught (in promise) clicking on "internal:role=button[name='Sign in'i]": timed out after 30s executor=shared-iterations scenario=ui

Expected behaviour

We should not get any error and the transaction name mentioned inside describe () should be show in Grafana

Actual behaviour

Getting below error when we tried executing the script

ERRO[0033] error on evaluating window.k6SpanId: evaluating JS in global context: context canceled category="FrameSession:onFrameNavigated" elapsed="0 ms" source=browser
ERRO[0033] Uncaught (in promise) clicking on "internal:role=button[name='Sign in'i]": timed out after 30s executor=shared-iterations scenario=ui

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions