量角器和 IE11 导航问题

Protractor and IE11 navigation issue

我正在使用 Protractor.Net 并且在使用 IE 时遇到了一个奇怪的问题。我认为这个问题与网站引导有关,但知识不足以弄清楚。然而,相同的代码在 ChromeFirefox 上运行良好。

我在同一个页面上执行了两个不同的测试。我的应用程序是 non-angularangualr 的混合体。导航到 Angular 页面后,第一个测试执行没有任何问题。出于测试需要,我再次导航到相同的 url,当我尝试这样做时,它的 breaking.The 附件也可以在 Imgur Imgur Imgur Imgur

 //Navigate and binds the page

 public TestPage TestPage()
 {
     string url = BaseUrl + "/n/Test/TestPage#/";

     //need to handle asyn script call timeout
     Driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(10));

     NgWebDriver ngDriver = new NgWebDriver(Driver, "[ng-app='Test']");
     ngDriver.Navigate().GoToUrl(url);

     return new TestPage(ngDriver);
 }



// Resume Angular bootstrap this is in URL setter and  fails here on second iteration
this.jsExecutor.ExecuteScript(ClientSideScripts.ResumeAngularBootstrap,
String.Join(",", this.mockModules.Select(m => m.Name).ToArray()));

我居然在项目中发现了一个bug。在 URL 属性 setter 之前设置以下行可以解决问题![​​=12=]

this.driver.Url = "about:blank";

 get
{
    this.WaitForAngular();
    IHasCapabilities hcDriver = this.driver as IHasCapabilities;
    if (hcDriver != null && hcDriver.Capabilities.BrowserName == "internet explorer")
    {
        // 'this.driver.Url' does not work on IE
       //this.driver.Url = "about:blank"; //this is bug fix
        return this.jsExecutor.ExecuteScript(ClientSideScripts.GetLocationAbsUrl, this.rootElement) as string;
    }
    else
    {
        return this.driver.Url;
    }
}