Helium select items from drop down but another element obscures it

482 views Asked by At

I have a drop down single select combo box. I can get a reference to that drop down via a CSS selector.

<select class="single-option-selector no-select selector single-option-selector-100" data-option="option1" id="product-select-template--15646112383191__main-option-0">
    <option value="15.0cm">15.0cm</option>
    <option value="23.0cm">23.0cm</option>
    <option value="25.0cm">25.0cm</option>
</select>

I see in Helium there is a select function which needs two parameter name and value.

How do i pass the name and value to this select function ?

I tried this

drop_down = [item.web_element for item in find_all(S(".single-option-selector-0"))][0]
select(drop_down, "23.0cm")

But i get a exception

    ElementClickInterceptedException: Message: Element 
    <select  class="single-option-selector no-select selector single-option-selector-0"> 
is not clickable at point (1012,654) 
    because another element 
    <div id="cookie-notification" 
    class="notification-main 
    notification-bottom-center-floating 
bottom-center-floating-small 
bottom-center-floating-default 
    has-default hasCloseIcon animate slide 
    enzuzo-shadow"> 
    obscures it

Any ideas how do i circumvent this please ?

1

There are 1 answers

8
undetected Selenium On BEST ANSWER

find_all() should return you all the desired WebElements and the subscription [0] should get ou the desired <select> element.

Effectively, your code block will be:

drop_down = find_all(S(".single-option-selector.no-select.selector.single-option-selector-100"))[0]
select(drop_down, "23.0cm")