【问题标题】:FluentAutomation + scriptcs not workingFluentAutomation + scriptcs 不工作
【发布时间】:2014-11-06 16:27:53
【问题描述】:

阅读 Scott Hanselmans 的博文后,我正在尝试让 scriptcs + FluentAutomation 工作:http://www.hanselman.com/blog/NuGetPackageOfTheWeekFluentAutomationForAutomatedTestingOfWebApplications.aspx

问题是,fluent 自动化网站上的演示代码根本不起作用:

http://fluent.stirno.com/docs/#scriptcs

Scotts 博客上的代码更接近但仍然不存在:

例如:

var Test = Require<F14N>()
    .Init<FluentAutomation.SeleniumWebDriver>()
    .Bootstrap("Chrome")
    .Config(settings => {
        // Easy access to FluentAutomation.Settings values
        settings.DefaultWaitUntilTimeout = TimeSpan.FromSeconds(1);
    });

Test.Run("Hello Google", I => {
    I.Open(http://google.com);
});

产生这个:

  --------------------------------------------------------------------------
  F14N - Fluent Automation Console
  -------------------------------------------------------------------------

  1) Hello Google

  ----------------------------------------------------------------------
  Unable to resolve type: OpenQA.Selenium.IWebDriver
  --------
  An unexpected exception was thrown inside WaitUntil(Action). See
  InnerException for details.
     at FluentAutomation.BaseCommandProvider.<>c__DisplayClass9.<WaitUnt
  il>b__8()
     at FluentAutomation.BaseCommandProvider.Act(CommandType commandType
  , Action action)
     at FluentAutomation.BaseCommandProvider.WaitUntil(Expression`1 cond
  itionAction, TimeSpan timeout)
     at FluentAutomation.BaseCommandProvider.Act(CommandType commandType
  , Action action)
     at FluentAutomation.CommandProvider.Navigate(Uri url)
     at FluentAutomation.ActionSyntaxProvider.Open(Uri url)
     at FluentAutomation.ActionSyntaxProvider.Open(String url)
     at Submission#0.<.ctor>b__2(IActionSyntaxProvider I)
     at ScriptCs.FluentAutomation.F14N.Run(String name, Action`1 action)
  ----------------------------------------------------------------------

有人搞定这个吗?我对使用脚本来构建这些规范非常感兴趣。

【问题讨论】:

    标签: selenium fluentautomation scriptcs


    【解决方案1】:

    我遇到了类似的问题。你可能需要安装ChromeDriver (http://goo.gl/yH3jNq)

    请务必在您的 PATH 中设置驱动程序 .exe 的位置

    【讨论】:

      【解决方案2】:

      当我没有安装指定的浏览器时,我遇到了这个异常。

      这是一个我以为有 Chrome/Firefox/IE 的虚拟机,但它只有 IE...哎呀。安装了 Chrome 和 Firefox,一切正常。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多