Here is the HTML code:
<input class="select-dropdown dropdown-trigger" type="text" readonly="true" data-target="select-options-6a055dc1-379b-0ad4-c88a-bfd07a8356b4" style="" xpath="1">
<ul id="select-options-6a055dc1-379b-0ad4-c88a-bfd07a8356b4" class="dropdown-content select-dropdown" tabindex="0" style="" xpath="1"><li class="disabled" id="select-options-6a055dc1-379b-0ad4-c88a-bfd07a8356b40" tabindex="0"><span>Choose</span></li><li id="select-options-6a055dc1-379b-0ad4-c88a-bfd07a8356b41" tabindex="0"><span>Marriage</span></li><li id="select-options-6a055dc1-379b-0ad4-c88a-bfd07a8356b42" tabindex="0" class="selected"><span>Home Renovation</span></li><li id="select-options-6a055dc1-379b-0ad4-c88a-bfd07a8356b43" tabindex="0"><span>Holiday Planning</span></li><li id="select-options-6a055dc1-379b-0ad4-c88a-bfd07a8356b44" tabindex="0"><span>Debt Refinancing</span></li><li id="select-options-6a055dc1-379b-0ad4-c88a-bfd07a8356b45" tabindex="0"><span>Medical Emergency</span></li><li id="select-options-6a055dc1-379b-0ad4-c88a-bfd07a8356b46" tabindex="0"><span>Others</span></li></ul>
<svg class="caret" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" xpath="1"><path d="M7 10l5 5 5-5z"></path><path d="M0 0h24v24H0z" fill="none"></path></svg>
<select class="" type="select" id="7" options="[object Object]" name="loan_purpose" tabindex="-1" xpath="1"><option value="" disabled="" selected="">Choose</option><option value="1">Marriage</option><option value="2">Home Renovation</option><option value="3">Holiday Planning</option><option value="4">Debt Refinancing</option><option value="5">Medical Emergency</option><option value="6">Others</option></select>
I could able to click on the dropdown list using the below code:
WebDriverWait(self.driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//input[@class='select-dropdown dropdown-trigger']"))).click()
self.driver.find_element_by_xpath("//select[@name='loan_purpose']/option[text()='Home Renovation']").click()
when I am trying to select the value using this code,getting the error message:
unable to select the value in the dropdown list,getting the following error message:
ElementNotInteractableException: Message: element not interactable: Element is not currently visible and may not be manipulated (Session info: chrome=77.0.3865.90)