ChromeDriver 没有打开 window yet test is still successful

ChromeDriver does not open a window yet test is still successful

我正在 运行 python 中 mac (El Capitan 10.11.5) 上的网络驱动程序测试。 我成功地 运行 使用 FirefoxDriver 进行了相同的测试(在 marionette 之前使用 FF 46)。 当我尝试使用 chromedriver 2.22 或 2.20 执行相同操作时,我得到了一个奇怪的结果 - 测试 运行s 并通过了,但我没有看到 window 这样做。

我不是要 运行 无头浏览器 - 我 想要 查看浏览器。

知道这里发生了什么吗?

我正在使用 python 2.7.11,硒 2.53.5。

浏览器确实打开了但是没有带入front/focus.

several workarounds,比如执行 window.focus(),但我更喜欢启动 alert() 并立即接受它:

driver.execute_script('alert("Focus window");'))
drivere.switch_to.alert.accept()