I'm using the code below to replicate the action shown below. The script is able to select the field that has the text "operator maintenance" and click it using action chains, however, it only goes to the appropriate next page with the Employee ID field randomly.
ieOptions = webdriver.IeOptions()
ieOptions.add_additional_option("ie.edgechromium", True)
ieOptions.add_additional_option("ie.edgepath",'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe')
ieOptions.ignore_zoom_level = True
driver = webdriver.Ie(executable_path='C:\Program Files (x86)\IEDriverServer.exe', options=ieOptions)
for key in parks:
if PK == key:
driver.get(parks[key][0])
PW = parks[key][1]
# switch to selected iframe
driver.switch_to.frame('MWFApplicationFrame')
# Now continue with login process
UserName = driver.find_element(By.ID, "UserName")
UserName.send_keys(ID)
PassWord = driver.find_element(By.ID, "Password")
PassWord.send_keys(PW)
login = driver.find_element(By.ID, "Login")
login.click()
# switch to selected iframe
driver.switch_to.default_content()
emp = driver.find_element(By.ID, "menu").click()
driver.switch_to.frame('MWFPopupMenuFrame')
hoverable = driver.find_element(By.CLASS_NAME, "popupMenuCell")
ActionChains(driver)\
.move_to_element(hoverable)\
.click(hoverable)\
.perform()
Manual flow:
Actual issue with script:
Html of webpage shown: