Select Options By keyword not selecting the option

Hello all,
I am having difficulties trying to select an option from a dropdown using the “Select Options By” keyword.

Using “Get Select Options” with the dropdown locator successfully retrieves the dropdown options, including their labels, through which I would like to select an item.

Using “Select Options By”, with option label and provided string, returns the error:

Error: locator.selectOption: Timeout 10000ms exceeded.
Call log:
  [2m- waiting for frameLocator('//iframe').locator('.device-selectbox select')[22m
[2m  -   locator resolved to <select tm-element="true" class="selectpicker deselectab…>…</select>[22m
[2m  -   selecting specified option(s)[22m
[2m  -     element is not visible - waiting...[22m

Tip: Use "Set Browser Timeout" for increasing the timeout or double check your locator as the targeted element(s) couldn't be found.

Does anyone have a suggestions what I may be doing wrong?
Thank you and best regards,
A

-     element is not visible - waiting...

Random comment: Click or set focus to the dropdown container so that the options become visible ?

1 Like

Hi @rasjani , thank you for your response.

The dropdown is clicked and opened, making options visible, before the selection keyword. Unfortunately that doesn’t seem to have an effect.

@Aero10 Can you share the HTML of the page you’re interacting with?

Hi Falcon, I can provide a snippet:

And the locator I am using to access the items is:
.color-selectbox select

Before that I click the outher selectbox for the list of items in dropdown to open.

Thank you.

@Aero10 I see in the HTML code that the style attribute of the select element is "display: none;" In other words the select element is not visible, so that’s probably causing the error. For the keyword Get Select Options it doesn’t matter if the HTML element is visible or not.

3 Likes

Thank you very much @falcon030
I would never be able to figure that on my own.

1 Like