Skip to main content

Geb Browser Automation Quick Start Windows



How to Stand Up a Geb Sample Application in Windows


This guide will show you step-by-step how to setup a simple Geb app to get started using the automated testing framework.  This guide focuses on using the Chrome browser for testing.  Please update chrome to the most recent version available because chromedriver only works with versions 12.0.712.0 and higher.


If you are trying to setup geb on Linux please use the following link instead:

Pull a copy of the Geb Sample App


 First, pull the Geb sample application from Github:

https://github.com/geb/geb-example-grails


HTTPS Clone URL:
https://github.com/geb/geb-example-grails.git



Ensure you have Chrome.exe installed in the expected location


OSExpected Location of Chrome executable 
Linux/usr/bin/google-chrome1
Mac/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
Windows XP%HOMEPATH%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe
Windows VistaC:\Users\%USERNAME%\AppData\Local\Google\Chrome\Application\chrome.exe

1 For Linux systems, the ChromeDriver expects /usr/bin/google-chrome to be a symlink to the actual Chrome binary. See also the section on overriding the Chrome binary location .

Download and Install Chrome Driver

Download the latest version of Chrome Driver:

As of 3/27/2014 the latest version for Windows is:  Download chromedriver 2.9 for Windows

For other platforms please use the list of all downloads here:


You will want to unzip chromedriver_win32.zip(or the file for your respective OS).  I unzipped mine into the C:/ drive base directory.


Picture of the location and contents of the chromedriver folder
The chromedriver directory will contain only the chromedriver.exe executable

You will then either want to add the chromedriver location to your system path or as a VM argument.


Adding chromedriver to your system path

Windows 7:  Start -> Right-click "computer" -> Advanced system settings -> Environment Variables -> Select the PATH User variable -> Edit -> Add "C:\chromedriver_win32" or wherever you installed it to the end of your path value.


Setting the path as a VM argument

Add the running to your run configuration in your IDE:

-Dwebdriver.chrome.driver=C:\chromedriver_win32


You may have to restart your computer for these changes to be recognized

Try restarting your PC if the chromedriver executable is not being found.


For additional info, you can review the ChromeDriver Documentation here: 

The "Need Help" section contains solutions for many common problems you may encounter.



For IntelliJ IDEA users only:

There is a bug where forked tests are enabled by default which causes an issue.  Please see the following blog post on how to resolve that issue:  http://codedevstuff.blogspot.com/2014/03/run-forked-tests-in-grails-on-intellij.html




Run the application


It's now time to try running the Geb sample application.  


Add the following VM argument:

-Dgeb.env=chrome


Then run the command:


grails test-app


You should see something in the logs similar to the following if successful:

Starting ChromeDriver (v2.9.248315) on port 3826

Sample of geb app test run logs
Successful run of Geb test application

A separate instance of Chrome should start automatically with several actions such as users being added and deleted being performed.

Screen capture of Geb automated testing on Chrome
Chromedriver in action performing automated testing


Additional Resources


Related links
Geb Home Page
Geb Github
Book of Geb



Slideshare Presentation on Geb






Software Development Blogs - BlogCatalog Blog Directory

Popular posts from this blog

Change Port on a Spring Boot Application when using intelliJ

Change Port on a Spring Boot Application when using intelliJ  Two ways to change the port that the embedded Tomcat is using in a Spring Boot Application. The first way is to modify the application properties in the resources folder: Update application props in Spring Boot Application There are a couple issues with this approach.  You might only want this port change in your local environment and if you check it in by accident you might break things. Alternatively, you can use a command line parameter. Go to Run -> Edit Configurations -> VM options Then enter in the following argument: -Dserver.port=8090 Then click apply and OK and attempt to run the application again. Update port using VM option

How to set up a SQL Server 2008 Local Database

Setting up and Configuring your Microsoft SQL Server 2008 Local Database Download SQL Server Download SQL Server Express.  Express is the Free edition of MS SQL Server http://www.microsoft.com/en-us/download/details.aspx?id=1695 Install your SQL Server Instance Click the Start button -> Click Microsoft SQL Server 2008 -> Click Configuration Tools -> Select SQL Server Installation Center Select Installation -> Select New SQL Server stand-alone installation Select SQL Server stand-alone installation Get your Local SQL Server Service Up and Running Open up the SQL Server Configuration Manager Click the Start button -> Click Microsoft SQL Server 2008 -> Click Configuration Tools -> Select SQL Server Configuration Manager Setup SQL Server Config Manager Start up the SQL Services You want to ensure the following services are in the "Running" State and then you want to set the following services to automatic St...

Building Microservices with JHipster

Check out this article on Medium and LinkedIn Pulse, for a brief overview of microservices as a primer for working with JHipster to build web applications with a Microservices backend. Building microservices with Jhipster JHipster is sponsored by Ippon Technologies(https://www.ippon.tech/). Need cost-effective fractional engineering with US expertise? Fintech and Blockchain Specialized Fractional Engineering