selenium: IEDriverServer hangs when getting cookies on newly opened window
Meta -
OS:
Windows 10 (64-bit) and Windows Server 2012 R2 (64-bit)
Selenium Version:
3.4.0
Browser:
Internet Explorer
Browser Version:
- Windows 10: 11.413.15063.0
(both 32-bit and 64-bit) - Windows Server 2012 R2: 11.0.9600.18538
(both 32-bit and 64-bit)
Expected Behavior -
don’t hang up when getting cookies on newly opened window.
Actual Behavior -
hang up when getting cookies on newly opened window.
Steps to reproduce -
- Create WebDriver instance.
- open first window by e.g. driver.get()
- open another window by e.g. executing JavaScript “window.open()”.
- switch to newly opened windw.
- try to get cookies.
following Java and python code my reproduce this issue. (python version needs remote IE webdriver stup)
Java:
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class GetCookiesOnAnotherWindow {
public static void main (String[] args) {
WebDriver driver = new InternetExplorerDriver();
try {
driver.get("about:blank");
((JavascriptExecutor) driver).executeScript("window.open('about:blank', 'another_window')");
driver.switchTo().window("another_window");
driver.manage().getCookies(); // <- IE Driver hangs here
} finally {
driver.quit();
}
}
}
Python:
# coding=utf-8
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
try:
caps = DesiredCapabilities.INTERNETEXPLORER.copy()
driver = webdriver.Remote(desired_capabilities=caps)
driver.get("about:blank")
driver.execute_script("window.open('about:blank','another_window')")
driver.switch_to.window('another_window')
cookies = driver.get_cookies() # Hang up HERE.
except Exception:
pass
finally:
driver.quit()
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (6 by maintainers)
I still see this. Is this known and open ?
any solution? I am getting the same issue