gpt4 book ai didi

java - 使用 WebDriver 以私有(private)模式启动 Safari

转载 作者:行者123 更新时间:2023-12-02 02:17:16 25 4
gpt4 key购买 nike

我想立即以私密模式启动浏览器。

WebDriver driver = new SafariDriver ();

我尝试设置:首选项 -> 常规 -> Safari 打开方式:新的私有(private)窗口

有可能支持 Safari 吗?我知道它在其他浏览器上的工作原理。

最佳答案

根据最新SafariDriver documentation ,实际上没有必要启动显式的隐私浏览窗口,因为自动 session 总是从头开始:

Test execution is confined to special automation windows that are isolated from normal browsing windows, user settings, and preferences. You can recognize these windows by their orange Smart Search field. Like a private browsing session, an automation session always starts from a clean slate. It can’t access Safari’s browsing history, AutoFill data, or other sensitive information available in a normal browsing session. These isolated sessions also help to ensure that tests are unaffected by a previous test session’s persistent state.

这也与我最近的 SafariDriver 实现的经验一致。

关于java - 使用 WebDriver 以私有(private)模式启动 Safari,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57294932/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com