web element Is it possible to choose a "random" text using div tags from a dropdown? I am attempting to pick any random country from the dropdown with the following code in Playwright:
const selectCountry = this.page.locator('<this locator>')
const randomCountry = faker.location.country()
await selectCountry.fill(randomCountry)
Sometimes it types, but it doesn't retain the value after submitting. I suspect that it needs to actively select the value from the dropdown using the mouse pointer or arrow keys, but I am uncertain how to do that randomly.
I have also tried the recommendations provided here: Playwright - select random option, without success. Any assistance would be greatly appreciated. Thank you very much.