In simple terms, "its made programming fun again", and with that, I am applying this new knowledge to my projects.
I realize Java is not a fully functional language, like Clojure, Haskell or even Scala; however, it has some functional aspects that get you moving in the functional language direction without having to make a programming change, while trying to understand the new paradigm.
The example below, the getFile function takes a WebDriver and returns a File, while using a predicate to test the instance of the driver. Base on the outcome, an additional function is called accepting the driver and returns a File.
|getFile driver -> instanceOfRemoteDriver. ( ) ? remoteDriverScreenshotFile. ( ) : webDriverScreenshotFile. ( );|
As this shift continues to grow and gather momentum, Java automation engineers will start to feel the pressure to make a change. In my observations, QA automation engineers tend to lag behind the latest trends within his/her respected language. With that said, I created a GitHub project to share ideas and concepts around functional programming using Java and WebDriver (and in the future Scala).
Examples can be found @ functional-programming-selenium-examples