Linked Questions

Popular Questions

How do I get Cypress just to process the visible element?

Asked by At

I am trying to use this one element:

cy.get('[data-cy-component=single-picker-search] input').type('Live');

When I run it, it tells me there are more than 1 of them, so it can't do it.

I tried adding { force: true } - that made no difference.

I tried looking at each element, but this fails if the element is not visible:

cy.get(singlePickerSearch).each(($el) => {
          cy.wrap($el)
            .type('Live' + '{enter}');
        });

How do I make it just type where the element is visible? I do not want it to fail on this.

Related Questions