Here are the elements below:
<gender-input> <label>Gender Preference</label> <select class="form-select" required="" id="gender" autocomplete="sex"> <option selected="" disabled="" value="">Select a gender preference</option> <option value="male">Male</option> <option value="female">Female</option> <option> value="other">Non-binary/non-conforming</option> </select> </gender-input>and here my line for tests to select from dropdown: await page.locator('select#gender.form-select').selectOption({label: 'Male'});
I keep getting "element is not visible - waiting..."
I have exhausted multiple ways to select, including using a click and it did not help
This thread is trying to answer question "How can I select an option from a dropdown menu in my code without getting an 'element is not visible - waiting...' error?"
Thanks for you response... I have tried this before and did adgian and still get the error: TimeoutError: locator.click: Timeout 20000ms exceeded. =========================== logs =========================== waiting for locator('option[value="male"]') locator resolved to <option value="male">…</option> attempting click action waiting for element to be visible, enabled and stable element is not visible - waiting... ============================================================
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].