So I'm using selenium to navigate through a web page. When I click a button, a modal dialog appears, like a new window. I can find the elements inside it, but when I try to click them, the error presented occurs:
I've seen switch to and iframes, but none of them seems to match my case as there is no other windows nor iframes.
-- driver.find_element_by_id("id-terr-cod").click()
selenium.common.exceptions.ElementNotInteractableException: Message: Element <input id="id-terr-cod" name="check-terr-cod" type="checkbox"> could not be scrolled into view
How do I "scroll into view" in order to be able to do this? I have tried switch_to.alert and it indicates that no alert is present (I've seen in other places that modal dialogs are alert)
Edit: The problem is, is that scroll into view seems to assume you can't "view" the dialog, as I commented on @Prophet though, I can see it. It's the checkbox element on this page when you click "Download" on the bottom https://sidra.ibge.gov.br/tabela/5457
def sidraGet(table_code, variables, panels : dict, years=()):
driver = webdriver.Firefox()
driver.get("https://sidra.ibge.gov.br/tabela/"+str(table_code))
driver.maximize_window()
time.sleep(10)
driver.find_element_by_id("botao-downloads").click()
time.sleep(3)
terrBox = driver.find_element_by_id("id-terr-cod")
print(driver.execute_script("arguments[0].scrollIntoView()", terrBox))
actions = ActionChains(driver)
actions.move_to_element(terrBox)
actions.click()
actions.perform()