I am trying to assign a user to a specific Mantis Bug using Python and Selenium. My code (below) when executed it always picks the 1st record (Alfred Kan) and not the one I manually select in my code (Bryan Lu). My code is below:
driver.get("https://mantis-dev.{company}.com/bug_view_page.php?bug_id=0794544")
form = driver.find_element(By.XPATH, '//form[@action="bug_assign.php"]')
dropdown = WebDriverWait(driver, 10).until(
EC.element_to_be_clickable((By.CSS_SELECTOR, '.chosen-single'))
)
dropdown.click()
driver.execute_script("arguments[0].click();", WebDriverWait(driver, 10).until
(EC.element_to_be_clickable((By.XPATH, '//li[text()="Bryan Lu (bryanlu)"]'))))
assign_button = driver.find_element(By.XPATH, '//input[@type="submit" and @value="Assign To:"]')
assign_button.click()
driver.quit()
This is the part of the Mantis Bug page that shows the dropdown
and this is the code-behind
I would appreciate any help, thank you

