I'm writing a script using Selenium's Python implementation. When the script reaches this line:
driver.find_element_by_id('ctl00_Top_EntryButton').click()
The page loads a modal dialog but the python script hangs on the command. I debugged it a little and it seems its stuck on a while loop in socket.py, I guess it's waiting for some input.
Does anyone have ideas on what's wrong?
EDIT
I'm adding some more code for clarity:
driver = webdriver.Firefox()
driver.get("https://www.somesite.com")
driver.switch_to_frame("mainIFrame")
driver.find_element_by_id('ctl00_Top_EntryButton').click()
driver.find_element_by_id('ctl00_Top_EntryButton').click()bydriver.execute_script("setTimeout(function () { document.querySelector(\"#ctl00_Top_EntryButton\").click() }, 1000);"). This does the same but by injected JavaScript. Because it delay execution by 1 sec, and JS execution as asynchronous, rember to add sleep call. In my case problem was caused because the clicked button closed window and Selenium was waiting for page load after click (and some other actions). Wait for page load after window close cased infinite loop in selenium "core".