0

I want to run my Geb specs with chrome driver without having to watch the tests on the browser? can this be done?

P.D.: I know I can use the HtmlUnitDriver, but this driver sometimes gives my errors (caused mainly by timeouts) that the chrome driver don't.

Tomas Romero
  • 8,418
  • 11
  • 50
  • 72

1 Answers1

2

There is currently no way to do this with Chrome, Safari, Opera or FireFox, however there are multiple options you can do. First is to pipe the "window" into a virtual frame buffer (if you're using Linux). This process will pop open the browser, only in memory. I talk about this in my blog post (http://www.ensor.cc/2011/05/maven-javascript-unit-test-using.html) during the maven pre-integration phase

The other option is to use the brand new GhostDriver. GhostDriver is a WebDriver implementation of PhantomJS which is a headless WebKit. This is WAY better than HtmlUnit but still has some features being built out. GhostDriver is currently not in Maven Central, so you will need to manually add it to the common repository. You can then use it as a WebDriver. This has worked for me with moderate success (90% of my test cases dropped in without any changes needed).

Read this first: http://blog.ivandemarino.me/2012/12/04/Finally-GhostDriver-1-0-0 Then refer to the GitHub README and code: https://github.com/detro/ghostdriver

mensor
  • 190
  • 8