A REPL is helpful for quick script development with selenium. Scala's REPL offers built-in tab completion and persistent history across sessions. Selenium's javadocs are also more user-friendly than their python counterparts.
In a new directory, create a build.sbt
file with, at minimum, a project name of your choice and a [dependency on selenium] 1. Now, you can launch the scala console from within sbt. If you're using chromedriver, download the driver into the directory or [add a property] 2 with the correct path prior to instantiating ChromeDriver.
$ sbt update
$ sbt
sbt > console
scala > import org.openqa.selenium.chrome.ChromeDriver
scala > val chrome = new ChromeDriver()
scala > chrome.get("http://www.nytimes.com")
scala > chrome.quit
scala > exit
sbt > exit
Got an error -- java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
Is there a way to work with chrome driver without setting the system property ?