I've been trying to enter to an iframe and write text in a search bar ( tag) in Safari:
I can't post the html because it's huge and it isn't mine but this is the iframe code:
<iframe frameborder="0" id="contentIFrame0" name="contentIFrame0" title="Área de contenido" style="border: 0px none; overflow: hidden; position: absolute; left: 0px; right: 0px; height: 100%; width: 100%; visibility: visible; display: block;"> (...Content of the iframe...) </iframe>
Here is python code:
wait.until(ec.frame_to_be_available_and_switch_to_it((By.XPATH, '//*[@id="contentIFrame0"]')))
chk_elem = wait.until(ec.visibility_of_element_located((By.XPATH, '//*[@id="2crmGrid_findCriteria"]')))
act = ActionChains(driver)
act.move_to_element(chk_elem)
act.send_keys('Search input', Keys.ENTER).perform()
but I always get this Exception: "selenium.common.exceptions.NoSuchFrameException: Message:".
I've been watching some tutorials and even reading the official documentation and I guess my code is Ok. Why it isn't working?
PD: There aren't another iframe before the iframe that I posted and XPATHs are well written. I don't know if it is relevant but we are talking about a web site of dynamics services from microsoft, just in case.