Created
August 30, 2017 21:33
-
-
Save mpasternak/f9e1e992cefd7bc12d81269430d31e13 to your computer and use it in GitHub Desktop.
selenium/splinter/django close all popups, remove "form changed" warning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# # Jeżeli poprzednia sesja sobie wisi np. na stronie wymagającej potwierdzenia | |
# # jej opuszczenia, to będzie problem, stąd: | |
# browser.execute_script("window.onbeforeunload = function() {};") | |
# | |
# def close_all_popups(driver): | |
# for h in driver.window_handles[1:]: | |
# driver.switch_to_window(h) | |
# driver.close() | |
# driver.switch_to_window(driver.window_handles[0]) | |
# | |
# close_all_popups(browser.driver) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment