【问题标题】:Unable to run automated tests in VS 2010 on Chrome/Firefox/IE using Selenium Web driver - Shows blank page ??无法使用 Selenium Web 驱动程序在 Chrome/Firefox/IE 上的 VS 2010 中运行自动化测试 - 显示空白页?
【发布时间】:2012-05-02 13:46:22
【问题描述】:

浏览器打开并在所有三个(Chrome/Firefox/IE)中显示一个空白页面。它没有显示任何错误消息,但测试没有运行。无法弄清楚问题。谁能帮帮我?

【问题讨论】:

  • 请用您正在运行的代码更新您的问题。

标签: visual-studio-2010 testing selenium webdriver


【解决方案1】:

您是否仔细检查了open 命令中指向的 URL 是否正确,以及特定的 aspx 页面?

【讨论】:

  • IntegrationTest.Driver = new ChromeDriver(); IntegrationTest.Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(3‌​)); IntegrationTest.Driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(‌​3)); NHibernateSessionManager.Instance.ReleaseSession();这就是我所拥有的......我们如何指定特定页面(.cshtml)指向?
【解决方案2】:

向我们展示一个代码示例。

仔细检查您是否不仅为每个驱动程序创建了一个新实例,而且还提供了一个 URL。

【讨论】:

  • IntegrationTest.Driver = new ChromeDriver(); IntegrationTest.Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(3)); IntegrationTest.Driver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(3)); NHibernateSessionManager.Instance.ReleaseSession();
  • 这就是我所拥有的......我们如何指定特定页面(.cshtml)指向?
  • 因此问题是您没有为 Web 驱动程序提供可访问的位置。所以它要做的就是打开一个新的驱动程序实例,仅此而已。以下代码是访问 Google.com 的示例:IntegrationTest.Driver.Navigate().GoToUrl(http://www.google.com);
猜你喜欢
  • 1970-01-01
  • 2016-09-04
  • 1970-01-01
  • 1970-01-01
  • 2020-01-24
  • 2020-05-12
  • 2020-10-10
  • 1970-01-01
  • 2020-10-25
相关资源
最近更新 更多