Skip to content
CodeKruPro

Select Dropdown by Label

26/70

Select Dropdown by Label

You can also select by the visible label text using selectOption({ label: 'text' }).

Task:

  1. Navigate to https://testkru.com/Elements/Dropdowns
  2. Select the option with label "JavaScript" from #singleSelect
  3. Print the selected value attribute
  4. Select the option with label "Ruby"
  5. Print the selected value attribute

Expected output:

First selection value: javascript
Second selection value: ruby