Selecting a Drop-Down Menu Value Using Its XPath
This approach is straightforward and easy to understand. It involves finding the drop-down menu element, and then using the 'selectByVisibleText' method to select the desired option.
// Use the span text instead of anchor title const dropdown = await browser.$("//option[@lang='es']") await dropdown.click()
Here is an example test that uses the above code snippet.