简体   繁体   中英

FluentAutomation + scriptcs not working

I am trying to get scriptcs + FluentAutomation to work having read Scott Hanselmans blog post: http://www.hanselman.com/blog/NuGetPackageOfTheWeekFluentAutomationForAutomatedTestingOfWebApplications.aspx

Thing is, the demo code on the fluent automation website simply doesn't work:

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

And the code on Scotts blog is closer but still not there:

This for instance:

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);
});

Yields this:

  --------------------------------------------------------------------------
  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)
  ----------------------------------------------------------------------

Has anyone got this working? I am really interested in using scriptcs to build up these specs.

I ran into a similar issue. You may need to install ChromeDriver ( http://goo.gl/yH3jNq )

Be sure to setup the location of the driver .exe in your PATH

I ran into this exception when I didn't have the specified browser installed.

It was a virtual machine that I thought had Chrome/Firefox/IE but it only had IE... oops. Installed Chrome and Firefox and everything worked just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM