Blog

Friday, 8 February 2013

Faster Arquillian and Graphene 2 test development

Tired of long turnaround when writing tests with Arquillian and Graphene 2?
Thanks to Pavol Pitonak we've learned how to speed test development up by order of magnitude.

Graphene 2 allows you to efficiently test user interfaces of web applications. You write the simple test code and run it in your IDE or with Maven and Graphen takes care of starting selenium server, lunching the web browser and do the clicking.

Sounds fantastic, but when you are developing the test the time between running the test, fixing it and running again is too long. It's pure waste.
It's because for each run the selenium-server needs to be started and a new session be created.
For deveopment purposes we can speed it up by starting selenium server ourselves in standalone mode and configuring Arquillian to reuse existing session.

4. Now, you should specify, which browser will be used to execute tests. I assume, you have Firefox in your computer. So, in next step you should add arquillian.xml to project in /src/test/resources directory.
Example configuration, with Firefox as default browser for WebDriver: