c# - selenium ie webdriver 没有我的用户配置文件

标签 c# asp.net selenium-webdriver

我需要实现 selenium Ie WebDriver,使其成为一个新的 Internet Explorer。

否则它不会访问我的用户帐户, 这意味着它将无法访问 cookie、临时 Internet 文件或历史记录

我在使用 InternetExplorerDriver 时误以为是 它正在使用我的 Windows 帐户的信息,例如历史记录等?

最佳答案

这是我能找到的,仍然需要获得启动新 IE9 session 的选项 但解决了如何正确初始化的问题。

    public IWebDriver WebDriver;

    var ieDir = Path.Combine(path, "bin");
    var opts = new InternetExplorerOptions();
    opts.IgnoreZoomLevel = true;

    if (counter < 1) //or in most other cases - (WebDriver==null)
    {
        CleanBr(); // found a solution to programatically delete Browser history 
        // so i still need to find the resolution for options with starting fresh IE profile
        // an IE driver without a user data... 

        WebDriver = new InternetExplorerDriver(ieDir, opts);
    }
    INavigation nav = WebDriver.Navigate();
    nav.GoToUrl(url);

关于c# - selenium ie webdriver 没有我的用户配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17389006/

相关文章:

c# - 更新单个属性集的多个属性

asp.net - 到处都是CSS3 div

c# - 为什么 HttpCacheability.Private 会抑制 ETag?

selenium - Watir/Capybara 和 PhantomJS 的奇怪偏移

python - WebElement 没有属性 w3c

c# - 如何从基于 OnMethodBoundaryAspect 的日志记录中排除?

c# - 类型未知时比较数字类型

c# - 在Unity 3D中模拟 "Swipe to Unlock"

ASP.NET 图表控件不再适用于 .NET 4

java - catch 方法执行时间较长