An organization is looking to invest in functional programming. Using es6, react, clojure and reagent as some of the tools.

When writing end user acceptance testing I usually use Selenium with a language binding, in my case ruby and the capybara or watir DSLs and a test framework such as rspec which basically defines how my code is going to be laid out with describe's it's, nesting and before :each's.

While it's preferable to share the same language as the developers, is there an option to do that here given the existing (non-functional) approach that is normally presented by the selenium tool language bindings and test framework implementations ? Is there a test framework that uses selenium that is built around a more "functional" approach ? Or is a functional approach to UI test automation trying to use the wrong tool for the job? I'm excluding tools like jasmine as they are unit tests and are also not functional in layout.

  • 1
    Closing mafia strikes again? And again, not adding any comments or reasoning for closing, to be able to hide their names until question is fully closed? Just because you are confused/scared by term "closure" it does not mean it is NOT a valid question Jul 25, 2017 at 15:10
  • 1
    I disagree with your premise that QA shout share the language with development. Language is a tool, and I prefer to use the best tool for the job. I know about a project developed in C++ for speed, but QA used a scripting language for productivity and flexibility. But you have a valid question. Jul 25, 2017 at 15:15
  • Thanks Peter, I'm definitely interested in other folks opinions and experience for points like that. Thanks again. Jul 25, 2017 at 18:35

2 Answers 2


I wouldn't advise setting up test suites using a functional language.

  • It requires the testing team to essentially learn how to program again in a functional way
  • Selenium and similar libraries are supported and well documented in languages such as Ruby, Python, and Java. This is not the case for F#, Haskell, or Clojure
  • Some would argue that you don't need to use the same programming language as the developers, stick to the language your team are comfortable using

I'd suggest only moving over to a functional language if you absolutely have to, and I really doubt that's the case. While learning FP is useful, and can improve your own programming ability, it's best to stick to a well documented language with supported libraries which have a large user base.

  • 1
    +1. Also, in Python you can program parts of your code using functional paradigm (generators, lists etc) if you have the need, without committing yourself to pure functional approach. Jul 25, 2017 at 15:18

You can use functional programming for acceptance tests. The F# library canopy is one that builds on Selenium, and could probably work with .NET tools like SpecFlow.

I suspect that there are similar tools for the languages you're planning to work with but I don't know enough about them to find them.

The key to how well functional programming would work with your UI test automation is how well it works to describe the way your application works. The biggest hurdle you're likely encounter is that functional programming requires a different way of thinking to do well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.