I am very much impressed with web driver and page object pattern. Recently I saw Geb framework and with spock framework combination seems to be like a powerful alternate option for automated tests. Is anyone one using Geb? Do you think of any limitations of Geb?
7 Answers
Using Geb at our workplace has been a life-saver. I can't imagine this many people (with absolutely no programming background) picking up Selenium in as short a time span.
I've been very successful creating mavenized geb projects that we have running on Jenkins for our CI. It does have a few limitations like not having the drag and drop ability right out of the box. However, you are always free to use the Selenium APIs whenever the need arises. Also, to the commenter about it lacking the support for phantomJS - says who? You can use absolutely any driver that selenium supports. Check this link for details.

- 116
- 1
- 4
There's nothing wrong with Geb from what I have experienced, but I would widen the search to include some of the recent(ish) drivers coming from Rubyland. Webrat was a great starter, but Capybara is actually quite excellent.
It takes more of a meta-approach, and provied a unified API for several different drivers, including Selenium and head-less alternatives such as HtmlUnit or env.js.
Thanks to JRuby, using libraries written in Ruby os now quite easy.

- 4,568
- 29
- 40
-
Thank you for providing the info on new tools but for us it should either be java or groovy so my search is restricted to those – Aravind Yarram May 17 '11 at 01:43
Geb is great, the only thing lacking is the support of a modern headless driver like phantomJS. There is a project named Ghostdriver but it isn't ready yet. Overall, I am loving using Spock and Geb and it's a game changer on how we develop our web apps at work.

- 942
- 1
- 10
- 24
-
Why do you focus in headless drivers when there are real drivers like Chrome and Firefox ? – Chuchoo Apr 09 '18 at 04:19
Ghostdriver is now available for Selenium lovers. Here's how you can use it with Geb.
Maven-
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.1.0</version>
<scope>test</scope>
</dependency>
GebConfig-
// your path to phantomjs binary
phantombinary = "/Users/kruttik.aggarwal/phantomjs-1.9.7-macosx/bin/phantomjs"
driver = {
DesiredCapabilities caps = new DesiredCapabilities();
caps.setJavascriptEnabled(true);
caps.setCapability(
PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
phantombinary
);
// Launch driver (will take care and ownership of the phantomjs process)
WebDriver driver = new PhantomJSDriver(caps);
System.out.println("starting driver");
driver
}

- 404
- 3
- 7
You may also have a look at Selenide, which is a very concise wrapper over Selenium: https://stackoverflow.com/a/43202999/4717152

- 1
- 1

- 873
- 9
- 7
I have used Geb framework. It is groovy based automation framework. I had issues with creating common reusable methods and common page methods.

- 101
- 2
- 7
Geb runs WebDriver in Groovy. It looks pretty cool and make make WebDriver easier.
If you use WebDriver directly, you can pick from a number of languages.

- 5,253
- 4
- 28
- 34