Home > Back-end >  Helium select items from drop down but another element obscures it
Helium select items from drop down but another element obscures it

Time:04-15

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

<select  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  > 
is not clickable at point (1012,654) 
    because another element 
    <div id="cookie-notification" 
    > 
    obscures it

Any ideas how do i circumvent this please ?

CodePudding user response:

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")
  • Related