Skip to content

click fails when clicking on button in iframe due to CORS #4980

@ankur22

Description

@ankur22

Brief summary

It's possible to retrieve the iframe, the frameContent and even details of the button that we want to click on such as the textContent.

What fails is the click itself. The browser module isn't calculating the coordinates correctly relative to the main page, and instead it is creating them relative to the iframe only. The reason behind this is due to CORS. When we try to calculate the relative position of a button in an iframe, and the iframe isn't from the same origin of the main frame (page), it hits a CORS issue, since browser do not let frames from different origins to inspect each other.

k6 version

NA

OS

NA

Docker version and image (if applicable)

No response

Steps to reproduce the problem

TBD

Expected behaviour

click clicks on the button in the iframe.

Actual behaviour

Nothing happens, and actually an error is being suppressed somewhere when the click fails.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions