I've been going through a few other pages on stackoverflow but failed to find a solution that solves my problem now. I am trying to use selenium (python) to automate a work process. It involves logging in the web portal, selecting a few search criteria, and then download the files. I am stuck with the selection part. I can click on other dropdown menu on the same page by not this one:
<select id="fMain:j_id162:rangeLineIdlocation1" name="fMain:j_id162:rangeLineIdlocation1" size="1" onchange="if(MMIS.Event.delay(this, arguments)) return true;A4J.AJAX.Submit('fMain',event,{'similarityGroupingId':'fMain:j_id162:j_id165','containerId':'fMain:j_id161','parameters':{'fMain:j_id162:j_id165':'fMain:j_id162:j_id165'} } )">
<option value=" "> </option>
<option value="10000109">AEL</option>
<option value="10000123">AEL+TCL</option>
</select>
I have tried using the method suggested in webdriver wait for ajax request in python
try:
element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, '//*[@id="fMain:j_id165:rangeLineIdlocation1"]')))
finally:
driver.find_element_by_xpath('//*[@id="fMain:j_id165:rangeLineIdlocation1"]/option[1]').click()
But it didn't work. I'm currently stuck in here now. Any clue? Thank you.