-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
🐛 Bug Report
Environment
OS: OSX
Browser: Chrome
Browser version: Version 71.0.3578.98 (Official Build) (64-bit)
Language Bindings version: Python 3.7
Selenium version 3.13.0
Question
I have already raised this issue in stackoverflow https://stackoverflow.com/questions/53848923/selenium-webdriver-stop-loading-when-switching-pages
gif link https://user-images.githubusercontent.com/19711721/50255923-e8aa6a80-042e-11e9-9b05-82c07829c041.gif to the code and operation of the demo project
Test code:
url = 'https://www.google.com/
wait = WebDriverWait(driver, 10)
driver.get(url)
wait.until(EC.visibility_of_element_located((By.XPATH, '//*[@id="gsr"]')))
open_youtube_js = 'window.open("https://www.youtube.com")' driver.execute_script(open_youtube_js)
driver.switch_to.window(driver.window_handles[-1])
At this time, when I perform any operation(for example print(driver.current_url)
or WebDriverWait
), it will cause second page stop loading.
after running the line of switch to window, any subsequent actions will cause the page to stop loading(gif image has effect view).
The same code, I tried to work properly in Safari, This problem seems to only appear in Chrome.