【发布时间】:2013-05-31 15:05:50
【问题描述】:
当我尝试使用 FluentAutomation 运行测试时遇到以下异常
“System.IO.FileLoadException”类型的第一次机会异常 发生在 FluentAutomation.Core.dll 中
无法加载文件或程序集 'WebDriver, Version=2.25.1.0, Culture=neutral, PublicKeyToken=1c2bd1631853048f' 或其之一 依赖关系。定位程序集的清单定义不 匹配程序集引用。 (HRESULT 异常:0x80131040)
这是堆栈跟踪
在 FluentAutomation.SeleniumWebDriver.b__0(TinyIoCContainer 容器)
在 FluentAutomation.FluentTest.get_I()
我从 nuget 获得了最新版本的 selenium,但在 fluentautomation dll 中似乎有某种硬编码所需的版本
FluentAutomation 看起来真的很棒,所以能够在我的项目中使用它会很棒。
@stirno 请帮忙!
FluentAutomation and selenium 2.32.1.0 看起来与我的问题非常相似,但我已经从 Nuget 下载了最新的 ChromeDriver,并按照规定将其复制到我的 bin 目录中。
我也试过从here 下载最新的并复制进去。不高兴
我也在使用规范流程,所以这是我的设置,以防万一...
[Binding]
public class WebScenario : FluentAutomation.FluentTest
{
private readonly IObjectContainer objectContainer;
public WebScenario(IObjectContainer objectContainer)
{
this.objectContainer = objectContainer;
FluentAutomation.Settings.ScreenshotPath = @"C:\Work\Temp";
FluentAutomation.Settings.ScreenshotOnFailedExpect = false;
FluentAutomation.Settings.ScreenshotOnFailedAction = false;
FluentAutomation.Settings.DefaultWaitTimeout = TimeSpan.FromSeconds(1);
FluentAutomation.Settings.DefaultWaitUntilTimeout = TimeSpan.FromSeconds(30);
FluentAutomation.Settings.MinimizeAllWindowsOnTestStart = true;
}
[BeforeScenario("Web")]
public void BeforeScenario()
{
FluentAutomation.SeleniumWebDriver.Bootstrap(FluentAutomation.SeleniumWebDriver.Browser.Firefox);
objectContainer.RegisterInstanceAs<INativeActionSyntaxProvider>(I);
}
}
第一次访问I 并将其注入PageNavigator 对象时会发生异常
如果您有兴趣,可以从github 下载一个非常简单的源示例
所以我得到了这个工作......我从 GitHub 下载了 FluentAutomation 源并构建了最新的 dll 并将它们放入。看起来这个问题应该在下一个版本中处理:D
【问题讨论】:
-
我将在本地复制此内容,并在早上查看。看起来和我之前看到的有点不同。新的 NuGet 版本也应该在本周末推出。
标签: c# selenium selenium-webdriver fluentautomation