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

The selectOption method on frame only selects one option #470

Open
ankur22 opened this issue Jul 27, 2022 · 0 comments
Open

The selectOption method on frame only selects one option #470

ankur22 opened this issue Jul 27, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest Suitable for Hacktoberfest 🎉

Comments

@ankur22
Copy link
Collaborator

ankur22 commented Jul 27, 2022

Tested against: dbede12

The selectOption method on locator only selects one option.

In the below code it works against localhost:8080, which is a test server that can be found here with instructions on how to run it locally: https://github.com/ankur22/testserver.

import { sleep } from 'k6';
import launcher from 'k6/x/browser';

export default function () {
  const browser = launcher.launch('chromium', {
    headless: false,
  });
  const context = browser.newContext();
  const page = context.newPage();
  const res = page.goto('http://localhost:8080/other');
  const l = page.locator('#cars-options');
  sleep(1);
  l.selectOption(['land rover', 'ferrari']);

  sleep(10);
  browser.close();
}

I was expecting it to select two options on the test page, but it only selected the first one.

@ankur22 ankur22 added the bug Something isn't working label Jul 27, 2022
@inancgumus inancgumus changed the title The selectOption method on locator only selects one option The selectOption method on frame only selects one option Oct 12, 2023
@inancgumus inancgumus added hacktoberfest Suitable for Hacktoberfest 🎉 good first issue Good for newcomers labels Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers hacktoberfest Suitable for Hacktoberfest 🎉
Projects
None yet
Development

No branches or pull requests

2 participants