Select Dropdown by Value
Playwright uses locator.selectOption(value) for <select> elements. You can pass the option's value attribute.
On the Dropdowns page, the single-select dropdown (ID: singleSelect) has options: Java, Python, JavaScript, C#, Ruby.
Task:
- Navigate to
https://testkru.com/Elements/Dropdowns - Select the option with value
python - Print the visible text of the selected option
Expected output:
Selected: Python
TestKru