cypress-chrome-recorder icon indicating copy to clipboard operation
cypress-chrome-recorder copied to clipboard

Simple selectbox isn't working

Open bernhardh opened this issue 2 years ago • 1 comments

Cypress Chrome Recorder doesn't work with simple selectboxes. Instead of using the select method, it uses the type method.

image

I have made just a very simple testpage, with an selectbox in it:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>HTML 5 Boilerplate</title>
  </head>
  <body>

        <select id="select">
                <option></option>
                <option>Option 1</option>
                <option>Option 2</option>
                <option>Option 3</option>
                <option>Option 4</option>
        </select>
  </body>
</html>

Then I created a recording where i selected some options and exported it to cypress:

describe("Selectbox", () => {
  it("tests Selectbox", () => {
    cy.viewport(1151, 1329);
    cy.visit("https://webcaravel.at/select.html");
    cy.get("#select").type("Option 1");
    cy.get("html").click();
    cy.get("#select").type("Option 3");
  });
});

When I run this test, the selectbox doesn't change the option at all.

bernhardh avatar Jul 25 '23 10:07 bernhardh

Hi @bernhardh , thank you submitting this issue. Unfortunately this issue will not be high enough priority for us to address in the near future. If you (or others int he community) are able to submit a fix for this issue we would happily accept a PR addressing this issue.

nagash77 avatar Aug 04 '23 12:08 nagash77