jeudi 11 août 2022

Select random option from dropdown in cypress

i run a script and want to select the random option on every run.

type Url = string
       it('random_option', () => {
       cy.visit(url)
  const count = $options.length
    const random_option = Math.floor(Math.random() * count)
cy.get('selector').select (random_option);

        })



Aucun commentaire:

Enregistrer un commentaire