Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

269
Views
playwright locator.selectOption usando una matriz de valores

Leí la documentación del dramaturgo sobre locator.selectOption , sin embargo, parece un poco incompleto ya que todavía tengo la siguiente pregunta, ¿qué label o value usa selectOption cuando recibe una matriz como su parámetro?

más información:

La página da los siguientes ejemplos:

 // single selection matching the value element.selectOption('blue'); // single selection matching the label element.selectOption({ label: 'Blue' }); // multiple selection element.selectOption(['red', 'green', 'blue']);

Pero, supongamos que mi selección es:

 <select id="state" name="state"> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> ... </select>

¿Funcionaría lo siguiente? page.locator('#state').selectOption([ "Alabama", "Arkansas" ]);

O tendría que hacer: page.locator('#state').selectOption([ "AL", "AR" ]);

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Los documentos dicen String values are equivalent to {value:'string'} , por lo que sería el equivalente a page.locator('#state').selectOption([ "AL", "AR" ]);

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!