2

Protractor.Netを使用していますが、IE で奇妙な問題が発生しています。この問題はサイトのブートストラップに関係していると思いますが、それを理解するのに十分な知識がありません. ただし、同じコードは と で正常に動作ChromeFirefoxます。

同じページで実行している 2 つの異なるテストがあります。non-angular私のアプリケーションはangualrハイブリッドです。Angular ページに移動した後、最初のテストは問題なく実行されます。テストが必要な場合は、urlもう一度同じ場所に移動しますが、それを実行しようとすると壊れます。添付ファイルは、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()));
4

1 に答える 1

1

私は実際にプロジェクトでバグを見つけました。URLプロパティセッターの前に次の行を設定すると、問題が解決します!

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;
    }
}
于 2015-01-31T06:35:19.220 に答える