Skip to content

when the page is switched, the page stops loading. #6773

@SnowStorm-L

Description

@SnowStorm-L

🐛 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions