I am having trouble selecting an option in popup-bubble (sorry I am not quite sure how to determine what type of popup it is) I dont really mind what option I choose, I just need to click one of them. This is how it looks in code:
<div data-v-d4e6e290="" class="f_input-optionsWrapper js_optionsWrapper" style=""><div data-v-d4e6e290="" class="f_input-options"><div data-v-d4e6e290="" class="f_input-header js_header">Oslovení</div> <div data-v-d4e6e290="" class="f_input-options-content"><div class="f_customScroll" data-v-d4e6e290="" style="max-height: 883px;"><div data-v-68c7351e="" class="f_input-option"><div data-v-68c7351e="" data-testid="Pan" class="f_input-option-text xh-highlight">
Pan
</div></div><div data-v-68c7351e="" class="f_input-option"><div data-v-68c7351e="" data-testid="Paní" class="f_input-option-text">
Paní
</div></div></div> <div data-v-d4e6e290="" class="f_input-footer js_footer"><!----> <span data-v-d4e6e290="" class="f_button f_button--common f_button_set--small">Potvrdit</span></div></div></div></div>
I tried to locate the elements multiple ways, the first problem is that it always detects two results. The popup is to choose the sex of the traveler and I have two travelers so my guess is it detects the second popup for second traveler as well.
My tries to locate:
volbaOsloveni = driver.find_elements_by_xpath("//*[@class='f_input-optionsWrapper js_optionsWrapper'] //*[@class='f_input-option-text']")
volbaOsloveni2 = driver.find_elements_by_xpath("//*[@data-testid='Pan']")
volbaOsloveni3 = driver.find_element_by_xpath("//*[@class='f_customScroll'] //*[@data-testid='Pan']")
All of these gets me two results which I guess should work. Whenever I try to click the element selenium either says that it didnt locate the element or it just passes it acting as it already clicked the element and the script continues.
Click tries:
volbaOsloveni[0].click()
driver.execute_script("arguments[0].click();", volbaOsloveni3)
volbaOsloveni2[1].click()
I tried the find_elementS method so I am getting more of the results so that is why I tried to click on the first element with [0] and so on. Neither the execute_script or the click() does the job and I am kinda desperate what to do now.
Can anyone help me with that please? Would be greatly appreciated! Thanks in advance