Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page.locator('a') not returning all links on page #900

Open
tmc opened this issue May 22, 2023 · 1 comment
Open

page.locator('a') not returning all links on page #900

tmc opened this issue May 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@tmc
Copy link
Contributor

tmc commented May 22, 2023

Brief summary

I have a situation where iterating over all 'a' tags and printing them produces a different smaller list when run in k6 vs directly in the browser window that is being controlled.

const printAllAnchors = async (page) => {
    const elements = await page.$$('a');
    console.log(elements.length);
    for (let i = 0; i < elements.length; i++) {
      const e = elements[i];
      const text = await e.textContent();
      console.log(text);
    }
}

In k6 this shows 14 anchor tags where as in the chrome tab/console I get 58 anchor tags.

xk6-browser version

v0.44.1

OS

macos

Chrome version

canary latest

Docker version and image (if applicable)

No response

Steps to reproduce the problem

A test that navigates to

https://xxx.sandbox.lightning.force.com/lightning/r/Contact/0037A00000oo1nuQAA/view

Expected behaviour

the list of anchor tags is complete.

Actual behaviour

This list of anchor tags is many fewer than a direct query in the same chrome tab.

@tmc tmc added the bug Something isn't working label May 22, 2023
@tmc
Copy link
Contributor Author

tmc commented May 22, 2023

I think this is a dupe of #475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant