【发布时间】:2018-11-17 22:38:03
【问题描述】:
假设我有 HTML:
<select name="subject" data-testid="contact-us-subject-field">
<option value="What is this regarding?">What is this regarding?</option>
<option value="Partnerships">Partnerships</option>
<option value="Careers">Careers</option>
<option value="Press">Press</option>
<option value="Other">Other</option>
</select>
选择具有已知值的选项,例如“职业”,如下所示:
cy.get('[data-testid="contact-us-subject-field"]').select('Careers');
如何选择此字段中的第 n 个选项,无论其值如何?
【问题讨论】:
标签: cypress